list_toolchain_updates_checks 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. #!/bin/bash
  2. # rust
  3. [% IF c("var/linux");
  4. SET toolchain_alias='linux64-rust';
  5. ELSIF c("var/windows");
  6. SET toolchain_alias='mingw32-rust';
  7. ELSIF c("var/osx");
  8. SET toolchain_alias='linux64-rust-macos';
  9. END; %]
  10. read -d '' p << 'EOF' || true
  11. my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/rust.yml');
  12. foreach my $t (keys %$d) {
  13. if ($d->{$t}{run}{'toolchain-alias'} eq '[% toolchain_alias %]') {
  14. my $channel;
  15. foreach my $arg (@{$d->{$t}{run}{arguments}}) {
  16. if ($arg eq '--channel') {
  17. $channel = 1;
  18. next;
  19. }
  20. if ($channel) {
  21. print $arg;
  22. exit;
  23. }
  24. }
  25. }
  26. }
  27. EOF
  28. needed=$(perl -MYAML::XS -e "$p")
  29. current='[% pc("rust", "version") %]'
  30. check_update_needed rust "$needed" "$current"
  31. # cbindgen
  32. read -d '' p << 'EOF' || true
  33. if (m/^\\s*cbindgen_min_version\\s*=\\s*Version\\("([^"]+)"\\)/) {
  34. print $1;
  35. exit;
  36. }
  37. EOF
  38. needed=$(cat build/moz.configure/bindgen.configure | perl -ne "$p")
  39. current='[% pc("cbindgen", "version") %]'
  40. check_update_needed cbindgen "$needed" "$current"
  41. # nasm
  42. read -d '' p << 'EOF' || true
  43. if (m/^\\s*MODERN_NASM_VERSION\\s*=\\s*LooseVersion\\("([^"]+)"\\)/) {
  44. print $1;
  45. exit;
  46. }
  47. EOF
  48. needed=$(cat python/mozboot/mozboot/base.py | perl -ne "$p")
  49. current='2.14'
  50. check_update_needed nasm "$needed" "$current"
  51. # clang
  52. [% IF c("var/linux");
  53. SET toolchain_alias='linux64-clang';
  54. ELSIF c("var/windows");
  55. SET toolchain_alias='linux64-clang-mingw-x64';
  56. ELSIF c("var/osx");
  57. SET toolchain_alias='macosx64-clang';
  58. END; %]
  59. read -d '' p << 'EOF' || true
  60. my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/clang.yml');
  61. my $clang_toolchain;
  62. foreach my $t (keys %$d) {
  63. if ($d->{$t}{run}{'toolchain-alias'} eq '[% toolchain_alias %]') {
  64. foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
  65. $clang_toolchain = $fetch if $fetch =~ m/^clang-.*/;
  66. }
  67. last;
  68. }
  69. }
  70. if (!$clang_toolchain) {
  71. print STDERR "Error: could not find clang toolchain";
  72. exit 1;
  73. }
  74. my $fetch = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  75. print $fetch->{$clang_toolchain}{fetch}{revision};
  76. EOF
  77. needed=$(perl -MYAML::XS -e "$p")
  78. current='[% pc("llvm-project", "git_hash") %]'
  79. check_update_needed clang "$needed" "$current"
  80. # node
  81. read -d '' p << 'EOF' || true
  82. sub l {
  83. ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ];
  84. }
  85. my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/node.yml');
  86. my $node_toolchain;
  87. T: foreach my $t (keys %$d) {
  88. foreach my $alias (@{l($d->{$t}{run}{'toolchain-alias'})}) {
  89. if ($alias eq 'linux64-node') {
  90. foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
  91. if ($fetch =~ m/^nodejs-.*/) {
  92. $node_toolchain = $fetch;
  93. last T;
  94. }
  95. }
  96. }
  97. }
  98. }
  99. exit 1 unless $node_toolchain;
  100. my $fetch = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  101. my ($version) = $fetch->{$node_toolchain}{fetch}{url} =~ m|^https://nodejs.org/dist/v([^/]+)/|;
  102. print "$version\\n";
  103. EOF
  104. needed=$(perl -MYAML::XS -e "$p")
  105. current='[% pc("node", "version") %]'
  106. check_update_needed node "$needed" "$current"
  107. # python
  108. read -d '' p << 'EOF' || true
  109. if (m/find_python3_executable\\(min_version\\s*=\\s*"([^"]+)"/) {
  110. print $1;
  111. exit;
  112. }
  113. EOF
  114. needed=$(cat build/moz.configure/init.configure | perl -ne "$p")
  115. current=3.6.0
  116. check_update_needed python "$needed" "$current"
  117. [% IF c("var/osx") %]
  118. # macosx-sdk
  119. read -d '' p << 'EOF' || true
  120. my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/clang.yml');
  121. my $clang_toolchain;
  122. foreach my $t (keys %$d) {
  123. if ($d->{$t}{run}{'toolchain-alias'} eq 'macosx64-clang') {
  124. foreach my $toolchain (@{$d->{$t}{fetches}{toolchain}}) {
  125. if ($toolchain =~ m/^macosx64-sdk-(.+)$/) {
  126. print $1;
  127. exit;
  128. }
  129. }
  130. last;
  131. }
  132. }
  133. EOF
  134. needed=$(perl -MYAML::XS -e "$p")
  135. current='[% pc("macosx-toolchain", "version") %]'
  136. check_update_needed macos-sdk "$needed" "$current"
  137. # cctools
  138. read -d '' p << 'EOF' || true
  139. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  140. print $d->{'cctools-port'}{fetch}{revision};
  141. EOF
  142. needed=$(perl -MYAML::XS -e "$p")
  143. current='[% pc("cctools", "git_hash") %]'
  144. check_update_needed cctools "$needed" "$current"
  145. # libtapi
  146. read -d '' p << 'EOF' || true
  147. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  148. print $d->{'libtapi'}{fetch}{revision};
  149. EOF
  150. needed=$(perl -MYAML::XS -e "$p")
  151. current='[% pc("libtapi", "git_hash") %]'
  152. check_update_needed libtapi "$needed" "$current"
  153. # End of macOS checks
  154. [% END -%]
  155. [% IF c("var/windows") %]
  156. # mingw-w64
  157. read -d '' p << 'EOF' || true
  158. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  159. print $d->{'mingw-w64'}{fetch}{revision};
  160. EOF
  161. needed=$(perl -MYAML::XS -e "$p")
  162. current='[% pc("mingw-w64", "git_hash") %]'
  163. check_update_needed mingw-w64 "$needed" "$current"
  164. # llvm-mingw
  165. read -d '' p << 'EOF' || true
  166. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  167. print $d->{'llvm-mingw'}{fetch}{revision};
  168. EOF
  169. needed=$(perl -MYAML::XS -e "$p")
  170. current='[% pc("llvm-mingw", "git_hash") %]'
  171. check_update_needed llvm-mingw "$needed" "$current"
  172. # fxc2
  173. read -d '' p << 'EOF' || true
  174. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  175. print $d->{fxc2}{fetch}{revision};
  176. EOF
  177. needed=$(perl -MYAML::XS -e "$p")
  178. current='[% pc("fxc2", "git_hash") %]'
  179. check_update_needed fxc2 "$needed" "$current"
  180. # End of Windows checks
  181. [% END -%]
  182. [% IF c("var/rlbox") %]
  183. # wasi-sdk
  184. read -d '' p << 'EOF' || true
  185. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  186. print $d->{'wasi-sdk'}{fetch}{revision};
  187. EOF
  188. needed=$(perl -MYAML::XS -e "$p")
  189. current='[% pc("wasi-sysroot", "git_hash") %]'
  190. check_update_needed wasi-sdk "$needed" "$current"
  191. # lucetc
  192. read -d '' p << 'EOF' || true
  193. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  194. print $d->{'lucetc-source'}{fetch}{revision};
  195. EOF
  196. needed=$(perl -MYAML::XS -e "$p")
  197. current='[% pc("lucetc", "git_hash") %]'
  198. check_update_needed lucetc "$needed" "$current"
  199. # End RLBox
  200. [% END -%]