Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops(ff-beta): fix rust installation while building firefox (#8049)

Andrey Lushnikov477ef552fbcf
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,6 +82,23 @@ OBJ_FOLDER="obj-build-playwright"
echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/${OBJ_FOLDER}" >> .mozconfig
echo "ac_add_options --disable-crashreporter" >> .mozconfig
+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.
+ echo "-- Using rust v${RUST_VERSION}"
+ 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
+ ./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
@@ -98,21 +115,6 @@ fi
if [[ $1 == "--juggler" ]]; then
./mach build faster
-else
- # TODO: rustup is not in the PATH on Windows
- if command -v rustup >/dev/null; then
- # We manage Rust version ourselves.
- echo "-- Using rust v${RUST_VERSION}"
- 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
- ./mach build
fi
if [[ "$(uname)" == "Darwin" ]]; then
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,6 +82,23 @@ OBJ_FOLDER="obj-build-playwright"
echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/${OBJ_FOLDER}" >> .mozconfig
echo "ac_add_options --disable-crashreporter" >> .mozconfig
+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.
+ echo "-- Using rust v${RUST_VERSION}"
+ 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
+ ./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
@@ -98,21 +115,6 @@ fi
if [[ $1 == "--juggler" ]]; then
./mach build faster
-else
- # TODO: rustup is not in the PATH on Windows
- if command -v rustup >/dev/null; then
- # We manage Rust version ourselves.
- echo "-- Using rust v${RUST_VERSION}"
- 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
- ./mach build
fi
if [[ "$(uname)" == "Darwin" ]]; then