list_toolchain_updates_checks 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. if (m/^\\s*NODE_MIN_VERSION\\s*=\\s*StrictVersion\\("([^"]+)"\\)/) {
  83. print $1;
  84. exit;
  85. }
  86. EOF
  87. needed=$(cat python/mozbuild/mozbuild/nodeutil.py | perl -ne "$p")
  88. current='[% pc("node", "version") %]'
  89. check_update_needed node "$needed" "$current"
  90. # python
  91. read -d '' p << 'EOF' || true
  92. if (m/find_python3_executable\\(min_version\\s*=\\s*"([^"]+)"/) {
  93. print $1;
  94. exit;
  95. }
  96. EOF
  97. needed=$(cat build/moz.configure/init.configure | perl -ne "$p")
  98. current=3.6.0
  99. check_update_needed python "$needed" "$current"
  100. [% IF c("var/osx") %]
  101. # macosx-sdk
  102. read -d '' p << 'EOF' || true
  103. my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/clang.yml');
  104. my $clang_toolchain;
  105. foreach my $t (keys %$d) {
  106. if ($d->{$t}{run}{'toolchain-alias'} eq 'macosx64-clang') {
  107. foreach my $toolchain (@{$d->{$t}{fetches}{toolchain}}) {
  108. if ($toolchain =~ m/^macosx64-sdk-(.+)$/) {
  109. print $1;
  110. exit;
  111. }
  112. }
  113. last;
  114. }
  115. }
  116. EOF
  117. needed=$(perl -MYAML::XS -e "$p")
  118. current='[% pc("macosx-toolchain", "version") %]'
  119. check_update_needed macos-sdk "$needed" "$current"
  120. # End of macOS checks
  121. [% END -%]
  122. [% IF c("var/windows") %]
  123. # mingw-w64
  124. read -d '' p << 'EOF' || true
  125. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  126. print $d->{'mingw-w64'}{fetch}{revision};
  127. EOF
  128. needed=$(perl -MYAML::XS -e "$p")
  129. current='[% pc("mingw-w64", "git_hash") %]'
  130. check_update_needed mingw-w64 "$needed" "$current"
  131. # llvm-mingw
  132. read -d '' p << 'EOF' || true
  133. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  134. print $d->{'llvm-mingw'}{fetch}{revision};
  135. EOF
  136. needed=$(perl -MYAML::XS -e "$p")
  137. current='[% pc("llvm-mingw", "git_hash") %]'
  138. check_update_needed llvm-mingw "$needed" "$current"
  139. # fxc2
  140. read -d '' p << 'EOF' || true
  141. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  142. print $d->{fxc2}{fetch}{revision};
  143. EOF
  144. needed=$(perl -MYAML::XS -e "$p")
  145. current='[% pc("fxc2", "git_hash") %]'
  146. check_update_needed fxc2 "$needed" "$current"
  147. # End of Windows checks
  148. [% END -%]
  149. [% IF c("var/rlbox") %]
  150. # wasi-sdk
  151. read -d '' p << 'EOF' || true
  152. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  153. print $d->{'wasi-sdk'}{fetch}{revision};
  154. EOF
  155. needed=$(perl -MYAML::XS -e "$p")
  156. current='[% pc("wasi-sysroot", "git_hash") %]'
  157. check_update_needed wasi-sdk "$needed" "$current"
  158. # lucetc
  159. read -d '' p << 'EOF' || true
  160. my $d = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
  161. print $d->{'lucetc-source'}{fetch}{revision};
  162. EOF
  163. needed=$(perl -MYAML::XS -e "$p")
  164. current='[% pc("lucetc", "git_hash") %]'
  165. check_update_needed lucetc "$needed" "$current"
  166. # End RLBox
  167. [% END -%]