Skip to content

Commit e8dc5ac

Browse files
committed
tools: limit parallelism with ninja in V8 builds
If `JOBS` has been set in the environment to limit build parallelism, pass that onto `ninja` when building V8. PR-URL: #51473 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent e51221b commit e8dc5ac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/make-v8.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ cd deps/v8 || exit
99
find . -type d -name .git -print0 | xargs -0 rm -rf
1010
../../tools/v8/fetch_deps.py .
1111

12+
JOBS_ARG=
13+
if [ "${JOBS}" ]; then
14+
JOBS_ARG="-j ${JOBS}"
15+
fi
16+
1217
ARCH=$(arch)
1318
if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
1419
TARGET_ARCH=$ARCH
@@ -46,10 +51,10 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
4651
gcc --version
4752
export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config
4853
gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="is_component_build=false is_debug=false use_goma=false goma_dir=\"None\" use_custom_libcxx=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true $CC_WRAPPER"
49-
ninja -v -C "out.gn/$BUILD_ARCH_TYPE" d8 cctest inspector-test
54+
ninja -v -C "out.gn/$BUILD_ARCH_TYPE" "${JOBS_ARG}" d8 cctest inspector-test
5055
else
5156
DEPOT_TOOLS_DIR="$(cd _depot_tools && pwd)"
5257
# shellcheck disable=SC2086
5358
PATH="$DEPOT_TOOLS_DIR":$PATH tools/dev/v8gen.py "$BUILD_ARCH_TYPE" --no-goma $V8_BUILD_OPTIONS
54-
PATH="$DEPOT_TOOLS_DIR":$PATH ninja -C "out.gn/$BUILD_ARCH_TYPE/" d8 cctest inspector-test
59+
PATH="$DEPOT_TOOLS_DIR":$PATH ninja -C "out.gn/$BUILD_ARCH_TYPE/" "${JOBS_ARG}" d8 cctest inspector-test
5560
fi

0 commit comments

Comments
 (0)