boklm pushed to branch main at The Tor Project / Applications / tor-browser-build Commits: 79c82022 by Nicolas Vigier at 2026-02-10T09:48:13+01:00 Bug 41660: Add sections to doc/MAKEFILE.txt - - - - - af4a83f0 by Nicolas Vigier at 2026-02-10T11:00:20+01:00 Bug 41660: Add makefile targets to build upstream firefox commit Based on patch started by @pierov in https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/issues/41.... - - - - - ebef30b2 by Nicolas Vigier at 2026-02-10T11:00:22+01:00 Bug 41719: Enable network in geckoview build scripts when var/generate_gradle_dependencies_list is enabled - - - - - 14 changed files: - Makefile - doc/MAKEFILE.txt - projects/common/browser-localization - projects/firefox/build - projects/firefox/config - + projects/firefox/firefoxbrowser-BB-29320.patch - + projects/firefox/mozconfig-upstream-firefox.in - projects/firefox/mozconfig.in - projects/geckoview/build - projects/geckoview/build_common - projects/geckoview/config - + projects/geckoview/mozconfig-upstream-firefox.in - projects/geckoview/mozconfig.in - rbm.conf Changes: ===================================== Makefile ===================================== @@ -543,6 +543,31 @@ mullvadbrowser-compare-mar-signed-unsigned-release: submodule-update mullvadbrowser-compare-mar-signed-unsigned-alpha: submodule-update $(rbm) build release --step compare_mar_signed_unsigned --target alpha --target signed --target mullvadbrowser +############################# +# Building upstream firefox # +############################# + +firefox-linux-x86_64: submodule-update + $(rbm) build firefox --target alpha --target firefoxbrowser-linux-x86_64 + +firefox-linux-aarch64: submodule-update + $(rbm) build firefox --target alpha --target firefoxbrowser-linux-arch64 + +firefox-windows-x86_64: submodule-update + $(rbm) build firefox --target alpha --target firefoxbrowser-windows-x86_64 + +firefox-windows-i686: submodule-update + $(rbm) build firefox --target alpha --target firefoxbrowser-windows-i686 + +firefox-macos-aarch64: submodule-update + $(rbm) build firefox --target alpha --target firefoxbrowser-macos-aarch64 + +firefox-macos-x86_64: submodule-update + $(rbm) build firefox --target alpha --target firefoxbrowser-macos-x86_64 + +geckoview-android-aarch64: submodule-update + $(rbm) build geckoview --target testbuild --target alpha --target firefoxbrowser-android-aarch64 + ############################ # Toolchain Update Targets # ===================================== doc/MAKEFILE.txt ===================================== @@ -1,6 +1,11 @@ Description of makefile rules ============================= + +************************************ +* Building Tor and Mullvad Browser * +************************************ + torbrowser ---------- Build Tor Browser for the default channel, defined in @@ -92,11 +97,27 @@ fetch Fetch new commits from all components. This is useful when you want to build the nightly channel. -list-unused-projects --------------------- -List which projects are not being used by projects/release/build with -torbrowser and mullvadbrowser targets. Projects that are used outside -of normal builds can be added to projects/release/list_used_projects. +torbrowser-incrementals-{release,alpha} +--------------------------------------- +Create incremental mar files for an unsigned build in the release or +alpha channel. The list of versions we create incrementals from is +defined as var/torbrowser_incremental_from in rbm.conf. + +torbrowser-incrementals-nightly +------------------------------- +Create incremental mar files for the current nightly build. The number +of previous versions we should generate incremental mars from is defined +as var/max_torbrowser_incremental_from in rbm.conf. + +If you want to create incremental mars for a version that is not the +current one, you can define the environment variable +TORBROWSER_NIGHTLY_VERSION to the version you want to generate +incremental mars for. + + +************ +* Cleaning * +************ clean ----- @@ -115,28 +136,22 @@ clean-dry-run ------------- Print the files that would be removed when running 'make clean'. +list-unused-projects +-------------------- +List which projects are not being used by projects/release/build with +torbrowser and mullvadbrowser targets. Projects that are used outside +of normal builds can be added to projects/release/list_used_projects. + + +*********************************** +* Publishing and signing releases * +*********************************** + torbrowser-signtag-{release,alpha} ---------------------------------- Create a git signed tag for the selected channel, using the version and build number defined as var/torbrowser_version and var/torbrowser_build. -torbrowser-incrementals-{release,alpha} ---------------------------------------- -Create incremental mar files for an unsigned build in the release or -alpha channel. The list of versions we create incrementals from is -defined as var/torbrowser_incremental_from in rbm.conf. - -torbrowser-incrementals-nightly -------------------------------- -Create incremental mar files for the current nightly build. The number -of previous versions we should generate incremental mars from is defined -as var/max_torbrowser_incremental_from in rbm.conf. - -If you want to create incremental mars for a version that is not the -current one, you can define the environment variable -TORBROWSER_NIGHTLY_VERSION to the version you want to generate -incremental mars for. - torbrowser-dmg2mar-{release,alpha) ---------------------------------- Generate updated mar files for the OSX bundles, from the dmg files, then @@ -149,6 +164,11 @@ Create update responses xml files for a signed build in the release or alpha channel. The files can be found in a tar in the directory torbrowser/{release,alpha}/update-responses. + +**************************************** +* Comparing signed and unsigned builds * +**************************************** + torbrowser-compare-windows-signed-unsigned-{release,alpha} ---------------------------------------------------------- Unsign exe files from directory torbrowser/{release,alpha}/signed/$version @@ -159,3 +179,25 @@ torbrowser-compare-mar-signed-unsigned-{release,alpha} Unsign mar files from directory torbrowser/{release,alpha}/signed/$version and compare them with the checksum from sha256sums-unsigned-build.txt. + +********************* +* Toolchain updates * +********************* + +list_toolchain_updates-{application-services,firefox-linux,firefox-macos, + firefox-windows,geckoview} +------------------------------------------------------------------------- +List toolchain updates required for building selected component/platform. + + +firefox-{linux-x86_64,linux-aarch64,windows-x86_64,windows-i686, + macos-aarch64,macos-x86_64} +---------------------------------------------------------------- +Building upstream firefox commit for selected platform. This is useful +for testing toolchain updates for a new firefox version. + +geckoview-android-aarch64 +------------------------- +Building upstream firefox commit for android (aarch64 only). We currently +don't support the `build_apk` builds with all architectures, but the +single arch build should be enough for testing toolchain updates. ===================================== projects/common/browser-localization ===================================== @@ -1,4 +1,6 @@ -branding_dir=[% IF c('var/android') %]mobile/android[% ELSE %]browser[% END %]/branding/[% c("var/project_initials") %]-[% c("var/channel") %] +[% IF !c("var/firefox-browser") -%] + branding_dir=[% IF c('var/android') %]mobile/android[% ELSE %]browser[% END %]/branding/[% c("var/project_initials") %]-[% c("var/channel") %] +[% END -%] [% IF c("var/has_l10n") -%] [% IF !c("var/android") -%] ===================================== projects/firefox/build ===================================== @@ -106,16 +106,23 @@ mkdir "$HOME/.mozbuild" export LC_ALL=C.UTF-8 export LANG=C.UTF-8 +[% IF c("var/firefox-browser") && c("var/windows") -%] + patch -p1 < $rootdir/firefoxbrowser-BB-29320.patch +[% END -%] + echo "Starting ./mach configure $(date)" ./mach configure \ --with-distribution-id=org.torproject \ - --with-base-browser-version=[% c("var/torbrowser_version") %] \ + [% IF !c("var/firefox-browser") %]--with-base-browser-version=[% c("var/torbrowser_version") %][% END %] \ [% IF c("var/updater_enabled") -%]--enable-update-channel=[% c("var/channel") %][% END %] \ - [% IF !c("var/base-browser") -%]--with-branding="$branding_dir"[% END %] \ + [% IF !c("var/base-browser") && !c("var/firefox-browser") -%]--with-branding="$branding_dir"[% END %] \ [% IF !c("var/rlbox") -%]--without-wasm-sandboxed-libraries[% END %] echo "Starting ./mach build $(date)" ./mach build --verbose + +[% IF c("var/firefox-browser") && c("var/windows"); RETURN; END; -%] + [% IF c("var/has_l10n") -%] echo "Starting to merge locales $(date)" export MOZ_CHROME_MULTILOCALE="$supported_locales" @@ -160,6 +167,9 @@ echo "Starting ./mach build $(date)" [% IF c("var/base-browser") -%] mv "$distdir/Firefox.app" "$distdir/[% c('var/display_name') %].app" [% END -%] + [% IF c("var/firefox-browser") -%] + mv "$distdir/Nightly.app" "$distdir/[% c('var/display_name') %].app" + [% END -%] app_bundle="[% c('var/display_name') %].app" # Remove firefox-bin (we don't use it, see ticket #10126) rm -f "$distdir/$app_bundle/Contents/MacOS/[% c('var/exe_name') %]-bin" ===================================== projects/firefox/config ===================================== @@ -23,6 +23,7 @@ var: browser_rebase: 2 browser_branch: '[% c("var/browser_series") %]-[% c("var/browser_rebase") %]' browser_build: 2 + upstream_firefox_commit: FIREFOX_NIGHTLY_147_END copyright_year: '[% exec("git show -s --format=%ci " _ c("git_hash") _ "^{commit}", { exec_noco => 1 }).remove("-.*") %]' nightly_updates_publish_dir: '[% c("var/nightly_updates_publish_dir_prefix") %]nightly-[% c("var/osname") %]' gitlab_project: https://gitlab.torproject.org/tpo/applications/tor-browser @@ -90,13 +91,20 @@ steps: version: '[% c("abbrev") %]' list_toolchain_updates: - git_hash: FIREFOX_NIGHTLY_147_END + git_hash: '[% c("var/upstream_firefox_commit") %]' tag_gpg_id: 0 input_files: [] container: use_container: 0 targets: + firefoxbrowser: + git_hash: '[% c("var/upstream_firefox_commit") %]' + tag_gpg_id: 0 + var: + updater_url: '' + has_l10n: 0 + basebrowser: var: nightly_updates_publish_dir_prefix: basebrowser- @@ -240,3 +248,7 @@ input_files: - project: libdmg-hfsplus name: libdmg enable: '[% c("var/macos") && c("var/dev_artifacts") %]' + # When building upstream firefox we need this patch to be able to + # build for Windows + - filename: firefoxbrowser-BB-29320.patch + enable: '[% c("var/firefox-browser") && c("var/windows") %]' ===================================== projects/firefox/firefoxbrowser-BB-29320.patch ===================================== @@ -0,0 +1,45 @@ +commit df53f566fa75408c95f3f619e1eee30417449642 +Author: Pier Angelo Vendrame <pierov@torproject.org> +Date: Thu Jun 13 09:22:53 2024 +0200 + + BB 29320: Replace the gnu target with gnullvm for Rust. + +diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure +index d71d2fbe33b77..62ceec58677a2 100644 +--- a/build/moz.configure/init.configure ++++ b/build/moz.configure/init.configure +@@ -490,12 +490,16 @@ def split_triplet(triplet, allow_wasi=False): + canonical_kernel = "kFreeBSD" + elif os.startswith("gnu"): + canonical_os = canonical_kernel = "GNU" +- elif os.startswith("mingw") or os in ("windows-msvc", "windows-gnu"): ++ elif os.startswith("mingw") or os in ( ++ "windows-msvc", ++ "windows-gnu", ++ "windows-gnullvm", ++ ): + canonical_os = canonical_kernel = "WINNT" + if not os.startswith("mingw"): + if os == "windows-msvc": + abi = "msvc" +- elif os == "windows-gnu": ++ elif os == "windows-gnu" or os == "windows-gnullvm": + abi = "mingw" + # Many things down the line are looking for the string "mingw32" + # until they are all fixed, we pretend that's the raw os we had +diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure +index 6c1c891817133..ee836b6060756 100644 +--- a/build/moz.configure/rust.configure ++++ b/build/moz.configure/rust.configure +@@ -310,9 +310,9 @@ def detect_rustc_target( + if host_or_target.abi == "msvc": + suffix = "windows-msvc" + elif host_or_target.abi == "mingw": +- suffix = "windows-gnu" ++ suffix = "windows-gnullvm" + elif compiler_info.type in ("gcc", "clang"): +- suffix = "windows-gnu" ++ suffix = "windows-gnullvm" + else: + suffix = "windows-msvc" + narrowed = [ ===================================== projects/firefox/mozconfig-upstream-firefox.in ===================================== @@ -0,0 +1,17 @@ +# The file mozconfig-upstream-firefox.in is used to set some options +# needed to build upstream firefox. In Tor/Mullvad Browser, those +# options are set in the specific mozconfig files in tor-browser.git. + +[% IF c("var/windows-x86_64") -%] + ac_add_options --target=x86_64-w64-mingw32 + ac_add_options --with-toolchain-prefix=x86_64-w64-mingw32- +[% END -%] +[% IF c("var/windows-i686") -%] + ac_add_options --target=i686-w64-mingw32 + ac_add_options --with-toolchain-prefix=i686-w64-mingw32- +[% END -%] +[% IF c("var/windows") -%] + ac_add_options --disable-notification-server + + ac_add_options --disable-webrtc +[% END -%] ===================================== projects/firefox/mozconfig.in ===================================== @@ -1,4 +1,8 @@ -. $topsrcdir/mozconfig-[% IF c("var/macos"); GET 'macos'; ELSE; GET c("var/osname"); END; %][% IF c("var/asan") %]-asan[% END %] +[% IF !c("var/firefox-browser") -%] + . $topsrcdir/mozconfig-[% IF c("var/macos"); GET 'macos'; ELSE; GET c("var/osname"); END; %][% IF c("var/asan") %]-asan[% END %] +[% ELSE; + INCLUDE 'mozconfig-upstream-firefox.in'; + END -%] [% IF c("var/linux") -%] # We want to build with clang now and point to the GCC toolchain until #29041 is @@ -81,7 +85,9 @@ [% END -%] ac_add_options --[% IF c("var/updater_enabled") %]enable[% ELSE %]disable[% END %]-updater -ac_add_options --[% IF c("var/updater_enabled") %]enable[% ELSE %]disable[% END %]-base-browser-update +[% IF !c("var/firefox-browser") -%] + ac_add_options --[% IF c("var/updater_enabled") %]enable[% ELSE %]disable[% END %]-base-browser-update +[% END -%] [% IF c("var/override_updater_url") -%] ac_add_options --with-updater-url=[% c("var/override_updater_url") %] [% ELSIF c("var/updater_url") -%] ===================================== projects/geckoview/build ===================================== @@ -18,8 +18,8 @@ cp $rootdir/mozconfig ./ echo "Starting ./mach configure $(date)" ./mach configure \ - --with-base-browser-version=[% c("var/torbrowser_version") %] \ - --with-branding=$branding_dir \ + [% IF !c("var/firefox-browser") %]--with-base-browser-version=[% c("var/torbrowser_version") %][% END %] \ + [% IF !c("var/firefox-browser") %]--with-branding=$branding_dir[% END %] \ [% IF !c("var/rlbox") -%]--without-wasm-sandboxed-libraries[% END %] echo "Starting ./mach build $(date)" ===================================== projects/geckoview/build_common ===================================== @@ -15,19 +15,28 @@ export PATH="/var/tmp/dist/node/bin:$PATH" export LC_ALL=C.UTF-8 export LANG=C.UTF-8 -# Normalize this path, as it will end up in buildconfig.html. -export TOR_EXPERT_BUNDLE_AAR=/var/tmp/dist/tor-expert-bundle.aar -mv $rootdir/[% c('input_files_by_name/tor-expert-bundle-aar') %]/tor-expert-bundle.aar $TOR_EXPERT_BUNDLE_AAR +[% IF c("var/tor-browser") -%] + # Normalize this path, as it will end up in buildconfig.html. + export TOR_EXPERT_BUNDLE_AAR=/var/tmp/dist/tor-expert-bundle.aar + mv $rootdir/[% c('input_files_by_name/tor-expert-bundle-aar') %]/tor-expert-bundle.aar $TOR_EXPERT_BUNDLE_AAR +[% END -%] -tar -C /var/tmp/dist -xf [% c('input_files_by_name/application-services') %] -export APPLICATION_SERVICES=/var/tmp/dist/application-services/maven -export NIMBUS_FML=/var/tmp/dist/application-services/nimbus-fml +[% IF !c("var/firefox-browser") -%] + tar -C /var/tmp/dist -xf [% c('input_files_by_name/application-services') %] + export APPLICATION_SERVICES=/var/tmp/dist/application-services/maven + export NIMBUS_FML=/var/tmp/dist/application-services/nimbus-fml +[% END -%] [% INCLUDE 'fake-git' %] tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.[% c('compress_tar') %] -tar -C /var/tmp/build/[% project %]-*/tools/terser -xf [% c("input_files_by_name/terser") %] +# We disable terser for unpatched firefox since the directory +# tools/terser does not exist in 147. It will probably be needed for +# 148. +[% IF !c("var/firefox-browser") -%] + tar -C /var/tmp/build/[% project %]-*/tools/terser -xf [% c("input_files_by_name/terser") %] +[% END -%] [% c("var/set_MOZ_BUILD_DATE") %] ===================================== projects/geckoview/config ===================================== @@ -16,7 +16,8 @@ gpg_keyring: container: use_container: 1 disable_network: - build_apk: 1 + build: '[% !c("var/generate_gradle_dependencies_list") %]' + build_apk: '[% !c("var/generate_gradle_dependencies_list") %]' var: firefox_platform_version: '147.0a1' @@ -58,6 +59,12 @@ targets: tag_gpg_id: 0 var: variant: nightly + firefoxbrowser: + git_hash: '[% pc("firefox", "var/upstream_firefox_commit") %]' + tag_gpg_id: 0 + var: + generate_gradle_dependencies_list: 1 + has_l10n: 0 steps: build_apk: @@ -146,7 +153,7 @@ steps: enable: '[% c("var/generate_gradle_dependencies_list") %]' list_toolchain_updates: - git_hash: FIREFOX_NIGHTLY_147_END + git_hash: '[% pc("firefox", "var/upstream_firefox_commit") %]' tag_gpg_id: 0 input_files: [] container: @@ -178,6 +185,7 @@ input_files: enable: '[% c("var/rlbox") %]' - project: application-services name: application-services + enable: '[% !c("var/firefox-browser") %]' - filename: gradle-dependencies-list.txt name: gradle-dependencies-list - filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]' @@ -189,13 +197,16 @@ input_files: sha256sum: '[% pc("glean-parser", "var/glean_wheels_sha256sum") %]' - project: glean name: glean + enable: '[% !c("var/generate_gradle_dependencies_list") %]' - project: oss-licenses-plugin name: oss-licenses-plugin enable: '[% !c("var/generate_gradle_dependencies_list") %]' - project: terser name: terser + enable: '[% !c("var/firefox-browser") %]' - name: tor-expert-bundle-aar project: tor-expert-bundle-aar + enable: '[% c("var/tor-browser") %]' - project: firefox-l10n name: firefox-l10n enable: '[% c("var/android_single_arch") && c("var/has_l10n") %]' ===================================== projects/geckoview/mozconfig-upstream-firefox.in ===================================== @@ -0,0 +1,17 @@ +# The file mozconfig-upstream-firefox.in is used to set some options +# needed to build upstream firefox. In Tor Browser, those options are +# set in the specific mozconfig files in tor-browser.git. + +ac_add_options --enable-application=mobile/android + +# Make sure to disable bootstrap also when running online builds for dependency +# updates. +ac_add_options --disable-bootstrap + +CC="clang" +CXX="clang++" +ac_add_options --enable-linker=lld + +ac_add_options --with-android-sdk=$ANDROID_HOME +ac_add_options --with-android-ndk=$ANDROID_NDK_HOME +ac_add_options --with-gradle=$GRADLE_HOME/bin/gradle ===================================== projects/geckoview/mozconfig.in ===================================== @@ -1,4 +1,8 @@ +[% IF !c("var/firefox-browser") -%] . $topsrcdir/[% c("var/mozconfig_file") %] +[% ELSE; + INCLUDE 'mozconfig-upstream-firefox.in'; + END -%] ac_add_options --with-java-bin-path=/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin ===================================== rbm.conf ===================================== @@ -372,6 +372,18 @@ targets: ProjectName: BaseBrowser updater_enabled: '[% c("var/nightly") %]' + # Target to build upstream firefox commit (in projects/firefox and + # projects/geckoview) instead of our patched branch + firefoxbrowser: + var: + firefox-browser: 1 + project-name: firefox-browser + projectname: firefoxbrowser + Project_Name: 'Firefox Browser' + ProjectName: FirefoxBrowser + updater_enabled: 0 + android_single_arch: 1 + mullvadbrowser: var: mullvad-browser: 1 @@ -434,6 +446,10 @@ targets: - android-armv7 - android - basebrowser + firefoxbrowser-android-armv7: + - android-armv7 + - android + - firefoxbrowser android-armv7: arch: armv7 var: @@ -450,6 +466,10 @@ targets: - android-x86_64 - android - basebrowser + firefoxbrowser-android-x86_64: + - android-x86_64 + - android + - firefoxbrowser android-x86_64: arch: x86_64 var: @@ -466,6 +486,10 @@ targets: - android-aarch64 - android - basebrowser + firefoxbrowser-android-aarch64: + - android-aarch64 + - android + - firefoxbrowser android-aarch64: arch: aarch64 var: @@ -512,6 +536,10 @@ targets: - linux-x86_64 - linux - mullvadbrowser + firefoxbrowser-linux-x86_64: + - linux-x86_64 + - linux + - firefoxbrowser torbrowser-linux-x86_64-asan: - linux-asan - linux-x86_64 @@ -542,6 +570,10 @@ targets: - linux-aarch64 - linux - mullvadbrowser + firefoxbrowser-linux-aarch64: + - linux-aarch64 + - linux + - firefoxbrowser linux-x86_64: arch: x86_64 var: @@ -603,6 +635,10 @@ targets: - windows-i686 - windows - basebrowser + firefoxbrowser-windows-i686: + - windows-i686 + - windows + - firefoxbrowser torbrowser-windows-x86_64: - windows-x86_64 - windows @@ -615,6 +651,10 @@ targets: - windows-x86_64 - windows - mullvadbrowser + firefoxbrowser-windows-x86_64: + - windows-x86_64 + - windows + - firefoxbrowser windows-x86_64: arch: x86_64 var: @@ -690,6 +730,14 @@ targets: - macos-aarch64 - macos - mullvadbrowser + firefoxbrowser-macos-x86_64: + - macos-x86_64 + - macos + - firefoxbrowser + firefoxbrowser-macos-aarch64: + - macos-aarch64 + - macos + - firefoxbrowser macos-universal: var: macos_universal: 1 View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/e... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/e... You're receiving this email because of your account on gitlab.torproject.org.
participants (1)
-
boklm (@boklm)