commit 7b518eaf06e16537fd8447f0a0cf0fc42efa1c98 Author: Nicolas Vigier boklm@torproject.org Date: Wed Jun 23 17:43:07 2021 +0200
Bug 40314: Add commands to check for needed toolchain updates
The following commands can be used to check needed toolchain updates to build Firefox for Linux, Windows or macOS:
make list_toolchain_updates-firefox-linux make list_toolchain_updates-firefox-windows make list_toolchain_updates-firefox-macos --- Makefile | 9 ++ projects/firefox/config | 10 ++ projects/firefox/list_toolchain_updates_checks | 194 +++++++++++++++++++++++++ projects/macosx-toolchain/config | 6 +- 4 files changed, 216 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile index 94010c1..42ac282 100644 --- a/Makefile +++ b/Makefile @@ -204,6 +204,15 @@ dmg2mar-alpha: submodule-update list_toolchain_updates-fenix: submodule-update $(rbm) build fenix --step list_toolchain_updates --target nightly --target torbrowser-android-armv7
+list_toolchain_updates-firefox-linux: submodule-update + $(rbm) build firefox --step list_toolchain_updates --target nightly --target torbrowser-linux-x86_64 + +list_toolchain_updates-firefox-windows: submodule-update + $(rbm) build firefox --step list_toolchain_updates --target nightly --target torbrowser-windows-x86_64 + +list_toolchain_updates-firefox-macos: submodule-update + $(rbm) build firefox --step list_toolchain_updates --target nightly --target torbrowser-osx-x86_64 + list_toolchain_updates-android-components: submodule-update $(rbm) build android-components --step list_toolchain_updates --target nightly --target torbrowser-android-armv7
diff --git a/projects/firefox/config b/projects/firefox/config index e5ba431..f99ecef 100644 --- a/projects/firefox/config +++ b/projects/firefox/config @@ -39,6 +39,16 @@ steps: nightly: version: '[% c("abbrev") %]'
+ list_toolchain_updates: + git_url: https://github.com/mozilla/gecko-dev.git + # < 91.0a1 + git_hash: f351e19360729b351bfc7c1386d6e4ca4ea676e2 + tag_gpg_id: 0 + input_files: [] + var: + container: + use_container: 0 + targets: release: var: diff --git a/projects/firefox/list_toolchain_updates_checks b/projects/firefox/list_toolchain_updates_checks new file mode 100644 index 0000000..6c8b88e --- /dev/null +++ b/projects/firefox/list_toolchain_updates_checks @@ -0,0 +1,194 @@ +#!/bin/bash + +# rust +[% IF c("var/linux"); + SET toolchain_alias='linux64-rust'; + ELSIF c("var/windows"); + SET toolchain_alias='mingw32-rust'; + ELSIF c("var/osx"); + SET toolchain_alias='linux64-rust-macos'; + END; %] +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/rust.yml'); +foreach my $t (keys %$d) { + if ($d->{$t}{run}{'toolchain-alias'} eq '[% toolchain_alias %]') { + my $channel; + foreach my $arg (@{$d->{$t}{run}{arguments}}) { + if ($arg eq '--channel') { + $channel = 1; + next; + } + if ($channel) { + print $arg; + exit; + } + } + } +} +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("rust", "version") %]' +check_update_needed rust "$needed" "$current" + +# cbindgen +read -d '' p << 'EOF' || true +if (m/^\s*cbindgen_min_version\s*=\s*Version\("([^"]+)"\)/) { + print $1; + exit; +} +EOF +needed=$(cat build/moz.configure/bindgen.configure | perl -ne "$p") +current='[% pc("cbindgen", "version") %]' +check_update_needed cbindgen "$needed" "$current" + + +# nasm +read -d '' p << 'EOF' || true +if (m/^\s*MODERN_NASM_VERSION\s*=\s*LooseVersion\("([^"]+)"\)/) { + print $1; + exit; +} +EOF +needed=$(cat python/mozboot/mozboot/base.py | perl -ne "$p") +current='2.14' +check_update_needed nasm "$needed" "$current" + + +# clang +[% IF c("var/linux"); + SET toolchain_alias='linux64-clang'; + ELSIF c("var/windows"); + SET toolchain_alias='linux64-clang-mingw-x64'; + ELSIF c("var/osx"); + SET toolchain_alias='macosx64-clang'; + END; %] +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/clang.yml'); +my $clang_toolchain; +foreach my $t (keys %$d) { + if ($d->{$t}{run}{'toolchain-alias'} eq '[% toolchain_alias %]') { + foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) { + $clang_toolchain = $fetch if $fetch =~ m/^clang-.*/; + } + last; + } +} + +if (!$clang_toolchain) { + print STDERR "Error: could not find clang toolchain"; + exit 1; +} + +my $fetch = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml'); +print $fetch->{$clang_toolchain}{fetch}{revision}; +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("llvm-project", "git_hash") %]' +check_update_needed clang "$needed" "$current" + + +# node +read -d '' p << 'EOF' || true +if (m/^\s*NODE_MIN_VERSION\s*=\s*StrictVersion\("([^"]+)"\)/) { + print $1; + exit; +} +EOF +needed=$(cat python/mozbuild/mozbuild/nodeutil.py | perl -ne "$p") +current='[% pc("node", "version") %]' +check_update_needed node "$needed" "$current" + + +# python +read -d '' p << 'EOF' || true +if (m/find_python3_executable\(min_version\s*=\s*"([^"]+)"/) { + print $1; + exit; +} +EOF +needed=$(cat build/moz.configure/init.configure | perl -ne "$p") +current=3.6.0 +check_update_needed python "$needed" "$current" + + +[% IF c("var/osx") %] +# macosx-sdk +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/clang.yml'); +my $clang_toolchain; +foreach my $t (keys %$d) { + if ($d->{$t}{run}{'toolchain-alias'} eq 'macosx64-clang') { + foreach my $toolchain (@{$d->{$t}{fetches}{toolchain}}) { + if ($toolchain =~ m/^macosx64-sdk-(.+)$/) { + print $1; + exit; + } + } + last; + } +} +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("macosx-toolchain", "version") %]' +check_update_needed macos-sdk "$needed" "$current" + +# End of macOS checks +[% END -%] + + +[% IF c("var/windows") %] +# mingw-w64 +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml'); +print $d->{'mingw-w64'}{fetch}{revision}; +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("mingw-w64", "git_hash") %]' +check_update_needed mingw-w64 "$needed" "$current" + + +# llvm-mingw +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml'); +print $d->{'llvm-mingw'}{fetch}{revision}; +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("llvm-mingw", "git_hash") %]' +check_update_needed llvm-mingw "$needed" "$current" + + +# fxc2 +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml'); +print $d->{fxc2}{fetch}{revision}; +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("fxc2", "git_hash") %]' +check_update_needed fxc2 "$needed" "$current" + +# End of Windows checks +[% END -%] + + +[% IF c("var/rlbox") %] +# wasi-sdk +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml'); +print $d->{'wasi-sdk'}{fetch}{revision}; +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("wasi-sysroot", "git_hash") %]' +check_update_needed wasi-sdk "$needed" "$current" + + +# lucetc +read -d '' p << 'EOF' || true +my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml'); +print $d->{'lucetc-source'}{fetch}{revision}; +EOF +needed=$(perl -MYAML::XS -e "$p") +current='[% pc("lucetc", "git_hash") %]' +check_update_needed lucetc "$needed" "$current" + +# End RLBox +[% END -%] diff --git a/projects/macosx-toolchain/config b/projects/macosx-toolchain/config index 95f650b..5f9a109 100644 --- a/projects/macosx-toolchain/config +++ b/projects/macosx-toolchain/config @@ -1,6 +1,6 @@ # vim: filetype=yaml sw=2 -filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' -version: 10.11-1 +filename: '[% project %]-[% c("version") %]-1-[% c("var/build_id") %].tar.gz' +version: 10.11 var: container: use_container: 1 @@ -29,7 +29,7 @@ input_files: # Instructions on how to create the SDK tarball can be found at: # build/macosx/cross-mozconfig.common - name: SDK - URL: https://people.torproject.org/~gk/mirrors/sources/MacOSX10.11.sdk.tar.bz2 + URL: 'https://people.torproject.org/~gk/mirrors/sources/MacOSX%5B% c("version") %].sdk.tar.bz2' sha256sum: d11e410d757d023be66d2fe7eaa85a1d232da3ac04f177eff3d8b8275cd9ffca - name: clang-source project: clang-source
tbb-commits@lists.torproject.org