From 21395c6df5a5125971a7c42a341093a0de542060 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Wed, 18 Nov 2026 13:25:14 +0000 Subject: [PATCH 1/2] setup.sh - make SpiderMonkey patch seds idempotent so the script can be re-run The Unbox and -ld64 substitutions matched their own output, so a second run produced JS_PUBLIC_API JS_PUBLIC_API and a nested -ld64 expression. Skip lines already patched. --- setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 09c8e8a3..299a66f1 100755 --- a/setup.sh +++ b/setup.sh @@ -82,8 +82,8 @@ cd firefox-source # Apply patching # making it work for both GNU and BSD (macOS) versions of sed sed -i'' -e 's/os not in ("WINNT", "OSX", "Android")/os not in ("WINNT", "Android")/' ./build/moz.configure/pkg.configure # use pkg-config on macOS -sed -i'' -e 's/bool Unbox/JS_PUBLIC_API bool Unbox/g' ./js/public/Class.h # need to manually add JS_PUBLIC_API to js::Unbox until it gets fixed in Spidermonkey -sed -i'' -e 's/bool js::Unbox/JS_PUBLIC_API bool js::Unbox/g' ./js/src/vm/JSObject.cpp # same here +sed -i'' -e '/JS_PUBLIC_API bool Unbox/!s/bool Unbox/JS_PUBLIC_API bool Unbox/g' ./js/public/Class.h # need to manually add JS_PUBLIC_API to js::Unbox until it gets fixed in Spidermonkey +sed -i'' -e '/JS_PUBLIC_API bool js::Unbox/!s/bool js::Unbox/JS_PUBLIC_API bool js::Unbox/g' ./js/src/vm/JSObject.cpp # same here sed -i'' -e 's/shared_lib = self._pretty_path(libdef.output_path, backend_file)/shared_lib = libdef.lib_name/' ./python/mozbuild/mozbuild/backend/recursivemake.py # would generate a Makefile to install the binary files from an invalid path prefix sed -i'' -e 's/% self._pretty_path(libdef.import_path, backend_file)/% libdef.import_name/' ./python/mozbuild/mozbuild/backend/recursivemake.py # same as above. Shall we file a bug in bugzilla? sed -i'' -e 's/if version < Version(mac_sdk_min_version())/if False/' ./build/moz.configure/toolchain.configure # do not verify the macOS SDK version as the required version is not available on Github Actions runner @@ -91,7 +91,7 @@ sed -i'' -e 's/return JS::GetWeakRefsEnabled() == JS::WeakRefSpecifier::Disabled sed -i'' -e 's/return !IsIteratorHelpersEnabled()/return false/' ./js/src/vm/GlobalObject.cpp # forcibly enable iterator helpers sed -i'' -e '/MOZ_CRASH_UNSAFE_PRINTF/,/__PRETTY_FUNCTION__);/d' ./mfbt/LinkedList.h # would crash in Debug Build: in `~LinkedList()` it should have removed all this list's elements before the list's destruction sed -i'' -e '/MOZ_ASSERT(stackRootPtr == nullptr);/d' ./js/src/vm/JSContext.cpp # would assert false in Debug Build since we extensively use `new JS::Rooted` -sed -i'' -e 's/"-fuse-ld=ld"/"-ld64" if c_compiler.version > "14.0.0" else "-fuse-ld=ld"/' ./build/moz.configure/toolchain.configure # XCode 15 changed the linker behaviour. See https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking +sed -i'' -e '/"-ld64" if/!s/"-fuse-ld=ld"/"-ld64" if c_compiler.version > "14.0.0" else "-fuse-ld=ld"/' ./build/moz.configure/toolchain.configure # XCode 15 changed the linker behaviour. See https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking sed -i'' -e 's/defined(XP_WIN)/defined(_WIN32)/' ./mozglue/baseprofiler/public/BaseProfilerUtils.h # this header file is introduced to js/Debug.h in https://phabricator.services.mozilla.com/D221102, but it would be compiled without XP_WIN in this building configuration sed -i'' -e 's/os\.environ\["MOZILLABUILD"\]/os.environ.get("MOZILLABUILD", "")/g' ./python/mozbuild/mozbuild/backend/visualstudio.py # avoid KeyError: we don't use the official Mozilla Build package, so this is never set From 78c60b76b10083eda1019a135bbf256f145f7796 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Wed, 18 Nov 2026 13:25:14 +0000 Subject: [PATCH 2/2] xhr-http-keep-alive test - fail clearly when strace is missing or cannot trace Previously a missing strace was reported as "TCP connections opened: 0". --- tests/js/xhr-http-keep-alive.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/js/xhr-http-keep-alive.bash b/tests/js/xhr-http-keep-alive.bash index 3ac6a421..f6d531b3 100644 --- a/tests/js/xhr-http-keep-alive.bash +++ b/tests/js/xhr-http-keep-alive.bash @@ -26,6 +26,9 @@ if [[ "$OSTYPE" != "linux-gnu"* ]]; then # TODO: add tests on Windows and macOS. What's the equivalence of `strace`? fi +command -v strace >/dev/null || panic "strace is not installed" +strace -o /dev/null true 2>/dev/null || panic "strace cannot trace processes here (ptrace denied?)" + code=' function newRequest(url) { return new Promise(function (resolve, reject)