brizental pushed to branch main at The Tor Project / Applications / tor-browser-build Commits: b03bf29d by Beatriz Rizental at 2025-12-02T19:46:00+01:00 Bug 41623: Fix artifact generation for Firefox on nightly builds - - - - - 0eab7857 by Beatriz Rizental at 2025-12-02T19:46:00+01:00 Bug 41623: Make MSVC-style architecture constants consistent in mingwclang builds This change is necessary to build with --enable-tests, because there is a build time test that fails without it. The test was introduced in https://bugzilla.mozilla.org/show_bug.cgi?id=1866562 (as well as the include". I have left the include to also be in builds without --enable-tests, because this will make our build env more consistent with Mozilla's. - - - - - 615e9a14 by Beatriz Rizental at 2025-12-02T19:46:00+01:00 Bug 41649: Add missing dependency to geckoview container Necessary for building dev artifacts - - - - - 8 changed files: - projects/browser/build - projects/browser/build.android - projects/firefox/build - projects/firefox/config - projects/firefox/mozconfig - projects/geckoview/build - projects/geckoview/config - rbm.local.conf.example Changes: ===================================== projects/browser/build ===================================== @@ -406,13 +406,9 @@ cd $distdir [% END %] [% IF c("var/dev_artifacts") -%] + mkdir -p "$OUTDIR"/artifacts [% IF c("var/macos_universal") -%] - mkdir -p "$OUTDIR"/artifacts/aarch64 - cp -a $rootdir/[% c('input_files_by_name/firefox-aarch64') %]/artifacts/. "$OUTDIR/artifacts/aarch64" - mkdir -p "$OUTDIR"/artifacts/x86_64 - cp -a $rootdir/[% c('input_files_by_name/firefox') %]/artifacts/. "$OUTDIR/artifacts/x86_64" - [% ELSE -%] - mkdir -p "$OUTDIR"/artifacts - cp -a $rootdir/[% c('input_files_by_name/firefox') %]/artifacts "$OUTDIR" + cp -a $rootdir/[% c('input_files_by_name/firefox-aarch64') %]/artifacts "$OUTDIR" [% END -%] + cp -a $rootdir/[% c('input_files_by_name/firefox') %]/artifacts "$OUTDIR" [% END %] ===================================== projects/browser/build.android ===================================== @@ -121,6 +121,7 @@ apksigner sign --verbose --min-sdk-version [% c("var/android_min_api") %] --ks $ [% END -%] [% IF c("var/dev_artifacts") -%] - mkdir -p "[% dest_dir %]/[% c('filename') %]/artifacts/" - mv $rootdir/[% c('input_files_by_name/fenix') %]/artifacts[% IF !c('var/android_single_arch') %]/[% c("var/abi") %][% END %] [% dest_dir %]/[% c('filename') %]/artifacts + mkdir -p "[% dest_dir %]/[% c('filename') %]/artifacts/android-[% c('var/abi') %]" + mv $rootdir/[% c('input_files_by_name/fenix') %]/geckoview/artifacts/[% c('var/abi') %]/* \ + "[% dest_dir %]/[% c('filename') %]/artifacts/android-[% c('var/abi') %]" [% END %] ===================================== projects/firefox/build ===================================== @@ -128,29 +128,27 @@ echo "Starting ./mach build $(date)" export MOZ_PKG_MAC_DSSTORE=$rootdir/dmg-root/[% c('var/ProjectName') %].dmg/nightly.DS_Store export MOZ_PKG_MAC_ICON=$rootdir/dmg-root/[% c('var/ProjectName') %].dmg/.VolumeIcon.icns [% END -%] - ./mach package - - artifactsdir=[% out_dir %]/artifacts - mkdir $artifactsdir - - # Copy the artifacts to the target directory - # Naming convention is the same as Mozilla uses for their artifacts - mv obj-*/dist/*.xpt_artifacts.zip $artifactsdir/target.xpt_artifacts.zip - - [% IF c("var/macos") -%] - mv obj-*/dist/*.dmg $artifactsdir/target.dmg - mv obj-*/dist/*.update_framework_artifacts.zip $artifactsdir/target.update_framework_artifacts.zip - [% END -%] [% IF c("var/linux") -%] - mv obj-*/dist/*.tar.xz $artifactsdir/target.tar.xz - [% END -%] - - [% IF c("var/windows") -%] - mv obj-*/dist/*.zip $artifactsdir/target.zip + # Compression differs with 1 or 2+ threads, + # so we'll want to have at least 2 threads, but otherwise respect num_procs. + # + # Without this, compression takes 20min+ + export XZ_DEFAULTS="-T[% c("num_procs") > 1 ? c("num_procs") : '2' %]" [% END -%] - ./mach python -m mozbuild.action.test_archive common $artifactsdir/target.common.tests.tar.gz + # Package the browser and also create all the test artifacts. + # + # MOZ_SIMPLE_PACKAGE_NAME will force all artifact files to start with "target", + # instead of the name of the package, which would be something like: firefox-140.4.0.en-US.linux-x86_64. + # This is the same convention used by upstream. + # + # Also it just makes it easier to copy all artifacts over in the next step. + MOZ_SIMPLE_PACKAGE_NAME="target" ./mach build package package-tests + + artifactsdir=[% out_dir %]/artifacts/[% c("var/osname") %] + mkdir -p $artifactsdir + mv obj-*/dist/target.* $artifactsdir [% END %] [% IF c("var/macos") -%] ===================================== projects/firefox/config ===================================== @@ -223,10 +223,10 @@ input_files: - filename: marsigner.der enable: '[% c("var/override_updater_url") %]' - filename: dmg-root - enable: '[% c("var/macos") && c("var/nightly") %]' + enable: '[% c("var/macos") && c("var/dev_artifacts") %]' - project: hfsplus-tools name: hfsplus-tools - enable: '[% c("var/macos") && c("var/nightly") %]' + enable: '[% c("var/macos") && c("var/dev_artifacts") %]' - project: libdmg-hfsplus name: libdmg - enable: '[% c("var/macos") && c("var/nightly") %]' + enable: '[% c("var/macos") && c("var/dev_artifacts") %]' ===================================== projects/firefox/mozconfig ===================================== @@ -26,7 +26,8 @@ HOST_CXX="clang++" CC="[% c('arch') %]-w64-mingw32-clang" CXX="[% c('arch') %]-w64-mingw32-clang++" - CXXFLAGS="-fms-extensions" + CFLAGS="-include _mingw.h" + CXXFLAGS="-fms-extensions -include _mingw.h" AR=llvm-ar RANLIB=llvm-ranlib @@ -56,7 +57,7 @@ export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/[% c('var/build_target') %]- export DSYMUTIL="$TOOLCHAIN_DIR/clang/bin/dsymutil" - [% IF c("var/nightly") -%] + [% IF c("var/dev_artifacts") -%] export MKFSHFS=/var/tmp/dist/hfsplus-tools/newfs_hfs export DMG_TOOL=/var/tmp/dist/libdmg-hfsplus/dmg export HFS_TOOL=/var/tmp/dist/libdmg-hfsplus/hfsplus @@ -87,6 +88,14 @@ ac_add_options --[% IF c("var/updater_enabled") %]enable[% ELSE %]disable[% END ac_add_options --with-updater-url=[% c("var/updater_url") %] [% END -%] +[% IF c("var/dev_artifacts") -%] + ac_add_options --enable-tests +[% END -%] + +# Necessary for package-tests step which expects dist/bin/jsapi-tests to exist. +# This is added regardless of --enable-tests, because it's also a useful debugging tool. +ac_add_options --enable-js-shell + mk_add_options MOZ_PARALLEL_BUILD=[% c("num_procs") %] export MOZ_APP_REMOTINGNAME="[% c('var/display_name') %]" ===================================== projects/geckoview/build ===================================== @@ -23,6 +23,13 @@ export MOZ_SOURCE_REPO="[% c('var/gitlab_project') %]" export MOZ_SOURCE_CHANGESET=[% c("var/git_commit") %] ac_add_options --enable-update-channel=[% c("var/variant") %] + +[% IF c("var/dev_artifacts") -%] + ac_add_options --enable-tests + # Necessary for package-tests step which expects dist/bin/jsapi-tests to exist. + ac_add_options --enable-js-shell +[% END -%] + MOZCONFIG_EOF echo "ac_add_options --with-branding=$branding_dir" >> .mozconfig @@ -36,15 +43,22 @@ echo "Starting ./mach build $(date)" [% IF c("var/dev_artifacts") -%] echo "Building development artifacts" - ./mach package - artifactsdir=$outdir/artifacts + # Package the browser and also create all the test artifacts. + # + # MOZ_SIMPLE_PACKAGE_NAME will force all artifact files to start with "target", + # instead of the name of the package, which would be something like: firefox-140.4.0.en-US.linux-x86_64. + # This is the same convention used by upstream + MOZ_SIMPLE_PACKAGE_NAME="target" ./mach build package package-tests + + artifactsdir=$outdir/[% IF !c("var/android_single_arch") -%]artifacts[% ELSE -%]geckoview/artifacts/[% c("var/abi") %][% END -%] + mkdir -p $artifactsdir + # Copy the artifacts to the target directory # Naming convention is the same as Mozilla uses for their artifacts - cp -a obj-*/dist/*.zip $artifactsdir/target.xpt_artifacts.zip - cp -a obj-*/gradle/build/mobile/android/geckoview_example/outputs/apk/*/geckoview_example-*.apk $artifactsdir/geckoview_example.apk - ./mach python -m mozbuild.action.test_archive common $artifactsdir/target.common.tests.tar.gz + mv obj-*/gradle/build/mobile/android/geckoview_example/outputs/apk/*/geckoview_example-*.apk $artifactsdir/geckoview_example.apk + mv obj-*/dist/target.* $artifactsdir [% END %] echo "Build finished, copying the AAR to the to the destination directory $(date)" ===================================== projects/geckoview/config ===================================== @@ -33,6 +33,7 @@ var: - python3 - python3-distutils - python3-venv + - python3-zstandard - pkg-config - openjdk-17-jdk-headless # this should be updated when the list of gradle dependencies is changed ===================================== rbm.local.conf.example ===================================== @@ -65,7 +65,12 @@ var: ### upload the files to #tpo_user: username - ### This option enables generation of development artifacts + ### This option enables generation of browser artifacts + ### + ### Artifacts is a saturated term in this project, but in this case it + ### refers to Firefox artifacts e.g. for artifact builds. + ### + ### See: https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.h... #dev_artifacts: '[% c("var/nightly") %]' ### The clean configuration is used by the cleaning script to find the View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/3... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/3... You're receiving this email because of your account on gitlab.torproject.org.
participants (1)
-
brizental (@brizental)