From 8f4bec7ec6c738aea5ec073d7f7e9b21caefe66f Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Wed, 19 Jan 2022 13:23:15 +0000 Subject: [PATCH] firefox: fix build (#7152) * firefox: fix build * tmp fix * fix * nit --- projects/firefox/Dockerfile | 7 ++++++- projects/firefox/build.sh | 17 +++++++++-------- projects/firefox/mozconfig.coverage | 1 - 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/projects/firefox/Dockerfile b/projects/firefox/Dockerfile index 515e9df26..e5343c9ee 100644 --- a/projects/firefox/Dockerfile +++ b/projects/firefox/Dockerfile @@ -24,11 +24,16 @@ RUN apt-get update && \ gawk \ libstdc++6 \ m4 \ - python + python python3-pip python3-setuptools python3-wheel cmake git nasm +RUN pip3 install meson ninja # This wrapper of cargo seems to interfere with our build system. RUN rm -f /usr/local/bin/cargo +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $SRC/rustbuild.sh && \ + chmod +x $SRC/rustbuild.sh && \ + $SRC/rustbuild.sh -y + RUN git clone --depth 1 https://github.com/mozilla/gecko-dev mozilla-central RUN git clone --depth 1 https://github.com/mozillasecurity/fuzzdata WORKDIR mozilla-central diff --git a/projects/firefox/build.sh b/projects/firefox/build.sh index 8788e190e..71f7f6b12 100755 --- a/projects/firefox/build.sh +++ b/projects/firefox/build.sh @@ -15,6 +15,14 @@ # ################################################################################ +if [ "$SANITIZER" = "coverage" ] +then + touch $OUT/exit + exit 0 +fi + +source $HOME/.cargo/env + # Case-sensitive names of internal Firefox fuzzing targets. Edit to add more. FUZZ_TARGETS=( # WebRTC @@ -48,14 +56,7 @@ export ASAN_OPTIONS="detect_leaks=0" # Install remaining dependencies. export SHELL=/bin/bash -# Firefox might not be buildable on the latest Rust Nightly, so we should try -# to use the same version that we use in our CI. -RUST_NIGHTLY_VERSION=$(sed -n 's/^.*--channel.*\(nightly-[0-9-]*\).*$/\1/p' \ - $SRC/mozilla-central/taskcluster/ci/toolchain/rust.yml -) - -rustup toolchain install ${RUST_NIGHTLY_VERSION} -rustup default ${RUST_NIGHTLY_VERSION}-x86_64-unknown-linux-gnu +rustup default nightly ./mach --no-interactive bootstrap --application-choice browser diff --git a/projects/firefox/mozconfig.coverage b/projects/firefox/mozconfig.coverage index a99a37728..3e6101e0f 100644 --- a/projects/firefox/mozconfig.coverage +++ b/projects/firefox/mozconfig.coverage @@ -3,7 +3,6 @@ ac_add_options --disable-debug ac_add_options --disable-elf-hack ac_add_options --disable-jemalloc ac_add_options --disable-crashreporter -ac_add_options --disable-av1 ac_add_options --enable-fuzzing ac_add_options --enable-optimize=-O1 ac_add_options --enable-debug-symbols=-gline-tables-only