[tor-commits] [tor-browser-build/master] Bug 40395: Update how we check node version in list_toolchain_updates_checks

gk at torproject.org gk at torproject.org
Tue Dec 14 20:25:53 UTC 2021


commit f1f4381aaceb2c2c59097bd305ad0307a3dd84f7
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Fri Dec 10 12:42:01 2021 +0100

    Bug 40395: Update how we check node version in list_toolchain_updates_checks
---
 projects/firefox/list_toolchain_updates_checks   | 28 ++++++++++++++++++++----
 projects/geckoview/list_toolchain_updates_checks | 28 ++++++++++++++++++++----
 2 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/projects/firefox/list_toolchain_updates_checks b/projects/firefox/list_toolchain_updates_checks
index a308468..26ee3a0 100644
--- a/projects/firefox/list_toolchain_updates_checks
+++ b/projects/firefox/list_toolchain_updates_checks
@@ -89,12 +89,32 @@ check_update_needed clang "$needed" "$current"
 
 # node
 read -d '' p << 'EOF' || true
-if (m/^\\s*NODE_MIN_VERSION\\s*=\\s*StrictVersion\\("([^"]+)"\\)/) {
-  print $1;
-  exit;
+sub l {
+  ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
 }
+
+my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/node.yml');
+my $node_toolchain;
+T: foreach my $t (keys %$d) {
+  foreach my $alias (@{l($d->{$t}{run}{'toolchain-alias'})}) {
+    if ($alias eq 'linux64-node') {
+      foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
+        if ($fetch =~ m/^nodejs-.*/) {
+          $node_toolchain = $fetch;
+          last T;
+        }
+      }
+    }
+  }
+}
+
+exit 1 unless $node_toolchain;
+
+my $fetch = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
+my ($version) = $fetch->{$node_toolchain}{fetch}{url} =~ m|^https://nodejs.org/dist/v([^/]+)/|;
+print "$version\\n";
 EOF
-needed=$(cat python/mozbuild/mozbuild/nodeutil.py | perl -ne "$p")
+needed=$(perl -MYAML::XS -e "$p")
 current='[% pc("node", "version") %]'
 check_update_needed node "$needed" "$current"
 
diff --git a/projects/geckoview/list_toolchain_updates_checks b/projects/geckoview/list_toolchain_updates_checks
index f31fa51..fef9756 100644
--- a/projects/geckoview/list_toolchain_updates_checks
+++ b/projects/geckoview/list_toolchain_updates_checks
@@ -180,12 +180,32 @@ check_update_needed clang "$needed" "$current"
 
 # node
 read -d '' p << 'EOF' || true
-if (m/^\\s*NODE_MIN_VERSION\\s*=\\s*StrictVersion\\("([^"]+)"\\)/) {
-  print $1;
-  exit;
+sub l {
+  ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
 }
+
+my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/node.yml');
+my $node_toolchain;
+T: foreach my $t (keys %$d) {
+  foreach my $alias (@{l($d->{$t}{run}{'toolchain-alias'})}) {
+    if ($alias eq 'linux64-node') {
+      foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
+        if ($fetch =~ m/^nodejs-.*/) {
+          $node_toolchain = $fetch;
+          last T;
+        }
+      }
+    }
+  }
+}
+
+exit 1 unless $node_toolchain;
+
+my $fetch = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
+my ($version) = $fetch->{$node_toolchain}{fetch}{url} =~ m|^https://nodejs.org/dist/v([^/]+)/|;
+print "$version\\n";
 EOF
-needed=$(cat python/mozbuild/mozbuild/nodeutil.py | perl -ne "$p")
+needed=$(perl -MYAML::XS -e "$p")
 current='[% pc("node", "version") %]'
 check_update_needed node "$needed" "$current"
 





More information about the tor-commits mailing list