boklm pushed to branch main at The Tor Project / Applications / tor-browser-build

Commits:

20 changed files:

Changes:

  • Makefile
    ... ... @@ -432,22 +432,7 @@ list_translation_updates-alpha:
    432 432
     	$(rbm) showconf --target alpha --step list_updates translation list_updates
    
    433 433
     
    
    434 434
     list_toolchain_updates:
    
    435
    -	tools/list_toolchain_updates
    
    436
    -
    
    437
    -list_toolchain_updates-firefox-linux: submodule-update
    
    438
    -	$(rbm) build firefox --step list_toolchain_updates --target nightly --target torbrowser-linux-x86_64
    
    439
    -
    
    440
    -list_toolchain_updates-firefox-windows: submodule-update
    
    441
    -	$(rbm) build firefox --step list_toolchain_updates --target nightly --target torbrowser-windows-x86_64
    
    442
    -
    
    443
    -list_toolchain_updates-firefox-macos: submodule-update
    
    444
    -	$(rbm) build firefox --step list_toolchain_updates --target nightly --target torbrowser-macos
    
    445
    -
    
    446
    -list_toolchain_updates-application-services: submodule-update
    
    447
    -	$(rbm) build application-services --step list_toolchain_updates --target nightly --target torbrowser-android-armv7
    
    448
    -
    
    449
    -list_toolchain_updates-geckoview: submodule-update
    
    450
    -	$(rbm) build geckoview --step list_toolchain_updates --target nightly --target torbrowser-android-armv7
    
    435
    +	@tools/toolchain-updates/list-toolchain-updates
    
    451 436
     
    
    452 437
     create_glean_deps_tarball: submodule-update
    
    453 438
     	 $(rbm) build glean-parser --target alpha --target torbrowser-android-armv7
    

  • doc/MAKEFILE.txt
    ... ... @@ -179,10 +179,9 @@ and compare them with the checksum from sha256sums-unsigned-build.txt.
    179 179
     * Toolchain updates *
    
    180 180
     *********************
    
    181 181
     
    
    182
    -list_toolchain_updates-{application-services,firefox-linux,firefox-macos,
    
    183
    -                        firefox-windows,geckoview}
    
    184
    --------------------------------------------------------------------------
    
    185
    -List toolchain updates required for building selected component/platform.
    
    182
    +list_toolchain_updates
    
    183
    +----------------------
    
    184
    +List toolchain updates required.
    
    186 185
     
    
    187 186
     
    
    188 187
     firefox-{linux-x86_64,linux-aarch64,windows-x86_64,windows-i686,
    

  • doc/how-to-update-glean-parser.txt
    ... ... @@ -8,8 +8,8 @@ There are three steps involved in the process:
    8 8
     
    
    9 9
     1)
    
    10 10
     
    
    11
    -Running `make list_toolchain_updates-geckoview` should tell
    
    12
    -you which version of `glean_parser` is needed.
    
    11
    +Running `make list_toolchain_updates` should tell you which version of
    
    12
    +`glean_parser` is needed.
    
    13 13
     
    
    14 14
     2)
    
    15 15
     
    

  • projects/android-ndk/config
    ... ... @@ -3,7 +3,7 @@ filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("co
    3 3
     version: 29.0.14206865
    
    4 4
     
    
    5 5
     var:
    
    6
    -  release: 29
    
    6
    +  release: r29
    
    7 7
       setup: |
    
    8 8
         mkdir -p /var/tmp/dist
    
    9 9
         tar -C /var/tmp/dist -xf $rootdir/[% c("compiler_tarfile") %]
    
    ... ... @@ -13,6 +13,6 @@ var:
    13 13
         export PATH=$PATH:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
    
    14 14
     
    
    15 15
     input_files:
    
    16
    -  - URL: 'https://dl.google.com/android/repository/android-ndk-r[% c("var/release") %]-linux.zip'
    
    16
    +  - URL: 'https://dl.google.com/android/repository/android-ndk-[% c("var/release") %]-linux.zip'
    
    17 17
         name: ndk
    
    18 18
         sha256sum: 4abbbcdc842f3d4879206e9695d52709603e52dd68d3c1fff04b3b5e7a308ecf

  • projects/application-services/config
    ... ... @@ -27,11 +27,16 @@ var:
    27 27
       nss_sha256sum: fb5aa56fa35d963d4c65278328e2e9c99c2484c86f0e41537412477739dcf997
    
    28 28
       cargo_vendor_include_config: 1
    
    29 29
     
    
    30
    +  application-services_versions_infos: '[% exec(c("basedir") _ "/tools/toolchain-updates/extract-application-services-versions-infos") %]'
    
    31
    +
    
    30 32
     targets:
    
    31 33
       nightly:
    
    32 34
         git_hash: '[% c("version") %]-TORBROWSER'
    
    33 35
         tag_gpg_id: 0
    
    34 36
     
    
    37
    +  list_toolchain_updates:
    
    38
    +    git_hash: 'v[% c("version") %]'
    
    39
    +
    
    35 40
     steps:
    
    36 41
       build:
    
    37 42
         filename: '[% project %]-[% c("version") %]-[% c("var/rebuild_date") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
    
    ... ... @@ -97,9 +102,3 @@ steps:
    97 102
             filename: 'gradle-dependencies-list-[% c("version") %].txt'
    
    98 103
             var:
    
    99 104
               generate_gradle_dependencies_list: 1
    100
    -
    
    101
    -  list_toolchain_updates:
    
    102
    -    git_hash: 'v[% c("version") %]'
    
    103
    -    input_files: []
    
    104
    -    container:
    
    105
    -      use_container: 0

  • projects/application-services/list_toolchain_updates_checks deleted
    1
    -#!/bin/bash
    
    2
    -
    
    3
    -# compileSdkVersion
    
    4
    -read -d '' p << 'EOF' || true
    
    5
    -if (m/^\\s*compileSdkMajorVersion:\\s([^"]*),/) {
    
    6
    -  $major = $1;
    
    7
    -}
    
    8
    -if (m/^\\s*compileSdkMinorVersion:\\s([^"]*),/) {
    
    9
    -  $minor = $1;
    
    10
    -}
    
    11
    -if ($major && $minor) {
    
    12
    -  print "$major.$minor.0";
    
    13
    -  exit 0;
    
    14
    -}
    
    15
    -EOF
    
    16
    -needed=$(cat build.gradle | perl -ne "$p")
    
    17
    -current=[% pc("android-sdk", "version") %]
    
    18
    -check_update_needed compileSdkVersion "$needed" "$current"
    
    19
    -
    
    20
    -
    
    21
    -# gradle
    
    22
    -read -d '' p << 'EOF' || true
    
    23
    -if (m|distributionUrl=https\\\\://services.gradle.org/distributions/gradle-(.*)-.*.zip|) {
    
    24
    -  print $1;
    
    25
    -  exit;
    
    26
    -}
    
    27
    -EOF
    
    28
    -needed=$(cat gradle/wrapper/gradle-wrapper.properties | perl -ne "$p")
    
    29
    -current='[% c("var/gradle_version") %]'
    
    30
    -check_update_needed gradle "$needed" "$current"
    
    31
    -
    
    32
    -
    
    33
    -# nss-nspr
    
    34
    -read -d '' p << 'EOF' || true
    
    35
    -if (m/NSS_ARCHIVE="nss-(.*-with-nspr-.*)\\.tar\\.gz"/) {
    
    36
    -  print $1;
    
    37
    -  exit;
    
    38
    -}
    
    39
    -EOF
    
    40
    -needed=$(cat libs/build-all.sh | perl -ne "$p")
    
    41
    -current='[% c("var/nss_version") %]-with-nspr-[% c("var/nspr_version") %]'
    
    42
    -check_update_needed nss-nspr "$needed" "$current"
    
    43
    -
    
    44
    -# nss-sha256sum
    
    45
    -read -d '' p << 'EOF' || true
    
    46
    -if (m/NSS_SHA256="([^"]+)"/) {
    
    47
    -  print $1;
    
    48
    -  exit;
    
    49
    -}
    
    50
    -EOF
    
    51
    -needed=$(cat libs/build-all.sh | perl -ne "$p")
    
    52
    -current='[% c("var/nss_sha256sum") %]'
    
    53
    -check_update_needed nss-sha256sum "$needed" "$current"
    
    54
    -
    
    55
    -# uniffi
    
    56
    -p='while (<>) {
    
    57
    -  if (m/^\s*uniffi\s*=\s*\{[^}]*version\s*=\s*"([^"]*)"/) {
    
    58
    -    print $1;
    
    59
    -    exit;
    
    60
    -  }
    
    61
    -}'
    
    62
    -needed=$(cat components/autofill/Cargo.toml | perl -ne "$p")
    
    63
    -current='[% pc("uniffi-rs", "version") %]'
    
    64
    -check_update_needed uniffi "$needed" "$current"

  • projects/common/list_toolchain_updates deleted
    1
    -#!/bin/bash
    
    2
    -
    
    3
    -set -e
    
    4
    -
    
    5
    -rootdir="$(pwd)"
    
    6
    -no_updates="$rootdir/no_updates.txt"
    
    7
    -updates="$rootdir/updates.txt"
    
    8
    -
    
    9
    -tar -xf [% project %]-[% c('version') %].tar.[% c('compress_tar') %]
    
    10
    -cd [% project %]-[% c('version') %]
    
    11
    -
    
    12
    -function check_update_needed() {
    
    13
    -  name="$1"
    
    14
    -  v1="$2"
    
    15
    -  v2="$3"
    
    16
    -  if test "$v1" = "$v2"
    
    17
    -  then
    
    18
    -    echo "* $name ($v1)" >> "$no_updates"
    
    19
    -  else
    
    20
    -    echo "* $name needs to be updated to $v1 (currently at $v2)" >> "$updates"
    
    21
    -  fi
    
    22
    -}
    
    23
    -
    
    24
    -[% INCLUDE list_toolchain_updates_checks %]
    
    25
    -
    
    26
    -echo '### Component: [% project %] ([% c("git_hash") %])'
    
    27
    -
    
    28
    -if test -f "$updates"
    
    29
    -then
    
    30
    -  echo "The following components need to be updated:"
    
    31
    -  cat "$updates"
    
    32
    -  echo
    
    33
    -fi
    
    34
    -if test -f "$no_updates"
    
    35
    -then
    
    36
    -  echo "The following components don't need to be updated:"
    
    37
    -  cat "$no_updates"
    
    38
    -fi

  • projects/common/list_toolchain_updates-common-firefox-geckoview deleted
    1
    -#!/bin/bash
    
    2
    -
    
    3
    -# rust
    
    4
    -[% IF c("var/linux") || c("var/android");
    
    5
    -     SET toolchain_alias='linux64-rust';
    
    6
    -   ELSIF c("var/windows");
    
    7
    -     SET toolchain_alias='mingw32-rust';
    
    8
    -   ELSIF c("var/macos");
    
    9
    -     SET toolchain_alias='linux64-rust-macos';
    
    10
    -   END; %]
    
    11
    -read -d '' p << 'EOF' || true
    
    12
    -sub as_array {
    
    13
    -  ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
    
    14
    -}
    
    15
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/rust.yml');
    
    16
    -foreach my $t (keys %$d) {
    
    17
    -  next unless ref $d->{$t}{run}{'toolchain-alias'} eq 'HASH';
    
    18
    -  my $talias = as_array($d->{$t}{run}{'toolchain-alias'}{'by-project'}{default});
    
    19
    -  if (grep { $_ eq '[% toolchain_alias %]' } @$talias) {
    
    20
    -    my $channel;
    
    21
    -    foreach my $arg (@{$d->{$t}{run}{arguments}}) {
    
    22
    -      if ($arg eq '--channel') {
    
    23
    -        $channel = 1;
    
    24
    -        next;
    
    25
    -      }
    
    26
    -      if ($channel) {
    
    27
    -        print $arg;
    
    28
    -        exit;
    
    29
    -      }
    
    30
    -    }
    
    31
    -  }
    
    32
    -}
    
    33
    -EOF
    
    34
    -needed=$(perl -MYAML::XS -e "$p")
    
    35
    -current='[% pc("rust", "version") %]'
    
    36
    -check_update_needed rust "$needed" "$current"
    
    37
    -
    
    38
    -
    
    39
    -# clang
    
    40
    -[% IF c("var/linux") || c("var/android");
    
    41
    -     SET toolchain_alias='linux64-clang';
    
    42
    -   ELSIF c("var/windows");
    
    43
    -     SET toolchain_alias='linux64-clang-mingw-x64';
    
    44
    -   ELSIF c("var/macos");
    
    45
    -     SET toolchain_alias='macosx64-clang';
    
    46
    -   END; %]
    
    47
    -read -d '' p << 'EOF' || true
    
    48
    -sub as_array {
    
    49
    -  ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
    
    50
    -}
    
    51
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/clang.yml');
    
    52
    -my $clang_toolchain;
    
    53
    -my $clang_fetch;
    
    54
    -TOOLCHAIN: foreach my $t (keys %$d) {
    
    55
    -  my $aliases = as_array($d->{$t}{run}{'toolchain-alias'}{'by-project'}{default});
    
    56
    -  foreach my $alias (@$aliases) {
    
    57
    -    if ($alias eq '[% toolchain_alias %]') {
    
    58
    -      foreach my $fetch (@{$d->{$t}{fetches}{toolchain}}) {
    
    59
    -        $clang_toolchain = $fetch if $fetch =~ m/^.*-clang-.*/;
    
    60
    -      }
    
    61
    -      foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
    
    62
    -        $clang_fetch = $fetch if $fetch =~ m/^clang-.*/;
    
    63
    -      }
    
    64
    -      last TOOLCHAIN;
    
    65
    -    }
    
    66
    -  }
    
    67
    -}
    
    68
    -
    
    69
    -if (!$clang_toolchain && !$clang_fetch) {
    
    70
    -  print STDERR "Error: could not find clang toolchain\\n";
    
    71
    -  exit 1;
    
    72
    -}
    
    73
    -
    
    74
    -if (!$clang_fetch) {
    
    75
    -  foreach my $fetch (@{$d->{$clang_toolchain}{fetches}{fetch}}) {
    
    76
    -    $clang_fetch = $fetch if $fetch =~ m/^clang-.*/;
    
    77
    -  }
    
    78
    -}
    
    79
    -
    
    80
    -if (!$clang_fetch) {
    
    81
    -  print STDERR "Error: could not find clang fetch\\n";
    
    82
    -  exit 1;
    
    83
    -}
    
    84
    -
    
    85
    -my $fetch = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    86
    -print $fetch->{$clang_fetch}{fetch}{revision};
    
    87
    -EOF
    
    88
    -needed=$(perl -MYAML::XS -e "$p")
    
    89
    -current='[% pc("llvm-project", "git_hash") %]'
    
    90
    -check_update_needed clang "$needed" "$current"
    
    91
    -
    
    92
    -
    
    93
    -# cbindgen
    
    94
    -read -d '' p << 'EOF' || true
    
    95
    -my $fetch = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    96
    -my $revision;
    
    97
    -T: foreach my $t (keys %$fetch) {
    
    98
    -  if ($fetch->{$t}{'fetch-alias'} eq 'cbindgen') {
    
    99
    -    $revision = $fetch->{$t}{fetch}{revision};
    
    100
    -    last T;
    
    101
    -  }
    
    102
    -}
    
    103
    -exit 1 unless $revision;
    
    104
    -print $revision;
    
    105
    -EOF
    
    106
    -needed=$(perl -MYAML::XS -e "$p")
    
    107
    -current='[% pc("cbindgen", "git_hash") %]'
    
    108
    -check_update_needed cbindgen "$needed" "$current"
    
    109
    -
    
    110
    -
    
    111
    -# nasm
    
    112
    -read -d '' p << 'EOF' || true
    
    113
    -my $nasm = YAML::XS::LoadFile('taskcluster/kinds/toolchain/nasm.yml');
    
    114
    -my $linux64 = 'linux64-nasm';
    
    115
    -print substr $nasm->{$linux64}{'fetches'}{'fetch'}[0], 5;
    
    116
    -EOF
    
    117
    -needed=$(perl -MYAML::XS -e "$p")
    
    118
    -current='[% pc("nasm", "version") %]'
    
    119
    -check_update_needed nasm "$needed" "$current"
    
    120
    -
    
    121
    -
    
    122
    -# node
    
    123
    -read -d '' p << 'EOF' || true
    
    124
    -sub l {
    
    125
    -  ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
    
    126
    -}
    
    127
    -
    
    128
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/node.yml');
    
    129
    -my $node_toolchain;
    
    130
    -T: foreach my $t (keys %$d) {
    
    131
    -  foreach my $alias (@{l($d->{$t}{run}{'toolchain-alias'})}) {
    
    132
    -    if ($alias eq 'linux64-node') {
    
    133
    -      foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
    
    134
    -        if ($fetch =~ m/^nodejs-.*/) {
    
    135
    -          $node_toolchain = $fetch;
    
    136
    -          last T;
    
    137
    -        }
    
    138
    -      }
    
    139
    -    }
    
    140
    -  }
    
    141
    -}
    
    142
    -
    
    143
    -exit 1 unless $node_toolchain;
    
    144
    -
    
    145
    -my $fetch = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    146
    -my ($version) = $fetch->{$node_toolchain}{fetch}{url} =~ m|^https://nodejs.org/dist/v([^/]+)/|;
    
    147
    -print "$version\\n";
    
    148
    -EOF
    
    149
    -needed=$(perl -MYAML::XS -e "$p")
    
    150
    -current='[% pc("node", "version") %]'
    
    151
    -check_update_needed node "$needed" "$current"
    
    152
    -
    
    153
    -
    
    154
    -# Python
    
    155
    -read -d '' p << 'EOF' || true
    
    156
    -if (m/^\\s*MINIMUM_MINOR_VERSION = ([0-9]+)/) {
    
    157
    -  print $1;
    
    158
    -  exit;
    
    159
    -}
    
    160
    -EOF
    
    161
    -needed=3.$(cat python/mozboot/bin/bootstrap.py | perl -ne "$p")
    
    162
    -current="3.9" # 3.11.x on Debian bookworm, 3.13.11 on our python project
    
    163
    -check_update_needed python "$needed" "$current"
    
    164
    -
    
    165
    -
    
    166
    -# binutils
    
    167
    -read -d '' p << 'EOF' || true
    
    168
    -
    
    169
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/misc.yml');
    
    170
    -my $f = $d->{'linux64-binutils'}{fetches}{fetch}[0];
    
    171
    -my ($version) = $f =~ m|^binutils-([0-9\\.]+)|;
    
    172
    -exit 1 unless $version;
    
    173
    -print "$version\\n";
    
    174
    -EOF
    
    175
    -
    
    176
    -needed=$(perl -MYAML::XS -e "$p")
    
    177
    -current='[% pc("binutils", "version") %]'
    
    178
    -check_update_needed binutils "$needed" "$current"

  • projects/firefox/config
    ... ... @@ -63,6 +63,8 @@ var:
    63 63
       windows_rs_version: '0.62.2'
    
    64 64
       windows_rs_sha256sum: 527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580
    
    65 65
     
    
    66
    +  firefox_versions_infos: '[% exec(c("basedir") _ "/tools/toolchain-updates/extract-firefox-versions-infos") %]'
    
    67
    +
    
    66 68
     steps:
    
    67 69
       src-tarballs:
    
    68 70
         filename: 'src-[% project %]-[% c("version") %].tar.xz'
    
    ... ... @@ -90,13 +92,6 @@ steps:
    90 92
           nightly:
    
    91 93
             version: '[% c("abbrev") %]'
    
    92 94
     
    
    93
    -  list_toolchain_updates:
    
    94
    -    git_hash: '[% c("var/upstream_firefox_commit") %]'
    
    95
    -    tag_gpg_id: 0
    
    96
    -    input_files: []
    
    97
    -    container:
    
    98
    -      use_container: 0
    
    99
    -
    
    100 95
     targets:
    
    101 96
       firefoxbrowser:
    
    102 97
         git_hash: '[% c("var/upstream_firefox_commit") %]'
    
    ... ... @@ -168,6 +163,10 @@ targets:
    168 163
             - python3-zstandard
    
    169 164
             - wine
    
    170 165
     
    
    166
    +  list_toolchain_updates:
    
    167
    +    git_hash: '[% c("var/upstream_firefox_commit") %]'
    
    168
    +    tag_gpg_id: 0
    
    169
    +
    
    171 170
     input_files:
    
    172 171
       - project: container-image
    
    173 172
       - filename: 'mozconfig'
    

  • projects/firefox/list_toolchain_updates_checks deleted
    1
    -#!/bin/bash
    
    2
    -
    
    3
    -[% INCLUDE 'list_toolchain_updates-common-firefox-geckoview' %]
    
    4
    -
    
    5
    -[% IF c("var/macos") %]
    
    6
    -# macosx-sdk-version
    
    7
    -read -d '' p << 'EOF' || true
    
    8
    -sub l {
    
    9
    -  ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
    
    10
    -}
    
    11
    -
    
    12
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/macos-sdk.yml');
    
    13
    -
    
    14
    -foreach my $t (keys %$d) {
    
    15
    -  foreach my $alias (@{l($d->{$t}{run}{'toolchain-alias'})}) {
    
    16
    -    if ($alias eq 'macosx64-sdk') {
    
    17
    -      if ($t =~ m/^macosx64-sdk-(.*)/) {
    
    18
    -        print "$1";
    
    19
    -        exit 0;
    
    20
    -      }
    
    21
    -    }
    
    22
    -  }
    
    23
    -}
    
    24
    -
    
    25
    -exit 1;
    
    26
    -EOF
    
    27
    -needed=$(perl -MYAML::XS -e "$p")
    
    28
    -current='[% pc("macosx-toolchain", "version") %]'
    
    29
    -check_update_needed macos-sdk-version "$needed" "$current"
    
    30
    -
    
    31
    -# macos-sdk-sha512sum
    
    32
    -read -d '' p << 'EOF' || true
    
    33
    -sub l {
    
    34
    -  ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
    
    35
    -}
    
    36
    -
    
    37
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/macos-sdk.yml');
    
    38
    -
    
    39
    -foreach my $t (keys %$d) {
    
    40
    -  foreach my $alias (@{l($d->{$t}{run}{'toolchain-alias'})}) {
    
    41
    -    if ($alias eq 'macosx64-sdk') {
    
    42
    -      if ($t =~ m/^macosx64-sdk-(.*)/) {
    
    43
    -        print $d->{$t}{run}{'arguments'}[1];
    
    44
    -        exit 0;
    
    45
    -      }
    
    46
    -    }
    
    47
    -  }
    
    48
    -}
    
    49
    -
    
    50
    -exit 1;
    
    51
    -EOF
    
    52
    -needed=$(perl -MYAML::XS -e "$p")
    
    53
    -current='[% pc("macosx-toolchain", "var/sdk_sha512sum") %]'
    
    54
    -check_update_needed macos-sdk-sha512sum "$needed" "$current"
    
    55
    -
    
    56
    -# cctools
    
    57
    -read -d '' p << 'EOF' || true
    
    58
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    59
    -print $d->{'cctools-port'}{fetch}{revision};
    
    60
    -EOF
    
    61
    -needed=$(perl -MYAML::XS -e "$p")
    
    62
    -current='[% pc("cctools", "git_hash") %]'
    
    63
    -check_update_needed cctools "$needed" "$current"
    
    64
    -
    
    65
    -# libdispatch
    
    66
    -read -d '' p << 'EOF' || true
    
    67
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    68
    -print $d->{'libdispatch'}{fetch}{revision};
    
    69
    -EOF
    
    70
    -needed=$(perl -MYAML::XS -e "$p")
    
    71
    -current='[% pc("libdispatch", "git_hash") %]'
    
    72
    -check_update_needed libtapi "$needed" "$current"
    
    73
    -
    
    74
    -# libtapi
    
    75
    -read -d '' p << 'EOF' || true
    
    76
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    77
    -print $d->{'libtapi'}{fetch}{revision};
    
    78
    -EOF
    
    79
    -needed=$(perl -MYAML::XS -e "$p")
    
    80
    -current='[% pc("libtapi", "git_hash") %]'
    
    81
    -check_update_needed libtapi "$needed" "$current"
    
    82
    -
    
    83
    -# End of macOS checks
    
    84
    -[% END -%]
    
    85
    -
    
    86
    -
    
    87
    -[% IF c("var/windows") %]
    
    88
    -# mingw-w64-clang
    
    89
    -read -d '' p << 'EOF' || true
    
    90
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    91
    -print $d->{'mingw-w64'}{fetch}{revision};
    
    92
    -EOF
    
    93
    -needed=$(perl -MYAML::XS -e "$p")
    
    94
    -current='[% pc("mingw-w64-clang", "git_hash") %]'
    
    95
    -check_update_needed mingw-w64-clang "$needed" "$current"
    
    96
    -
    
    97
    -
    
    98
    -# fxc2
    
    99
    -read -d '' p << 'EOF' || true
    
    100
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    101
    -print $d->{fxc2}{fetch}{revision};
    
    102
    -EOF
    
    103
    -needed=$(perl -MYAML::XS -e "$p")
    
    104
    -current='[% pc("fxc2", "git_hash") %]'
    
    105
    -check_update_needed fxc2 "$needed" "$current"
    
    106
    -
    
    107
    -read -d '' p << 'EOF' || true
    
    108
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    109
    -my $url = $d->{'windows-rs'}{fetch}{url};
    
    110
    -if ($url =~ m|crates/windows/(.+)/download$|) {
    
    111
    -  print $1;
    
    112
    -  exit 0;
    
    113
    -}
    
    114
    -print STDERR "windows-rs url not found ($url)\\n";
    
    115
    -exit 1
    
    116
    -EOF
    
    117
    -needed=$(perl -MYAML::XS -e "$p")
    
    118
    -current='[% c("var/windows_rs_version") %]'
    
    119
    -check_update_needed windows-rs "$needed" "$current"
    
    120
    -
    
    121
    -read -d '' p << 'EOF' || true
    
    122
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    123
    -my $sha256 = $d->{'windows-rs'}{fetch}{sha256};
    
    124
    -exit 1 unless $sha256;
    
    125
    -print $sha256;
    
    126
    -EOF
    
    127
    -needed=$(perl -MYAML::XS -e "$p")
    
    128
    -current='[% c("var/windows_rs_sha256sum") %]'
    
    129
    -check_update_needed windows-rs-sha256sum "$needed" "$current"
    
    130
    -
    
    131
    -# windows-app-sdk
    
    132
    -read -d '' p << 'EOF' || true
    
    133
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    134
    -my $sha256 = $d->{'windowsappsdk-redist'}{fetch}{sha256};
    
    135
    -exit 1 unless $sha256;
    
    136
    -print $sha256;
    
    137
    -EOF
    
    138
    -needed=$(perl -MYAML::XS -e "$p")
    
    139
    -current='[% pc("windows-app-sdk", "var/windowsappsdk_sha256sum") %]'
    
    140
    -check_update_needed windowsappsdk_sha256sum "$needed" "$current"
    
    141
    -
    
    142
    -# End of Windows checks
    
    143
    -[% END -%]
    
    144
    -
    
    145
    -
    
    146
    -[% IF c("var/rlbox") %]
    
    147
    -# wasi-sdk
    
    148
    -read -d '' p << 'EOF' || true
    
    149
    -my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    150
    -print $d->{'wasi-sdk'}{fetch}{revision};
    
    151
    -EOF
    
    152
    -needed=$(perl -MYAML::XS -e "$p")
    
    153
    -current='[% pc("wasi-sysroot", "git_hash") %]'
    
    154
    -check_update_needed wasi-sdk "$needed" "$current"
    
    155
    -
    
    156
    -# End RLBox
    
    157
    -[% END -%]

  • projects/geckoview/config
    ... ... @@ -155,13 +155,6 @@ steps:
    155 155
             name: bundletool
    
    156 156
             sha256sum: '[% c("var/bundletool_hash") %]'
    
    157 157
     
    
    158
    -  list_toolchain_updates:
    
    159
    -    git_hash: '[% pc("firefox", "var/upstream_firefox_commit") %]'
    
    160
    -    tag_gpg_id: 0
    
    161
    -    input_files: []
    
    162
    -    container:
    
    163
    -      use_container: 0
    
    164
    -
    
    165 158
     input_files:
    
    166 159
       - project: container-image
    
    167 160
       - filename: 'mozconfig'
    

  • projects/geckoview/list_toolchain_updates_checks deleted
    1
    -#!/bin/bash
    
    2
    -
    
    3
    -[% INCLUDE 'list_toolchain_updates-common-firefox-geckoview' %]
    
    4
    -
    
    5
    -# ndk version
    
    6
    -read -d '' p << 'EOF' || true
    
    7
    -if (m/^\\s*NDK_VERSION\\s*=\\s*"(.+)"/) {
    
    8
    -  print $1;
    
    9
    -  exit;
    
    10
    -}
    
    11
    -EOF
    
    12
    -needed=$(cat python/mozboot/mozboot/android.py | perl -ne "$p")
    
    13
    -current='r[% pc("android-ndk", "var/release") %]'
    
    14
    -check_update_needed ndk_release_name "$needed" "$current"
    
    15
    -
    
    16
    -
    
    17
    -# build_tools
    
    18
    -read -d '' p << 'EOF' || true
    
    19
    -if (m/build-tools;(.+)$/) {
    
    20
    -  print $1;
    
    21
    -  exit;
    
    22
    -}
    
    23
    -EOF
    
    24
    -needed=$(cat python/mozboot/mozboot/android-packages.txt | perl -ne "$p")
    
    25
    -current='[% pc("android-sdk", "version") %]'
    
    26
    -check_update_needed build_tools "$needed" "$current"
    
    27
    -
    
    28
    -
    
    29
    -# cmdline-tools
    
    30
    -read -d '' p << 'EOF' || true
    
    31
    -my $v, $s;
    
    32
    -while (<>) {
    
    33
    -  if (m/^\\s*CMDLINE_TOOLS_VERSION_STRING\\s*=\\s*"(.+)"/) {
    
    34
    -    $s = $1;
    
    35
    -  }
    
    36
    -  if (m/^\\s*CMDLINE_TOOLS_VERSION\\s*=\\s*"(.+)"/) {
    
    37
    -    $v = $1;
    
    38
    -  }
    
    39
    -  if ($v && $s) {
    
    40
    -    print "$s-$v";
    
    41
    -    exit;
    
    42
    -  }
    
    43
    -}
    
    44
    -EOF
    
    45
    -needed=$(cat python/mozboot/mozboot/android.py | perl -e "$p")
    
    46
    -current='[% pc("android-sdk", "var/commandlinetools_version_string") %]-[% pc("android-sdk", "var/commandlinetools_version") %]'
    
    47
    -check_update_needed cmdline-tools "$needed" "$current"
    
    48
    -
    
    49
    -
    
    50
    -# min-android
    
    51
    -read -d '' p << 'EOF' || true
    
    52
    -use Path::Tiny;
    
    53
    -my $f;
    
    54
    -foreach (path('build/moz.configure/android-ndk.configure')->lines_utf8) {
    
    55
    -  if ($_ eq "def min_android_version():\\n") {
    
    56
    -    $f = $_;
    
    57
    -    next;
    
    58
    -  } else {
    
    59
    -    next unless $f;
    
    60
    -  }
    
    61
    -  m/return "([0-9]+)"/;
    
    62
    -  if ($1) {
    
    63
    -    print $1;
    
    64
    -    exit;
    
    65
    -  }
    
    66
    -}
    
    67
    -EOF
    
    68
    -needed=$(perl -e "$p")
    
    69
    -current='[% c("var/android_min_api") %]'
    
    70
    -check_update_needed min-android "$needed" "$current"
    
    71
    -
    
    72
    -
    
    73
    -# gradle
    
    74
    -read -d '' p << 'EOF' || true
    
    75
    -if (m{distributionUrl=https\\\\://services.gradle.org/distributions/gradle-(.*)-(bin|all).zip}) {
    
    76
    -  print $1;
    
    77
    -  exit;
    
    78
    -}
    
    79
    -EOF
    
    80
    -needed=$(cat gradle/wrapper/gradle-wrapper.properties | perl -ne "$p")
    
    81
    -current='[% c("var/gradle_version") %]'
    
    82
    -check_update_needed gradle "$needed" "$current"
    
    83
    -
    
    84
    -
    
    85
    -# bundletool
    
    86
    -read -d '' p << 'EOF' || true
    
    87
    -if (m{^BUNDLETOOL_VERSION\\s*=\\s*"(.+)"}) {
    
    88
    -  print $1;
    
    89
    -  exit;
    
    90
    -}
    
    91
    -EOF
    
    92
    -needed=$(cat python/mozboot/mozboot/android.py | perl -ne "$p")
    
    93
    -current='[% c("var/bundletool_version") %]'
    
    94
    -check_update_needed bundletool "$needed" "$current"
    
    95
    -
    
    96
    -
    
    97
    -# glean version
    
    98
    -read -d '' p << 'EOF' || true
    
    99
    -if (m{^glean\\s*=\\s*"(.+)"}) {
    
    100
    -  print $1;
    
    101
    -  exit;
    
    102
    -}
    
    103
    -EOF
    
    104
    -needed=$(cat gradle/libs.versions.toml | perl -ne "$p")
    
    105
    -current='[% pc("glean", "version") %]'
    
    106
    -check_update_needed glean "$needed" "$current"
    
    107
    -
    
    108
    -
    
    109
    -# glean-parser version
    
    110
    -read -d '' p << 'EOF' || true
    
    111
    -if (m{^glean_parser-(.+)\.dist-info}) {
    
    112
    -  print $1;
    
    113
    -  exit;
    
    114
    -}
    
    115
    -EOF
    
    116
    -needed=$(ls third_party/python/glean_parser | perl -ne "$p")
    
    117
    -current='[% pc("glean-parser", "version") %]'
    
    118
    -check_update_needed glean-parser "$needed" "$current"
    
    119
    -
    
    120
    -# terser
    
    121
    -
    
    122
    -needed=$(jq -r '.dependencies.terser' tools/terser/package.json)
    
    123
    -current='[% pc("terser", "version") %]'
    
    124
    -check_update_needed terser "$needed" "$current"

  • projects/python/config
    ... ... @@ -19,6 +19,17 @@ var:
    19 19
         tar -C /var/tmp/dist -xf $rootdir/[% c("python_tarfile") %]
    
    20 20
         export PATH=/var/tmp/dist/python/bin:"$PATH"
    
    21 21
     
    
    22
    +  # This variable is used by tools/toolchain-updates/extract-firefox-versions-infos
    
    23
    +  # to notice when the minimum python version required by firefox is
    
    24
    +  # changing, so that we can review if we need to update python.
    
    25
    +  #
    
    26
    +  # Currently this custom python build is used on Linux only.
    
    27
    +  #
    
    28
    +  # Debian includes the following python versions:
    
    29
    +  # bookworm (used for Android): 3.11.2
    
    30
    +  # trixie (windows, macos): 3.13.5
    
    31
    +  firefox_minimum_python_version: 3.9
    
    32
    +
    
    22 33
     input_files:
    
    23 34
       - project: container-image
    
    24 35
       - name: python
    

  • rbm.conf
    ... ... @@ -14,10 +14,6 @@ container:
    14 14
         build: 1
    
    15 15
     
    
    16 16
     steps:
    
    17
    -  list_toolchain_updates:
    
    18
    -    build_log: '-'
    
    19
    -    list_toolchain_updates: '[% INCLUDE list_toolchain_updates %]'
    
    20
    -
    
    21 17
       cargo_vendor:
    
    22 18
         filename: '[% project %]-vendor-[% c("version") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
    
    23 19
         output_dir: "out/[% project %]/cargo_vendor"
    

  • tools/list_toolchain_updates deleted
    1
    -#!/bin/bash
    
    2
    -#
    
    3
    -# This script runs all `make list_toolchain_updates-*` commands, save
    
    4
    -# their outputs to a file (tmp/toolchain_updates.txt) and print it
    
    5
    -# (again) at the end.
    
    6
    -#
    
    7
    -set -e
    
    8
    -
    
    9
    -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
    
    10
    -cd "$script_dir"/..
    
    11
    -
    
    12
    -output_file="$script_dir/../tmp/toolchain_updates.txt"
    
    13
    -
    
    14
    -rm -f "$output_file"
    
    15
    -
    
    16
    -function list_toolchain_updates {
    
    17
    -  for cmd in \
    
    18
    -    list_toolchain_updates-firefox-linux \
    
    19
    -    list_toolchain_updates-firefox-windows \
    
    20
    -    list_toolchain_updates-firefox-macos \
    
    21
    -    list_toolchain_updates-application-services \
    
    22
    -    list_toolchain_updates-geckoview
    
    23
    -  do
    
    24
    -    line_title="** $cmd **"
    
    25
    -    line_size=$(echo "$line_title" | wc -m)
    
    26
    -    line_line=$(perl -e 'print "*" x ('$line_size' - 1), "\n"')
    
    27
    -    echo "$line_line"; echo "$line_title"; echo "$line_line"; echo
    
    28
    -    make -s $cmd
    
    29
    -    echo; echo; echo "$line_line"; echo "$line_line"; echo; echo
    
    30
    -  done
    
    31
    -}
    
    32
    -
    
    33
    -list_toolchain_updates | tee -a "$output_file"
    
    34
    -
    
    35
    -echo "See also tmp/toolchain_updates.txt"

  • tools/toolchain-updates/ExtractVersionsInfos.pm
    1
    +#!/usr/bin/perl -w
    
    2
    +package ExtractVersionsInfos;
    
    3
    +
    
    4
    +use Exporter;
    
    5
    +our @ISA = qw/Exporter/;
    
    6
    +our @EXPORT = qw/*version_infos *rbm_os_target set_version_info
    
    7
    +                 get_version_info set_rbm_info set_error as_array/;
    
    8
    +
    
    9
    +our %version_infos;
    
    10
    +
    
    11
    +our %rbm_os_target = (
    
    12
    +  linux => 'torbrowser-linux-x86_64',
    
    13
    +  windows => 'torbrowser-windows-x86_64',
    
    14
    +  macos => 'torbrowser-macos-aarch64',
    
    15
    +  android => 'torbrowser-android-aarch64',
    
    16
    +);
    
    17
    +
    
    18
    +sub set_version_info {
    
    19
    +  my ($name, $value) = @_;
    
    20
    +  $version_infos{$name}->{expected_value} = $value;
    
    21
    +}
    
    22
    +
    
    23
    +sub get_version_info {
    
    24
    +  return $version_infos{$_[0]}->{expected_value};
    
    25
    +}
    
    26
    +
    
    27
    +sub set_rbm_info {
    
    28
    +  my ($name, $rbm_info) = @_;
    
    29
    +  $version_infos{$name}->{rbm_info} = $rbm_info;
    
    30
    +}
    
    31
    +
    
    32
    +sub set_error {
    
    33
    +  $version_infos{$_[0]}->{error} = 1;
    
    34
    +}
    
    35
    +
    
    36
    +sub as_array {
    
    37
    +  return [] unless defined $_[0];
    
    38
    +  return ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
    
    39
    +}
    
    40
    +
    
    41
    +1;

  • tools/toolchain-updates/check-versions
    1
    +#!/usr/bin/perl -w
    
    2
    +#
    
    3
    +# This script takes one or more json file as command line arguments, as
    
    4
    +# created by the `extract-*-versions-infos` files. For each component
    
    5
    +# defined in the json this script checks the expected value and compares
    
    6
    +# it with the current value in the rbm config. It then lists all
    
    7
    +# components that are up-to-date, components that need an update, and
    
    8
    +# components where there was an error (error when extracting the value
    
    9
    +# from the sources tree, or getting the value from the rbm config).
    
    10
    +
    
    11
    +use strict;
    
    12
    +
    
    13
    +use English;
    
    14
    +use FindBin;
    
    15
    +use YAML::XS qw(LoadFile);
    
    16
    +use JSON qw/decode_json/;
    
    17
    +use Path::Tiny;
    
    18
    +use Capture::Tiny qw(capture);
    
    19
    +
    
    20
    +my @base_targets = qw/nightly/;
    
    21
    +my @default_targets = qw/torbrowser-linux-x86_64/;
    
    22
    +my $rbm = "$FindBin::Bin/../../rbm/rbm";
    
    23
    +
    
    24
    +sub exit_error {
    
    25
    +  print STDERR "Error: ", $_[0], "\n";
    
    26
    +  exit (exists $_[1] ? $_[1] : 1);
    
    27
    +}
    
    28
    +
    
    29
    +sub capture_exec {
    
    30
    +  my @cmd = @_;
    
    31
    +  my ($stdout, $stderr, $exit) = capture {
    
    32
    +    system(@cmd);
    
    33
    +  };
    
    34
    +  return ($stdout, $stderr, $exit == 0, $exit) if wantarray();
    
    35
    +  return $stdout;
    
    36
    +}
    
    37
    +
    
    38
    +if (!@ARGV) {
    
    39
    +  exit_error "usage: $0 <json-file...>";
    
    40
    +}
    
    41
    +
    
    42
    +my %version_infos;
    
    43
    +foreach my $input_file (@ARGV) {
    
    44
    +  my $infos = decode_json path($input_file)->slurp_utf8;
    
    45
    +  exit_error "Error reading $input_file" unless $infos;
    
    46
    +  %version_infos = ( %version_infos, %$infos );
    
    47
    +}
    
    48
    +
    
    49
    +my %component_need_update;
    
    50
    +my %component_ok;
    
    51
    +my %component_error_extract;
    
    52
    +my %component_error_rbm;
    
    53
    +
    
    54
    +foreach my $component (keys %version_infos) {
    
    55
    +  print "Checking $component\n";
    
    56
    +  my $rbm_info = $version_infos{$component}{rbm_info};
    
    57
    +  my @targets = ( @base_targets,
    
    58
    +    $rbm_info->{targets} ? @{$rbm_info->{targets}} : @default_targets );
    
    59
    +  @targets = map { ('--target', $_ ) } @targets;
    
    60
    +  my @cmd = ($rbm, 'showconf', $rbm_info->{project}, $rbm_info->{option},
    
    61
    +    @targets);
    
    62
    +  if ($version_infos{$component}{error}) {
    
    63
    +    $component_error_extract{$component} = 1;
    
    64
    +    next;
    
    65
    +  }
    
    66
    +  my ($stdout, $stderr, $success) = capture_exec(@cmd);
    
    67
    +  if (!$success) {
    
    68
    +    $component_error_rbm{$component} = $stderr;
    
    69
    +    next;
    
    70
    +  }
    
    71
    +  chomp $stdout;
    
    72
    +  if ($stdout eq $version_infos{$component}{expected_value}) {
    
    73
    +    $component_ok{$component} = $stdout;
    
    74
    +    next;
    
    75
    +  }
    
    76
    +  $component_need_update{$component}{expected_value} =
    
    77
    +        $version_infos{$component}->{expected_value};
    
    78
    +  $component_need_update{$component}{current_value} = $stdout;
    
    79
    +}
    
    80
    +
    
    81
    +if (!%component_need_update && !%component_error_extract && !%component_error_rbm) {
    
    82
    +  print "Everything is up-to-date\n";
    
    83
    +  exit 0;
    
    84
    +}
    
    85
    +
    
    86
    +if (%component_ok) {
    
    87
    +  print "The following components are up-to-date:\n";
    
    88
    +  foreach my $component (sort keys %component_ok) {
    
    89
    +    print "- $component ($component_ok{$component})\n";
    
    90
    +  }
    
    91
    +  print "\n";
    
    92
    +}
    
    93
    +
    
    94
    +if (%component_error_extract) {
    
    95
    +  print "There was an error extracting the following components info from source tree:\n";
    
    96
    +  foreach my $component (sort keys %component_error_extract) {
    
    97
    +    print "- $component\n";
    
    98
    +  }
    
    99
    +  print "\n";
    
    100
    +}
    
    101
    +
    
    102
    +if (%component_error_rbm) {
    
    103
    +  print "There was an error extracting the following components from rbm config:\n";
    
    104
    +  foreach my $component (sort keys %component_error_rbm) {
    
    105
    +    print "- $component\n";
    
    106
    +  }
    
    107
    +  print "\n";
    
    108
    +}
    
    109
    +
    
    110
    +if (%component_need_update) {
    
    111
    +  print "The following components need an update:\n";
    
    112
    +  foreach my $component (sort keys %component_need_update) {
    
    113
    +    print "- $component\n";
    
    114
    +    print "    current: $component_need_update{$component}{current_value}\n";
    
    115
    +    print "    expected: $component_need_update{$component}{expected_value}\n";
    
    116
    +  }
    
    117
    +}

  • tools/toolchain-updates/extract-application-services-versions-infos
    1
    +#!/usr/bin/perl -w
    
    2
    +#
    
    3
    +# This script extract version informations from an application-services
    
    4
    +# tree. It will output on stdout a json file containing version
    
    5
    +# information found in the firefox tree. The json file also include
    
    6
    +# information about which rbm project, option and targets can be used
    
    7
    +# to query (and later update) the current value in `tor-browser-build`
    
    8
    +# (this part is done by the `check-versions` script).
    
    9
    +#
    
    10
    +# This script should be run from the root of an application-services
    
    11
    +# tree, without argument.
    
    12
    +
    
    13
    +use strict;
    
    14
    +use English;
    
    15
    +use YAML::XS qw(LoadFile);
    
    16
    +use Path::Tiny;
    
    17
    +use JSON qw/decode_json/;
    
    18
    +use FindBin;
    
    19
    +use lib $FindBin::Bin;
    
    20
    +use ExtractVersionsInfos;
    
    21
    +
    
    22
    +## compileSdkVersion
    
    23
    +sub get_compilesdk_info {
    
    24
    +  my $component = 'appservices/android-sdk';
    
    25
    +  set_rbm_info($component, {
    
    26
    +      project => 'android-sdk',
    
    27
    +      option  => 'version',
    
    28
    +    });
    
    29
    +  my @lines = path('build.gradle')->lines_utf8;
    
    30
    +  my ($major, $minor);
    
    31
    +  foreach my $line (@lines) {
    
    32
    +    if ($line =~ m/^\s*MINIMUM_MINOR_VERSION = ([0-9]+)/) {
    
    33
    +      set_version_info('python', "3.$1");
    
    34
    +      return;
    
    35
    +    }
    
    36
    +    if ($line =~ m/^\s*compileSdkMajorVersion:\s([^"]*),/) {
    
    37
    +      $major = $1;
    
    38
    +    } elsif ($line =~ m/^\s*compileSdkMinorVersion:\s([^"]*),/) {
    
    39
    +      $minor = $1;
    
    40
    +    }
    
    41
    +    if ($major && $minor) {
    
    42
    +      set_version_info($component, "$major.$minor.0");
    
    43
    +      return;
    
    44
    +    }
    
    45
    +  }
    
    46
    +  set_error($component);
    
    47
    +}
    
    48
    +
    
    49
    +## gradle
    
    50
    +sub get_gradle_info {
    
    51
    +  my $component = 'appservices/gradle';
    
    52
    +  set_rbm_info($component, {
    
    53
    +      project => 'application-services',
    
    54
    +      option  => 'var/gradle_version',
    
    55
    +    });
    
    56
    +  my @lines = path('gradle/wrapper/gradle-wrapper.properties')->lines_utf8;
    
    57
    +  foreach my $line (@lines) {
    
    58
    +    if ($line =~ m|distributionUrl=https\\://services.gradle.org/distributions/gradle-(.*)-.*.zip|) {
    
    59
    +      set_version_info($component, $1);
    
    60
    +      return;
    
    61
    +    }
    
    62
    +  }
    
    63
    +  set_error($component);
    
    64
    +}
    
    65
    +
    
    66
    +# nss-nspr
    
    67
    +sub get_nss_info {
    
    68
    +  my %component_option = (
    
    69
    +    nss             => 'var/nss_version',
    
    70
    +    nspr            => 'var/nspr_version',
    
    71
    +    'nss-sha256sum' => 'var/nss_sha256sum',
    
    72
    +  );
    
    73
    +  foreach my $component (keys %component_option) {
    
    74
    +    set_rbm_info($component, {
    
    75
    +        project => 'application-services',
    
    76
    +        option  => $component_option{$component},
    
    77
    +      });
    
    78
    +  }
    
    79
    +  my ($nss, $sha256sum);
    
    80
    +  my @lines = path('libs/build-all.sh')->lines_utf8;
    
    81
    +  foreach my $line (@lines) {
    
    82
    +    if ($line =~ m/NSS_ARCHIVE="nss-(.*)-with-nspr-(.*)\.tar\.gz"/) {
    
    83
    +      set_version_info('nss', $1);
    
    84
    +      set_version_info('nspr', $2);
    
    85
    +      $nss = 1;
    
    86
    +    }
    
    87
    +    if ($line =~ m/NSS_SHA256="([^"]+)"/) {
    
    88
    +      set_version_info('nss-sha256sum', $1);
    
    89
    +      $sha256sum = 1;
    
    90
    +    }
    
    91
    +    return if ($nss && $sha256sum);
    
    92
    +  }
    
    93
    +  set_error('nss') unless $nss;
    
    94
    +  set_error('nspr') unless $nss;
    
    95
    +  set_error('nss-sha256sum') unless $sha256sum;
    
    96
    +}
    
    97
    +
    
    98
    +## uniffi
    
    99
    +sub get_uniffi_info {
    
    100
    +  my $component = 'uniffi';
    
    101
    +  set_rbm_info($component, {
    
    102
    +      project => 'uniffi-rs',
    
    103
    +      option  => 'version',
    
    104
    +    });
    
    105
    +  my @lines = path('components/autofill/Cargo.toml')->lines_utf8;
    
    106
    +  foreach my $line (@lines) {
    
    107
    +    if ($line =~ m/^\s*uniffi\s*=\s*\{[^}]*version\s*=\s*"([^"]*)"/) {
    
    108
    +      set_version_info($component, $1);
    
    109
    +      return;
    
    110
    +    }
    
    111
    +  }
    
    112
    +  set_error($component);
    
    113
    +}
    
    114
    +
    
    115
    +get_compilesdk_info;
    
    116
    +get_gradle_info;
    
    117
    +get_nss_info;
    
    118
    +get_uniffi_info;
    
    119
    +print JSON->new->utf8->canonical->pretty->encode(\%version_infos);

  • tools/toolchain-updates/extract-firefox-versions-infos
    1
    +#!/usr/bin/perl -w
    
    2
    +#
    
    3
    +# This script extracts version informations from a firefox tree. It will
    
    4
    +# output on stdout a json file containing version information found in
    
    5
    +# the firefox tree. The json file also include information about which
    
    6
    +# rbm project, option and targets can be used to query (and later update)
    
    7
    +# the current value in `tor-browser-build` (this part is done by the
    
    8
    +# `check-versions` script).
    
    9
    +#
    
    10
    +# This script should be run from the root of a firefox tree, without
    
    11
    +# argument.
    
    12
    +#
    
    13
    +#
    
    14
    +# == How to add extraction of a new version information ==
    
    15
    +#
    
    16
    +# - Copy the `get_glean_info` function (as an example of basic extraction
    
    17
    +#   function) and rename it with the name of the new component
    
    18
    +# - Add the new function to the list of functions being called, at the
    
    19
    +#   end of the file
    
    20
    +# - Update `$component` with the name of the component
    
    21
    +# - Update the `set_rbm_info` call with the rbm project, option and
    
    22
    +#   target (optional) used query the current version in `tor-browser-build`.
    
    23
    +# - Update the file path in the `my @lines = ...` line to the path in
    
    24
    +#   the source tree where the information can be found
    
    25
    +# - Update the regexp to match the line containing the information we
    
    26
    +#   want to extract. The part between parenthesis will be stored as `$1`,
    
    27
    +#   which we can use in the `set_version_info` call to save the
    
    28
    +#   information we extracted. If the information was not found,
    
    29
    +#   `set_error` is used to register an error.
    
    30
    +#
    
    31
    +# Alternatively it should be possible to write an additional script to
    
    32
    +# extract some informations from the sources, and output them in the
    
    33
    +# same json format as this script.
    
    34
    +
    
    35
    +use strict;
    
    36
    +use English;
    
    37
    +use YAML::XS qw(LoadFile);
    
    38
    +use Path::Tiny;
    
    39
    +use JSON qw/decode_json/;
    
    40
    +use FindBin;
    
    41
    +use lib $FindBin::Bin;
    
    42
    +use ExtractVersionsInfos;
    
    43
    +
    
    44
    +# taskcluster/kinds/toolchain/rust.yml
    
    45
    +#
    
    46
    +## Rust ##
    
    47
    +sub get_rust_info {
    
    48
    +  my $infos = YAML::XS::LoadFile('taskcluster/kinds/toolchain/rust.yml');
    
    49
    +  my %toolchain_aliases = (
    
    50
    +    linux   => 'linux64-rust',
    
    51
    +    windows => 'mingw32-rust',
    
    52
    +    macos   => 'linux64-rust-macos',
    
    53
    +  );
    
    54
    +  foreach my $os (keys %toolchain_aliases) {
    
    55
    +    TOOLCHAIN_ALIAS: foreach my $t (keys %$infos) {
    
    56
    +      next unless ref $infos->{$t}{run}{'toolchain-alias'} eq 'HASH';
    
    57
    +      my $talias = as_array($infos->{$t}{run}{'toolchain-alias'}{'by-project'}{default});
    
    58
    +      if (grep { $_ eq $toolchain_aliases{$os} } @$talias) {
    
    59
    +        my $channel;
    
    60
    +        foreach my $arg (@{$infos->{$t}{run}{arguments}}) {
    
    61
    +          if ($arg eq '--channel') {
    
    62
    +            $channel = 1;
    
    63
    +            next;
    
    64
    +          }
    
    65
    +          if ($channel) {
    
    66
    +            set_version_info("rust-$os", $arg);
    
    67
    +            last TOOLCHAIN_ALIAS;
    
    68
    +          }
    
    69
    +        }
    
    70
    +      }
    
    71
    +    }
    
    72
    +
    
    73
    +    set_error("rust-$os") unless get_version_info("rust-$os");
    
    74
    +    set_rbm_info("rust-$os", {
    
    75
    +        project => 'rust',
    
    76
    +        option  => 'version',
    
    77
    +        targets => [ $rbm_os_target{$os} ],
    
    78
    +      });
    
    79
    +  }
    
    80
    +}
    
    81
    +
    
    82
    +
    
    83
    +# taskcluster/kinds/toolchain/clang.yml
    
    84
    +#
    
    85
    +## clang ##
    
    86
    +sub get_clang_info {
    
    87
    +  my %toolchain_aliases = (
    
    88
    +    linux   => 'linux64-clang',
    
    89
    +    windows => 'linux64-clang-mingw-x64',
    
    90
    +    macos   => 'macosx64-clang',
    
    91
    +  );
    
    92
    +  my $infos = YAML::XS::LoadFile('taskcluster/kinds/toolchain/clang.yml');
    
    93
    +  OS: foreach my $os (keys %toolchain_aliases) {
    
    94
    +    my $clang_toolchain;
    
    95
    +    my $clang_fetch;
    
    96
    +    TOOLCHAIN: foreach my $t (keys %$infos) {
    
    97
    +      next unless ref $infos->{$t}{run}{'toolchain-alias'} eq 'HASH';
    
    98
    +      next unless $infos->{$t}{run}{'toolchain-alias'}{'by-project'}{default};
    
    99
    +      my $aliases = as_array($infos->{$t}{run}{'toolchain-alias'}{'by-project'}{default});
    
    100
    +      foreach my $alias (@$aliases) {
    
    101
    +        if ($alias eq $toolchain_aliases{$os}) {
    
    102
    +          foreach my $fetch (@{$infos->{$t}{fetches}{toolchain}}) {
    
    103
    +            $clang_toolchain = $fetch if $fetch =~ m/^.*-clang-.*/;
    
    104
    +          }
    
    105
    +          foreach my $fetch (@{$infos->{$t}{fetches}{fetch}}) {
    
    106
    +            $clang_fetch = $fetch if $fetch =~ m/^clang-.*/;
    
    107
    +          }
    
    108
    +          last TOOLCHAIN;
    
    109
    +        }
    
    110
    +      }
    
    111
    +    }
    
    112
    +
    
    113
    +    if (!$clang_toolchain && !$clang_fetch) {
    
    114
    +      print STDERR "Error: could not find clang toolchain for $toolchain_aliases{$os}\n";
    
    115
    +      set_error("clang-$os");
    
    116
    +      next OS;
    
    117
    +    }
    
    118
    +
    
    119
    +    if (!$clang_fetch) {
    
    120
    +      foreach my $fetch (@{$infos->{$clang_toolchain}{fetches}{fetch}}) {
    
    121
    +        $clang_fetch = $fetch if $fetch =~ m/^clang-.*/;
    
    122
    +      }
    
    123
    +    }
    
    124
    +
    
    125
    +    if (!$clang_fetch) {
    
    126
    +      print STDERR "Error: could not find clang fetch for $toolchain_aliases{$os}\n";
    
    127
    +      set_error("clang-$os");
    
    128
    +      next OS;
    
    129
    +    }
    
    130
    +
    
    131
    +    my $fetch = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    132
    +    set_version_info("clang-$os", $fetch->{$clang_fetch}{fetch}{revision});
    
    133
    +
    
    134
    +    set_rbm_info("clang-$os", {
    
    135
    +        project => 'llvm-project',
    
    136
    +        option  => 'git_hash',
    
    137
    +        targets => [ $rbm_os_target{$os} ],
    
    138
    +      });
    
    139
    +  }
    
    140
    +}
    
    141
    +
    
    142
    +## cbindgen
    
    143
    +sub get_cbindgen_info {
    
    144
    +  my $fetch = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    145
    +  my $revision;
    
    146
    +  T: foreach my $t (keys %$fetch) {
    
    147
    +    next unless $fetch->{$t}{'fetch-alias'};
    
    148
    +    if ($fetch->{$t}{'fetch-alias'} eq 'cbindgen') {
    
    149
    +      $revision = $fetch->{$t}{fetch}{revision};
    
    150
    +      last T;
    
    151
    +    }
    
    152
    +  }
    
    153
    +  return 0 unless $revision;
    
    154
    +  set_version_info('cbindgen', $revision);
    
    155
    +  set_rbm_info('cbindgen', {
    
    156
    +      project => 'cbindgen',
    
    157
    +      option  => 'git_hash',
    
    158
    +    });
    
    159
    +}
    
    160
    +
    
    161
    +## nasm
    
    162
    +sub get_nasm_info {
    
    163
    +  my $nasm = YAML::XS::LoadFile('taskcluster/kinds/toolchain/nasm.yml');
    
    164
    +  my $fetch = $nasm->{'linux64-nasm'}{'fetches'}{'fetch'}[0];
    
    165
    +  return set_error('nasm') unless $fetch;
    
    166
    +  set_version_info('nasm', substr $fetch, 5);
    
    167
    +  set_rbm_info('nasm', {
    
    168
    +    project => 'nasm',
    
    169
    +    option  => 'version',
    
    170
    +  });
    
    171
    +}
    
    172
    +
    
    173
    +## node
    
    174
    +sub get_node_info {
    
    175
    +  my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/node.yml');
    
    176
    +  my $node_toolchain;
    
    177
    +  T: foreach my $t (keys %$d) {
    
    178
    +    foreach my $alias (@{as_array($d->{$t}{run}{'toolchain-alias'})}) {
    
    179
    +      if ($alias eq 'linux64-node') {
    
    180
    +        foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
    
    181
    +          if ($fetch =~ m/^nodejs-.*/) {
    
    182
    +            $node_toolchain = $fetch;
    
    183
    +            last T;
    
    184
    +          }
    
    185
    +        }
    
    186
    +      }
    
    187
    +    }
    
    188
    +  }
    
    189
    +
    
    190
    +  return set_error('node') unless $node_toolchain;
    
    191
    +
    
    192
    +  my $fetch = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    193
    +  my ($version) = $fetch->{$node_toolchain}{fetch}{url} =~ m|^https://nodejs.org/dist/v([^/]+)/|;
    
    194
    +  return set_error('node') unless $version;
    
    195
    +  set_version_info('node', $version);
    
    196
    +  set_rbm_info('node', {
    
    197
    +    project => 'node',
    
    198
    +    option  => 'version',
    
    199
    +  });
    
    200
    +}
    
    201
    +
    
    202
    +## Python
    
    203
    +sub get_python_info {
    
    204
    +  my $component = 'minimum_python';
    
    205
    +  set_rbm_info($component, {
    
    206
    +      project => 'python',
    
    207
    +      option  => 'var/firefox_minimum_python_version',
    
    208
    +    });
    
    209
    +  my @lines = path('python/mozboot/bin/bootstrap.py')->lines_utf8;
    
    210
    +  foreach my $line (@lines) {
    
    211
    +    if ($line =~ m/^\s*MINIMUM_MINOR_VERSION = ([0-9]+)/) {
    
    212
    +      set_version_info($component, "3.$1");
    
    213
    +      return;
    
    214
    +    }
    
    215
    +  }
    
    216
    +  set_error($component);
    
    217
    +}
    
    218
    +
    
    219
    +## binutils
    
    220
    +sub get_binutils_info {
    
    221
    +  my $component = 'binutils';
    
    222
    +  set_rbm_info($component, {
    
    223
    +      project => 'binutils',
    
    224
    +      option  => 'version',
    
    225
    +    });
    
    226
    +  my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/misc.yml');
    
    227
    +  my $f = $d->{'linux64-binutils'}{fetches}{fetch}[0];
    
    228
    +  my ($version) = $f =~ m|^binutils-([0-9\\.]+)|;
    
    229
    +  return set_error($component) unless $version;
    
    230
    +  set_version_info($component, $version);
    
    231
    +}
    
    232
    +
    
    233
    +## macosx-sdk
    
    234
    +sub get_macosx_sdk_info {
    
    235
    +  set_rbm_info('macosx-sdk-version', {
    
    236
    +      project => 'macosx-toolchain',
    
    237
    +      option  => 'version',
    
    238
    +      targets => [ $rbm_os_target{macos} ],
    
    239
    +    });
    
    240
    +  set_rbm_info('macosx-sdk-sha512sum', {
    
    241
    +      project => 'macosx-toolchain',
    
    242
    +      option  => 'var/sdk_sha512sum',
    
    243
    +      targets => [ $rbm_os_target{macos} ],
    
    244
    +    });
    
    245
    +  my $d = YAML::XS::LoadFile('taskcluster/kinds/toolchain/macos-sdk.yml');
    
    246
    +
    
    247
    +  foreach my $t (keys %$d) {
    
    248
    +    foreach my $alias (@{as_array($d->{$t}{run}{'toolchain-alias'})}) {
    
    249
    +      if ($alias eq 'macosx64-sdk') {
    
    250
    +        if ($t =~ m/^macosx64-sdk-(.*)/) {
    
    251
    +          set_version_info('macosx-sdk-version', $1);
    
    252
    +          set_version_info('macosx-sdk-sha512sum', $d->{$t}{run}{'arguments'}[1]);
    
    253
    +          return;
    
    254
    +        }
    
    255
    +      }
    
    256
    +    }
    
    257
    +  }
    
    258
    +
    
    259
    +  set_error('macosx-sdk-version');
    
    260
    +  set_error('macosx-sdk-sha512sum');
    
    261
    +}
    
    262
    +
    
    263
    +## taskcluster/kinds/fetch/toolchains.yml
    
    264
    +sub get_toolchains_fetch_info {
    
    265
    +  my @projects = qw/cctools libdispatch libtapi mingw-w64-clang fxc2 wasi-sysroot/;
    
    266
    +  # projects which have a different name in toolchains.yml
    
    267
    +  my %toolchain_names = (
    
    268
    +    cctools           => 'cctools-port',
    
    269
    +    'wasi-sysroot'    => 'wasi-sdk',
    
    270
    +    'mingw-w64-clang' => 'mingw-w64',
    
    271
    +  );
    
    272
    +  # projects which have an different rbm option than git_hash
    
    273
    +  my %rbm_option = (
    
    274
    +    'windows-app-sdk' => 'var/windowsappsdk_sha256sum',
    
    275
    +  );
    
    276
    +  my $d = YAML::XS::LoadFile('taskcluster/kinds/fetch/toolchains.yml');
    
    277
    +  foreach my $name (@projects) {
    
    278
    +    set_rbm_info($name,
    
    279
    +      {
    
    280
    +        project => $name,
    
    281
    +        option  => ($rbm_option{$name} ? $rbm_option{$name} : 'git_hash'),
    
    282
    +      });
    
    283
    +    my $toolchain_name = $toolchain_names{$name} ? $toolchain_names{$name} : $name;
    
    284
    +    my $revision = $d->{$toolchain_name}{fetch}{revision};
    
    285
    +    if ($revision) {
    
    286
    +      set_version_info($name, $revision);
    
    287
    +    } else {
    
    288
    +      set_error($name);
    
    289
    +    }
    
    290
    +  }
    
    291
    +
    
    292
    +  set_rbm_info('windows-rs', {
    
    293
    +      project => 'firefox',
    
    294
    +      option  => 'var/windows_rs_version',
    
    295
    +    });
    
    296
    +  my $winrs_url = $d->{'windows-rs'}{fetch}{url};
    
    297
    +  if ($winrs_url =~ m|crates/windows/(.+)/download$|) {
    
    298
    +    set_version_info('windows-rs', $1);
    
    299
    +  } else {
    
    300
    +    set_error('windows-rs');
    
    301
    +  }
    
    302
    +
    
    303
    +  set_rbm_info('windows-rs-sha256sum', {
    
    304
    +      project => 'firefox',
    
    305
    +      option  => 'var/windows_rs_sha256sum',
    
    306
    +    });
    
    307
    +  my $winrs_sha256 = $d->{'windows-rs'}{fetch}{sha256};
    
    308
    +  if ($winrs_sha256) {
    
    309
    +    set_version_info('windows-rs-sha256sum', $winrs_sha256);
    
    310
    +  } else {
    
    311
    +    set_error('windows-rs-sha256sum');
    
    312
    +  }
    
    313
    +}
    
    314
    +
    
    315
    +## Extract infos from python/mozboot/mozboot/android.py
    
    316
    +sub get_mozboot_android_info {
    
    317
    +  my %component_project = (
    
    318
    +    ndk                             => 'android-ndk',
    
    319
    +    commandlinetools_version_string => 'android-sdk',
    
    320
    +    commandlinetools_version        => 'android-sdk',
    
    321
    +    bundletool                      => 'geckoview',
    
    322
    +  );
    
    323
    +  my %component_option = (
    
    324
    +    ndk                             => 'var/release',
    
    325
    +    commandlinetools_version_string => 'var/commandlinetools_version_string',
    
    326
    +    commandlinetools_version        => 'var/commandlinetools_version',
    
    327
    +    bundletool                      => 'var/bundletool_version',
    
    328
    +  );
    
    329
    +  my %component_NAME = (
    
    330
    +    ndk                             => 'NDK_VERSION',
    
    331
    +    commandlinetools_version_string => 'CMDLINE_TOOLS_VERSION_STRING',
    
    332
    +    commandlinetools_version        => 'CMDLINE_TOOLS_VERSION',
    
    333
    +    bundletool                      => 'BUNDLETOOL_VERSION',
    
    334
    +  );
    
    335
    +  foreach my $component (keys %component_project) {
    
    336
    +    set_rbm_info($component, {
    
    337
    +        project => $component_project{$component},
    
    338
    +        option  => $component_option{$component},
    
    339
    +        targets => [ $rbm_os_target{android} ],
    
    340
    +      });
    
    341
    +  }
    
    342
    +  my %versions;
    
    343
    +  my @lines = path('python/mozboot/mozboot/android.py')->lines_utf8;
    
    344
    +  foreach my $line (@lines) {
    
    345
    +    foreach my $component (keys %component_NAME) {
    
    346
    +      if ($line =~ m/^\s*$component_NAME{$component}\s*=\s*"(.+)"/) {
    
    347
    +        $versions{$component} = $1;
    
    348
    +      }
    
    349
    +    }
    
    350
    +  }
    
    351
    +  foreach my $component (keys %component_NAME) {
    
    352
    +    if ($versions{$component}) {
    
    353
    +      set_version_info($component, $versions{$component});
    
    354
    +    } else {
    
    355
    +      set_error($component);
    
    356
    +    }
    
    357
    +  }
    
    358
    +}
    
    359
    +
    
    360
    +sub get_build_tools_info {
    
    361
    +  my $component = 'build_tools';
    
    362
    +  set_rbm_info($component, {
    
    363
    +      project => 'android-sdk',
    
    364
    +      option  => 'version',
    
    365
    +      targets => [ $rbm_os_target{android} ],
    
    366
    +    });
    
    367
    +  my @lines = path('python/mozboot/mozboot/android-packages.txt')->lines_utf8;
    
    368
    +  foreach my $line (@lines) {
    
    369
    +    if ($line =~ m/build-tools;(.+)$/) {
    
    370
    +      set_version_info($component, $1);
    
    371
    +      return;
    
    372
    +    }
    
    373
    +  }
    
    374
    +  set_error($component);
    
    375
    +}
    
    376
    +
    
    377
    +sub get_min_android_info {
    
    378
    +  my $component = 'min-android';
    
    379
    +  set_rbm_info($component, {
    
    380
    +      project => 'geckoview',
    
    381
    +      option  => 'var/android_min_api',
    
    382
    +      targets => [ $rbm_os_target{android} ],
    
    383
    +    });
    
    384
    +  my @lines = path('build/moz.configure/android-ndk.configure')->lines_utf8;
    
    385
    +  my $f;
    
    386
    +  foreach my $line (@lines) {
    
    387
    +    if ($line eq "def min_android_version():\n") {
    
    388
    +      $f = $line;
    
    389
    +      next;
    
    390
    +    }
    
    391
    +    next unless $f;
    
    392
    +    if ($line =~ m/return "([0-9]+)"/) {
    
    393
    +      set_version_info($component, $1);
    
    394
    +      return;
    
    395
    +    }
    
    396
    +  }
    
    397
    +  set_error($component);
    
    398
    +}
    
    399
    +
    
    400
    +sub get_gradle_info {
    
    401
    +  my $component = 'geckoview/gradle';
    
    402
    +  set_rbm_info($component, {
    
    403
    +      project => 'geckoview',
    
    404
    +      option  => 'var/gradle_version',
    
    405
    +      targets => [ $rbm_os_target{android} ],
    
    406
    +    });
    
    407
    +  my @lines = path('gradle/wrapper/gradle-wrapper.properties')->lines_utf8;
    
    408
    +  foreach my $line (@lines) {
    
    409
    +    if ($line =~ m{distributionUrl=https\\://services.gradle.org/distributions/gradle-(.*)-(bin|all).zip}) {
    
    410
    +      set_version_info($component, $1);
    
    411
    +      return;
    
    412
    +    }
    
    413
    +  }
    
    414
    +  set_error($component);
    
    415
    +}
    
    416
    +
    
    417
    +sub get_glean_info {
    
    418
    +  my $component = 'glean';
    
    419
    +  set_rbm_info($component, {
    
    420
    +      project => 'glean',
    
    421
    +      option  => 'version',
    
    422
    +      targets => [ $rbm_os_target{android} ],
    
    423
    +    });
    
    424
    +  my @lines = path('gradle/libs.versions.toml')->lines_utf8;
    
    425
    +  foreach my $line (@lines) {
    
    426
    +    if ($line =~ m{^glean\s*=\s*"(.+)"}) {
    
    427
    +      set_version_info($component, $1);
    
    428
    +      return;
    
    429
    +    }
    
    430
    +  }
    
    431
    +  set_error($component);
    
    432
    +}
    
    433
    +
    
    434
    +sub get_glean_parser_info {
    
    435
    +  my $component = 'glean-parser';
    
    436
    +  set_rbm_info($component, {
    
    437
    +      project => 'glean-parser',
    
    438
    +      option  => 'version',
    
    439
    +      targets => [ $rbm_os_target{android} ],
    
    440
    +    });
    
    441
    +  my $files = path('third_party/python/glean_parser');
    
    442
    +  foreach my $file ($files->children) {
    
    443
    +    if ($file->basename =~ m{^glean_parser-(.+)\.dist-info}) {
    
    444
    +      set_version_info($component, $1);
    
    445
    +      return;
    
    446
    +    }
    
    447
    +  }
    
    448
    +  set_error($component);
    
    449
    +}
    
    450
    +
    
    451
    +sub get_terser_info {
    
    452
    +  my $component = 'terser';
    
    453
    +  set_rbm_info($component, {
    
    454
    +      project => 'terser',
    
    455
    +      option  => 'version',
    
    456
    +      targets => [ $rbm_os_target{android} ],
    
    457
    +    });
    
    458
    +  my $version_infos = decode_json path('tools/terser/package.json')->slurp_utf8;
    
    459
    +  if ($version_infos->{dependencies}{terser}) {
    
    460
    +    set_version_info($component, $version_infos->{dependencies}{terser});
    
    461
    +  } else {
    
    462
    +    set_error($component);
    
    463
    +  }
    
    464
    +}
    
    465
    +
    
    466
    +get_rust_info;
    
    467
    +get_clang_info;
    
    468
    +get_cbindgen_info;
    
    469
    +get_nasm_info;
    
    470
    +get_node_info;
    
    471
    +get_python_info;
    
    472
    +get_macosx_sdk_info;
    
    473
    +get_toolchains_fetch_info;
    
    474
    +get_mozboot_android_info;
    
    475
    +get_build_tools_info;
    
    476
    +get_min_android_info;
    
    477
    +get_gradle_info;
    
    478
    +get_glean_info;
    
    479
    +get_glean_parser_info;
    
    480
    +get_terser_info;
    
    481
    +print JSON->new->utf8->canonical->pretty->encode(\%version_infos);

  • tools/toolchain-updates/list-toolchain-updates
    1
    +#!/bin/bash
    
    2
    +#
    
    3
    +# Run this script to check which toolchain updates are needed.
    
    4
    +#
    
    5
    +# It can be run with `make list_toolchain_updates`.
    
    6
    +
    
    7
    +set -e
    
    8
    +
    
    9
    +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
    
    10
    +tbb_dir="$script_dir/../.."
    
    11
    +tmpdir=$(mktemp -d)
    
    12
    +trap "rm -Rf $tmpdir" EXIT
    
    13
    +
    
    14
    +firefox_infos="$tmpdir/firefox-infos.json"
    
    15
    +appservices_infos="$tmpdir/application-services-infos.json"
    
    16
    +
    
    17
    +echo "Extracting firefox versions infos"
    
    18
    +"$tbb_dir"/rbm/rbm showconf --target list_toolchain_updates --target torbrowser-linux-x86_64 \
    
    19
    +  firefox var/firefox_versions_infos > "$firefox_infos"
    
    20
    +
    
    21
    +echo "Extracting application-services versions infos"
    
    22
    +"$tbb_dir"/rbm/rbm showconf --target list_toolchain_updates --target torbrowser-android-aarch64 \
    
    23
    +  application-services var/application-services_versions_infos > "$appservices_infos"
    
    24
    +
    
    25
    +echo "Checking needed updates"
    
    26
    +"$script_dir"/check-versions "$firefox_infos" "$appservices_infos"