From f97a1f1c549f839d0836014dea74c725969f81bf Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Tue, 7 Jan 2025 17:58:01 +0100 Subject: [PATCH] Fix spidermonkey profiling build Instruments is macOS only, so don't try to enable it on other platforms. Also don't quote ${JOBS} as it might be unset and passing an empty string to "mach build" may result in configure failing. Fixes: #7470 Signed-off-by: Ralph Sennhauser --- libraries/source/spidermonkey/build.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/libraries/source/spidermonkey/build.sh b/libraries/source/spidermonkey/build.sh index 1269927334..31ffa9ab0f 100755 --- a/libraries/source/spidermonkey/build.sh +++ b/libraries/source/spidermonkey/build.sh @@ -6,7 +6,7 @@ cd "$(dirname "$0")" # This should match the version in config/milestone.txt FOLDER="mozjs-115.16.1" # If same-version changes are needed, increment this. -LIB_VERSION="115.16.1+2" +LIB_VERSION="115.16.1+3" LIB_NAME="mozjs115" echo "Building SpiderMonkey..." @@ -72,11 +72,16 @@ tar xfJ "${FOLDER}.tar.xz" export MOZBUILD_STATE_PATH="${MOZBUILD_STATE_PATH:=$(pwd)/mozbuild-state}" if [ -n "$PROFILE" ]; then - CONF_OPTS="$CONF_OPTS --enable-profiling - --enable-perf - --enable-instruments - --enable-jitspew - --with-jitreport-granularity=3" + CONF_OPTS="$CONF_OPTS + --enable-profiling + --enable-perf + --enable-jitspew + --with-jitreport-granularity=3" + + if [ "${OS}" = "Darwin" ]; then + CONF_OPTS="$CONF_OPTS + --enable-instruments" + fi fi if [ "${OS}" = "Windows_NT" ]; then @@ -119,20 +124,22 @@ tar xfJ "${FOLDER}.tar.xz" # Build # Debug (broken on FreeBSD) if [ "${OS}" != "FreeBSD" ]; then + # shellcheck disable=SC2086 MOZCONFIG="$(pwd)/../mozconfig" \ MOZCONFIG_OPTIONS="${CONF_OPTS} \ --enable-debug \ --disable-optimize \ --enable-gczeal" \ BUILD_DIR="build-debug" \ - ./mach build "${JOBS}" + ./mach build ${JOBS} fi # Release + # shellcheck disable=SC2086 MOZCONFIG="$(pwd)/../mozconfig" \ MOZCONFIG_OPTIONS="${CONF_OPTS} \ --enable-optimize" \ BUILD_DIR="build-release" \ - ./mach build "${JOBS}" + ./mach build ${JOBS} ) # install