From 477ef552fbcf186decf4939691d4ef8629965c8d Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 6 Aug 2021 20:16:14 +0300 Subject: [PATCH] devops(ff-beta): fix rust installation while building firefox (#8049) --- browser_patches/firefox-beta/build.sh | 36 ++++++++++++++------------- browser_patches/firefox/build.sh | 36 ++++++++++++++------------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/browser_patches/firefox-beta/build.sh b/browser_patches/firefox-beta/build.sh index 98439d9dfd..f3275d7dbf 100755 --- a/browser_patches/firefox-beta/build.sh +++ b/browser_patches/firefox-beta/build.sh @@ -82,23 +82,7 @@ OBJ_FOLDER="obj-build-playwright" echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/${OBJ_FOLDER}" >> .mozconfig echo "ac_add_options --disable-crashreporter" >> .mozconfig -if [[ $1 == "--full" || $2 == "--full" ]]; then - if [[ "$(uname)" == "Darwin" || "$(uname)" == "Linux" ]]; then - SHELL=/bin/sh ./mach --no-interactive bootstrap --application-choice=browser - fi - if [[ ! -z "${WIN32_REDIST_DIR}" ]]; then - # Having this option in .mozconfig kills incremental compilation. - echo "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfig - fi -fi - -if ! [[ -f "$HOME/.mozbuild/_virtualenvs/mach/bin/python" ]]; then - ./mach create-mach-environment -fi - -if [[ $1 == "--juggler" ]]; then - ./mach build faster -else +if [[ $1 != "--juggler" ]]; then # TODO: rustup is not in the PATH on Windows if command -v rustup >/dev/null; then # We manage Rust version ourselves. @@ -115,6 +99,24 @@ else ./mach build fi +if [[ $1 == "--full" || $2 == "--full" ]]; then + if [[ "$(uname)" == "Darwin" || "$(uname)" == "Linux" ]]; then + SHELL=/bin/sh ./mach --no-interactive bootstrap --application-choice=browser + fi + if [[ ! -z "${WIN32_REDIST_DIR}" ]]; then + # Having this option in .mozconfig kills incremental compilation. + echo "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfig + fi +fi + +if ! [[ -f "$HOME/.mozbuild/_virtualenvs/mach/bin/python" ]]; then + ./mach create-mach-environment +fi + +if [[ $1 == "--juggler" ]]; then + ./mach build faster +fi + if [[ "$(uname)" == "Darwin" ]]; then node "${SCRIPT_FOLDER}"/install-preferences.js $PWD/${OBJ_FOLDER}/dist else diff --git a/browser_patches/firefox/build.sh b/browser_patches/firefox/build.sh index daaad8176e..157ddec523 100755 --- a/browser_patches/firefox/build.sh +++ b/browser_patches/firefox/build.sh @@ -82,23 +82,7 @@ OBJ_FOLDER="obj-build-playwright" echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/${OBJ_FOLDER}" >> .mozconfig echo "ac_add_options --disable-crashreporter" >> .mozconfig -if [[ $1 == "--full" || $2 == "--full" ]]; then - if [[ "$(uname)" == "Darwin" || "$(uname)" == "Linux" ]]; then - SHELL=/bin/sh ./mach --no-interactive bootstrap --application-choice=browser - fi - if [[ ! -z "${WIN32_REDIST_DIR}" ]]; then - # Having this option in .mozconfig kills incremental compilation. - echo "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfig - fi -fi - -if ! [[ -f "$HOME/.mozbuild/_virtualenvs/mach/bin/python" ]]; then - ./mach create-mach-environment -fi - -if [[ $1 == "--juggler" ]]; then - ./mach build faster -else +if [[ $1 != "--juggler" ]]; then # TODO: rustup is not in the PATH on Windows if command -v rustup >/dev/null; then # We manage Rust version ourselves. @@ -115,6 +99,24 @@ else ./mach build fi +if [[ $1 == "--full" || $2 == "--full" ]]; then + if [[ "$(uname)" == "Darwin" || "$(uname)" == "Linux" ]]; then + SHELL=/bin/sh ./mach --no-interactive bootstrap --application-choice=browser + fi + if [[ ! -z "${WIN32_REDIST_DIR}" ]]; then + # Having this option in .mozconfig kills incremental compilation. + echo "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfig + fi +fi + +if ! [[ -f "$HOME/.mozbuild/_virtualenvs/mach/bin/python" ]]; then + ./mach create-mach-environment +fi + +if [[ $1 == "--juggler" ]]; then + ./mach build faster +fi + if [[ "$(uname)" == "Darwin" ]]; then node "${SCRIPT_FOLDER}"/install-preferences.js $PWD/${OBJ_FOLDER}/dist else