From 6552556608342ed4fc0b638b7813ef7da6be3c6b Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 14 Dec 2021 00:49:35 -0800 Subject: [PATCH] devops: attempt to fix Firefox M95 release compilation (#10908) Builders fail to download release toolchains; fallback to LLVM from Homebrew on Mac. References #10759 --- browser_patches/firefox/build.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/browser_patches/firefox/build.sh b/browser_patches/firefox/build.sh index 0cee43dfec..d4e65dc653 100755 --- a/browser_patches/firefox/build.sh +++ b/browser_patches/firefox/build.sh @@ -86,10 +86,30 @@ if [[ $1 != "--juggler" ]]; then fi if [[ $1 == "--full" || $2 == "--full" ]]; then - echo "ac_add_options --enable-bootstrap" >> .mozconfig if [[ "$(uname)" == "Darwin" || "$(uname)" == "Linux" ]]; then SHELL=/bin/sh ./mach --no-interactive bootstrap --application-choice=browser fi + if [[ "$(uname)" == "Darwin" ]]; then + HOMEBREW_LLVM="/opt/homebrew/opt/llvm/bin/clang"; + if [[ ! -f "${HOMEBREW_LLVM}" || $($HOMEBREW_LLVM --version) != *"version 13"* ]]; then + echo "ERROR: as of Dec, 2021, building release firefox requires HomeBrew LLVM v13" + echo "Please run:" + echo + echo " brew install llvm@13" + echo + exit 1 + fi + echo "CC=${HOMEBREW_LLVM}" >> .mozconfig + echo "CXX=${HOMEBREW_LLVM}++" >> .mozconfig + + # Download wasi toolchain if needed + if [[ ! -d "$HOME/.mozbuild/sysroot-wasm32-wasi" ]]; then + ./mach artifact toolchain --from-build toolchain-sysroot-wasm32-wasi + mv ./sysroot-wasm32-wasi ~/.mozbuild/ + fi + elif [[ "$(uname)" == "Linux" ]]; then + echo "ac_add_options --enable-bootstrap" >> .mozconfig + fi if [[ ! -z "${WIN32_REDIST_DIR}" ]]; then # Having this option in .mozconfig kills incremental compilation. echo "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfig