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
-
0eab7857
by Beatriz Rizental at 2025-12-02T19:46:00+01:00
-
615e9a14
by Beatriz Rizental at 2025-12-02T19:46:00+01:00
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:
| ... | ... | @@ -406,13 +406,9 @@ cd $distdir |
| 406 | 406 | [% END %]
|
| 407 | 407 | |
| 408 | 408 | [% IF c("var/dev_artifacts") -%]
|
| 409 | + mkdir -p "$OUTDIR"/artifacts
|
|
| 409 | 410 | [% IF c("var/macos_universal") -%]
|
| 410 | - mkdir -p "$OUTDIR"/artifacts/aarch64
|
|
| 411 | - cp -a $rootdir/[% c('input_files_by_name/firefox-aarch64') %]/artifacts/. "$OUTDIR/artifacts/aarch64"
|
|
| 412 | - mkdir -p "$OUTDIR"/artifacts/x86_64
|
|
| 413 | - cp -a $rootdir/[% c('input_files_by_name/firefox') %]/artifacts/. "$OUTDIR/artifacts/x86_64"
|
|
| 414 | - [% ELSE -%]
|
|
| 415 | - mkdir -p "$OUTDIR"/artifacts
|
|
| 416 | - cp -a $rootdir/[% c('input_files_by_name/firefox') %]/artifacts "$OUTDIR"
|
|
| 411 | + cp -a $rootdir/[% c('input_files_by_name/firefox-aarch64') %]/artifacts "$OUTDIR"
|
|
| 417 | 412 | [% END -%]
|
| 413 | + cp -a $rootdir/[% c('input_files_by_name/firefox') %]/artifacts "$OUTDIR"
|
|
| 418 | 414 | [% END %] |
| ... | ... | @@ -121,6 +121,7 @@ apksigner sign --verbose --min-sdk-version [% c("var/android_min_api") %] --ks $ |
| 121 | 121 | [% END -%]
|
| 122 | 122 | |
| 123 | 123 | [% IF c("var/dev_artifacts") -%]
|
| 124 | - mkdir -p "[% dest_dir %]/[% c('filename') %]/artifacts/"
|
|
| 125 | - mv $rootdir/[% c('input_files_by_name/fenix') %]/artifacts[% IF !c('var/android_single_arch') %]/[% c("var/abi") %][% END %] [% dest_dir %]/[% c('filename') %]/artifacts
|
|
| 124 | + mkdir -p "[% dest_dir %]/[% c('filename') %]/artifacts/android-[% c('var/abi') %]"
|
|
| 125 | + mv $rootdir/[% c('input_files_by_name/fenix') %]/geckoview/artifacts/[% c('var/abi') %]/* \
|
|
| 126 | + "[% dest_dir %]/[% c('filename') %]/artifacts/android-[% c('var/abi') %]"
|
|
| 126 | 127 | [% END %] |
| ... | ... | @@ -128,29 +128,27 @@ echo "Starting ./mach build $(date)" |
| 128 | 128 | export MOZ_PKG_MAC_DSSTORE=$rootdir/dmg-root/[% c('var/ProjectName') %].dmg/nightly.DS_Store
|
| 129 | 129 | export MOZ_PKG_MAC_ICON=$rootdir/dmg-root/[% c('var/ProjectName') %].dmg/.VolumeIcon.icns
|
| 130 | 130 | [% END -%]
|
| 131 | - ./mach package
|
|
| 132 | - |
|
| 133 | - artifactsdir=[% out_dir %]/artifacts
|
|
| 134 | - mkdir $artifactsdir
|
|
| 135 | - |
|
| 136 | - # Copy the artifacts to the target directory
|
|
| 137 | - # Naming convention is the same as Mozilla uses for their artifacts
|
|
| 138 | - mv obj-*/dist/*.xpt_artifacts.zip $artifactsdir/target.xpt_artifacts.zip
|
|
| 139 | - |
|
| 140 | - [% IF c("var/macos") -%]
|
|
| 141 | - mv obj-*/dist/*.dmg $artifactsdir/target.dmg
|
|
| 142 | - mv obj-*/dist/*.update_framework_artifacts.zip $artifactsdir/target.update_framework_artifacts.zip
|
|
| 143 | - [% END -%]
|
|
| 144 | 131 | |
| 145 | 132 | [% IF c("var/linux") -%]
|
| 146 | - mv obj-*/dist/*.tar.xz $artifactsdir/target.tar.xz
|
|
| 147 | - [% END -%]
|
|
| 148 | - |
|
| 149 | - [% IF c("var/windows") -%]
|
|
| 150 | - mv obj-*/dist/*.zip $artifactsdir/target.zip
|
|
| 133 | + # Compression differs with 1 or 2+ threads,
|
|
| 134 | + # so we'll want to have at least 2 threads, but otherwise respect num_procs.
|
|
| 135 | + #
|
|
| 136 | + # Without this, compression takes 20min+
|
|
| 137 | + export XZ_DEFAULTS="-T[% c("num_procs") > 1 ? c("num_procs") : '2' %]"
|
|
| 151 | 138 | [% END -%]
|
| 152 | 139 | |
| 153 | - ./mach python -m mozbuild.action.test_archive common $artifactsdir/target.common.tests.tar.gz
|
|
| 140 | + # Package the browser and also create all the test artifacts.
|
|
| 141 | + #
|
|
| 142 | + # MOZ_SIMPLE_PACKAGE_NAME will force all artifact files to start with "target",
|
|
| 143 | + # instead of the name of the package, which would be something like: firefox-140.4.0.en-US.linux-x86_64.
|
|
| 144 | + # This is the same convention used by upstream.
|
|
| 145 | + #
|
|
| 146 | + # Also it just makes it easier to copy all artifacts over in the next step.
|
|
| 147 | + MOZ_SIMPLE_PACKAGE_NAME="target" ./mach build package package-tests
|
|
| 148 | + |
|
| 149 | + artifactsdir=[% out_dir %]/artifacts/[% c("var/osname") %]
|
|
| 150 | + mkdir -p $artifactsdir
|
|
| 151 | + mv obj-*/dist/target.* $artifactsdir
|
|
| 154 | 152 | [% END %]
|
| 155 | 153 | |
| 156 | 154 | [% IF c("var/macos") -%]
|
| ... | ... | @@ -223,10 +223,10 @@ input_files: |
| 223 | 223 | - filename: marsigner.der
|
| 224 | 224 | enable: '[% c("var/override_updater_url") %]'
|
| 225 | 225 | - filename: dmg-root
|
| 226 | - enable: '[% c("var/macos") && c("var/nightly") %]'
|
|
| 226 | + enable: '[% c("var/macos") && c("var/dev_artifacts") %]'
|
|
| 227 | 227 | - project: hfsplus-tools
|
| 228 | 228 | name: hfsplus-tools
|
| 229 | - enable: '[% c("var/macos") && c("var/nightly") %]'
|
|
| 229 | + enable: '[% c("var/macos") && c("var/dev_artifacts") %]'
|
|
| 230 | 230 | - project: libdmg-hfsplus
|
| 231 | 231 | name: libdmg
|
| 232 | - enable: '[% c("var/macos") && c("var/nightly") %]' |
|
| 232 | + enable: '[% c("var/macos") && c("var/dev_artifacts") %]' |
| ... | ... | @@ -26,7 +26,8 @@ |
| 26 | 26 | HOST_CXX="clang++"
|
| 27 | 27 | CC="[% c('arch') %]-w64-mingw32-clang"
|
| 28 | 28 | CXX="[% c('arch') %]-w64-mingw32-clang++"
|
| 29 | - CXXFLAGS="-fms-extensions"
|
|
| 29 | + CFLAGS="-include _mingw.h"
|
|
| 30 | + CXXFLAGS="-fms-extensions -include _mingw.h"
|
|
| 30 | 31 | AR=llvm-ar
|
| 31 | 32 | RANLIB=llvm-ranlib
|
| 32 | 33 | |
| ... | ... | @@ -56,7 +57,7 @@ |
| 56 | 57 | export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/[% c('var/build_target') %]-
|
| 57 | 58 | export DSYMUTIL="$TOOLCHAIN_DIR/clang/bin/dsymutil"
|
| 58 | 59 | |
| 59 | - [% IF c("var/nightly") -%]
|
|
| 60 | + [% IF c("var/dev_artifacts") -%]
|
|
| 60 | 61 | export MKFSHFS=/var/tmp/dist/hfsplus-tools/newfs_hfs
|
| 61 | 62 | export DMG_TOOL=/var/tmp/dist/libdmg-hfsplus/dmg
|
| 62 | 63 | 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 |
| 87 | 88 | ac_add_options --with-updater-url=[% c("var/updater_url") %]
|
| 88 | 89 | [% END -%]
|
| 89 | 90 | |
| 91 | +[% IF c("var/dev_artifacts") -%]
|
|
| 92 | + ac_add_options --enable-tests
|
|
| 93 | +[% END -%]
|
|
| 94 | + |
|
| 95 | +# Necessary for package-tests step which expects dist/bin/jsapi-tests to exist.
|
|
| 96 | +# This is added regardless of --enable-tests, because it's also a useful debugging tool.
|
|
| 97 | +ac_add_options --enable-js-shell
|
|
| 98 | + |
|
| 90 | 99 | mk_add_options MOZ_PARALLEL_BUILD=[% c("num_procs") %]
|
| 91 | 100 | |
| 92 | 101 | export MOZ_APP_REMOTINGNAME="[% c('var/display_name') %]"
|
| ... | ... | @@ -23,6 +23,13 @@ export MOZ_SOURCE_REPO="[% c('var/gitlab_project') %]" |
| 23 | 23 | export MOZ_SOURCE_CHANGESET=[% c("var/git_commit") %]
|
| 24 | 24 | |
| 25 | 25 | ac_add_options --enable-update-channel=[% c("var/variant") %]
|
| 26 | + |
|
| 27 | +[% IF c("var/dev_artifacts") -%]
|
|
| 28 | + ac_add_options --enable-tests
|
|
| 29 | + # Necessary for package-tests step which expects dist/bin/jsapi-tests to exist.
|
|
| 30 | + ac_add_options --enable-js-shell
|
|
| 31 | +[% END -%]
|
|
| 32 | + |
|
| 26 | 33 | MOZCONFIG_EOF
|
| 27 | 34 | echo "ac_add_options --with-branding=$branding_dir" >> .mozconfig
|
| 28 | 35 | |
| ... | ... | @@ -36,15 +43,22 @@ echo "Starting ./mach build $(date)" |
| 36 | 43 | |
| 37 | 44 | [% IF c("var/dev_artifacts") -%]
|
| 38 | 45 | echo "Building development artifacts"
|
| 39 | - ./mach package
|
|
| 40 | 46 | |
| 41 | - artifactsdir=$outdir/artifacts
|
|
| 47 | + # Package the browser and also create all the test artifacts.
|
|
| 48 | + #
|
|
| 49 | + # MOZ_SIMPLE_PACKAGE_NAME will force all artifact files to start with "target",
|
|
| 50 | + # instead of the name of the package, which would be something like: firefox-140.4.0.en-US.linux-x86_64.
|
|
| 51 | + # This is the same convention used by upstream
|
|
| 52 | + MOZ_SIMPLE_PACKAGE_NAME="target" ./mach build package package-tests
|
|
| 53 | + |
|
| 54 | + artifactsdir=$outdir/[% IF !c("var/android_single_arch") -%]artifacts[% ELSE -%]geckoview/artifacts/[% c("var/abi") %][% END -%]
|
|
| 55 | + |
|
| 42 | 56 | mkdir -p $artifactsdir
|
| 57 | + |
|
| 43 | 58 | # Copy the artifacts to the target directory
|
| 44 | 59 | # Naming convention is the same as Mozilla uses for their artifacts
|
| 45 | - cp -a obj-*/dist/*.zip $artifactsdir/target.xpt_artifacts.zip
|
|
| 46 | - cp -a obj-*/gradle/build/mobile/android/geckoview_example/outputs/apk/*/geckoview_example-*.apk $artifactsdir/geckoview_example.apk
|
|
| 47 | - ./mach python -m mozbuild.action.test_archive common $artifactsdir/target.common.tests.tar.gz
|
|
| 60 | + mv obj-*/gradle/build/mobile/android/geckoview_example/outputs/apk/*/geckoview_example-*.apk $artifactsdir/geckoview_example.apk
|
|
| 61 | + mv obj-*/dist/target.* $artifactsdir
|
|
| 48 | 62 | [% END %]
|
| 49 | 63 | |
| 50 | 64 | echo "Build finished, copying the AAR to the to the destination directory $(date)"
|
| ... | ... | @@ -33,6 +33,7 @@ var: |
| 33 | 33 | - python3
|
| 34 | 34 | - python3-distutils
|
| 35 | 35 | - python3-venv
|
| 36 | + - python3-zstandard
|
|
| 36 | 37 | - pkg-config
|
| 37 | 38 | - openjdk-17-jdk-headless
|
| 38 | 39 | # this should be updated when the list of gradle dependencies is changed
|
| ... | ... | @@ -65,7 +65,12 @@ var: |
| 65 | 65 | ### upload the files to
|
| 66 | 66 | #tpo_user: username
|
| 67 | 67 | |
| 68 | - ### This option enables generation of development artifacts
|
|
| 68 | + ### This option enables generation of browser artifacts
|
|
| 69 | + ###
|
|
| 70 | + ### Artifacts is a saturated term in this project, but in this case it
|
|
| 71 | + ### refers to Firefox artifacts e.g. for artifact builds.
|
|
| 72 | + ###
|
|
| 73 | + ### See: https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.html
|
|
| 69 | 74 | #dev_artifacts: '[% c("var/nightly") %]'
|
| 70 | 75 | |
| 71 | 76 | ### The clean configuration is used by the cleaning script to find the
|