devops: attempt to fix Firefox build (#16050)
This commit is contained in:
Родитель
60ab16377a
Коммит
265d00e3f9
|
@ -3,7 +3,6 @@ set -e
|
|||
set +x
|
||||
|
||||
RUST_VERSION="1.59.0"
|
||||
CBINDGEN_VERSION="0.24.3"
|
||||
|
||||
trap "cd $(pwd -P)" EXIT
|
||||
|
||||
|
@ -117,62 +116,36 @@ if [[ -z "${IS_JUGGLER}" ]]; then
|
|||
rustup install "${RUST_VERSION}"
|
||||
rustup default "${RUST_VERSION}"
|
||||
fi
|
||||
|
||||
# TODO: cargo is not in the PATH on Windows
|
||||
if command -v cargo >/dev/null; then
|
||||
echo "-- Using cbindgen v${CBINDGEN_VERSION}"
|
||||
cargo install cbindgen --version "${CBINDGEN_VERSION}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "${IS_FULL}" ]]; then
|
||||
if is_mac; then
|
||||
echo "ac_add_options --enable-bootstrap" >> .mozconfig
|
||||
else
|
||||
# This is a slow but sure way to get all the necessary toolchains.
|
||||
# However, it will not work if tree is dirty.
|
||||
# Bail out if git repo is dirty.
|
||||
if [[ -n $(git status -s --untracked-files=no) ]]; then
|
||||
echo "ERROR: dirty GIT state - commit everything and re-run the script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 1. We have a --single-branch checkout, so we have to add a "master" branch and fetch it
|
||||
git remote set-branches --add browser_upstream master
|
||||
git fetch browser_upstream master
|
||||
# 2. Checkout the master branch and run bootstrap from it.
|
||||
git checkout browser_upstream/master
|
||||
SHELL=/bin/sh ./mach --no-interactive bootstrap --application-choice=browser
|
||||
git checkout -
|
||||
rm -rf "${OBJ_FOLDER}"
|
||||
# This is a slow but sure way to get all the necessary toolchains.
|
||||
# However, it will not work if tree is dirty.
|
||||
# Bail out if git repo is dirty.
|
||||
if [[ -n $(git status -s --untracked-files=no) ]]; then
|
||||
echo "ERROR: dirty GIT state - commit everything and re-run the script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 1. We have a --single-branch checkout, so we have to add a "master" branch and fetch it
|
||||
git remote set-branches --add browser_upstream master
|
||||
git fetch browser_upstream master
|
||||
# 2. Checkout the master branch and run bootstrap from it.
|
||||
git checkout browser_upstream/master
|
||||
echo "ac_add_options --enable-bootstrap" >> .mozconfig
|
||||
SHELL=/bin/sh ./mach --no-interactive bootstrap --application-choice=browser
|
||||
git checkout -
|
||||
rm -rf "${OBJ_FOLDER}"
|
||||
|
||||
if [[ -n "${WIN32_REDIST_DIR}" ]]; then
|
||||
# Having this option in .mozconfig kills incremental compilation.
|
||||
echo "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfig
|
||||
fi
|
||||
fi
|
||||
|
||||
# Remove the cbindgen from mozbuild to rely on the one we install manually.
|
||||
# See https://github.com/microsoft/playwright/issues/15174
|
||||
if is_win; then
|
||||
rm -rf "${USERPROFILE}\\.mozbuild\\cbindgen"
|
||||
else
|
||||
rm -rf "${HOME}/.mozbuild/cbindgen"
|
||||
fi
|
||||
|
||||
|
||||
if [[ -n "${IS_JUGGLER}" ]]; then
|
||||
./mach build faster
|
||||
else
|
||||
export MOZ_AUTOMATION=1
|
||||
# Use winpaths instead of unix paths on Windows.
|
||||
# note: 'cygpath' is not available in MozBuild shell.
|
||||
if is_win; then
|
||||
export MOZ_FETCHES_DIR="${USERPROFILE}\\.mozbuild"
|
||||
else
|
||||
export MOZ_FETCHES_DIR="${HOME}/.mozbuild"
|
||||
fi
|
||||
./mach build
|
||||
if is_mac; then
|
||||
FF_DEBUG_BUILD="${IS_DEBUG}" node "${SCRIPT_FOLDER}"/install-preferences.js "$PWD"/${OBJ_FOLDER}/dist
|
||||
|
|
Загрузка…
Ссылка в новой задаче