chore: upgrade Rust to 1.92 (#31592)

This commit is contained in:
Bartek Iwańczuk 2025-12-17 17:06:52 +01:00 committed by GitHub
parent 26fdc29fe0
commit 8aead9bf10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 44 additions and 39 deletions

View file

@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify";
// Bump this number when you want to purge the cache.
// Note: the tools/release/01_bump_crate_versions.ts script will update this version
// automatically via regex, so ensure that this line maintains this format.
const cacheVersion = 84;
const cacheVersion = 86;
const ubuntuX86Runner = "ubuntu-24.04";
const ubuntuX86XlRunner = "ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04";
@ -76,7 +76,7 @@ const prCachePath = [
].join("\n");
// Note that you may need to add more version to the `apt-get remove` line below if you change this
const llvmVersion = 20;
const llvmVersion = 21;
const installPkgsCommand =
`sudo apt-get install -y --no-install-recommends clang-${llvmVersion} lld-${llvmVersion} clang-tools-${llvmVersion} clang-format-${llvmVersion} clang-tidy-${llvmVersion}`;
const sysRootStep = {

View file

@ -173,8 +173,8 @@ jobs:
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: '84-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '84-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-'
key: '86-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '86-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-'
if: '!(matrix.skip)'
- uses: dsherret/rust-toolchain-file@v1
if: '!(matrix.skip)'
@ -260,18 +260,18 @@ jobs:
sudo apt-get -qq remove 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null
# Install clang-XXX, lld-XXX, and debootstrap.
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-20.list
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-21.list
curl https://apt.llvm.org/llvm-snapshot.gpg.key |
gpg --dearmor |
sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
sudo apt-get update
# this was unreliable sometimes, so try again if it fails
sudo apt-get install -y --no-install-recommends clang-20 lld-20 clang-tools-20 clang-format-20 clang-tidy-20 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-20 lld-20 clang-tools-20 clang-format-20 clang-tidy-20
sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21
# Fix alternatives
(yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true
clang-20 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC
clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC
echo "Decompressing sysroot..."
wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
@ -304,8 +304,8 @@ jobs:
CARGO_PROFILE_RELEASE_INCREMENTAL=false
RUSTFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-20
-C link-arg=-fuse-ld=lld-20
-C linker=clang-21
-C link-arg=-fuse-ld=lld-21
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
@ -316,8 +316,8 @@ jobs:
__1
RUSTDOCFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-20
-C link-arg=-fuse-ld=lld-20
-C linker=clang-21
-C link-arg=-fuse-ld=lld-21
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
@ -326,7 +326,7 @@ jobs:
--cfg tokio_unstable
$RUSTFLAGS
__1
CC=/usr/bin/clang-20
CC=/usr/bin/clang-21
CFLAGS=$CFLAGS
" > $GITHUB_ENV
- name: Remove macOS cURL --ipv4 flag
@ -379,7 +379,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '84-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
restore-keys: '86-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: Apply and update mtime cache
if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))'
uses: ./.github/mtime_cache
@ -744,7 +744,7 @@ jobs:
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: '84-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
key: '86-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
lint:
name: 'lint ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }}'
needs:
@ -795,8 +795,8 @@ jobs:
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: '84-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '84-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-'
key: '86-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '86-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-'
- uses: dsherret/rust-toolchain-file@v1
- name: Install Deno
uses: denoland/setup-deno@v2
@ -813,7 +813,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '84-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
restore-keys: '86-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: test_format.js
if: matrix.os == 'linux'
run: deno run --allow-write --allow-read --allow-run --allow-net ./tools/format.js --check
@ -833,7 +833,7 @@ jobs:
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: '84-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
key: '86-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
libs:
name: build libs
needs:

View file

@ -605,7 +605,7 @@ mod tests {
assert_same_serialize_deserialize(CacheDBHash::new(u64::MAX));
assert_same_serialize_deserialize(CacheDBHash::new(u64::MAX - 1));
assert_same_serialize_deserialize(CacheDBHash::new(u64::MIN));
assert_same_serialize_deserialize(CacheDBHash::new(u64::MIN + 1));
assert_same_serialize_deserialize(CacheDBHash::new(1));
}
fn assert_same_serialize_deserialize(original_hash: CacheDBHash) {

View file

@ -52,7 +52,6 @@ use deno_runtime::tokio_util::create_basic_runtime;
use indexmap::IndexMap;
use indexmap::IndexSet;
use lazy_regex::lazy_regex;
use log::error;
use lsp_types::Uri;
use node_resolver::NodeResolutionKind;
use node_resolver::ResolutionMode;

View file

@ -54,7 +54,7 @@ mod tests {
#[test]
fn test_find_root() {
let urls = vec![
let urls = [
Url::parse("file:///a/b/c/d/e.ts").unwrap(),
Url::parse("file:///a/b/c/d/f.ts").unwrap(),
Url::parse("file:///a/b/c/d/g.ts").unwrap(),
@ -71,7 +71,7 @@ mod tests {
#[test]
fn test_find_root_with_similar_filenames() {
let urls = vec![
let urls = [
Url::parse("file:///a/b/c/d/foo0.ts").unwrap(),
Url::parse("file:///a/b/c/d/foo1.ts").unwrap(),
Url::parse("file:///a/b/c/d/foo2.ts").unwrap(),
@ -82,7 +82,7 @@ mod tests {
#[test]
fn test_find_root_with_similar_dirnames() {
let urls = vec![
let urls = [
Url::parse("file:///a/b/c/foo0/mod.ts").unwrap(),
Url::parse("file:///a/b/c/foo1/mod.ts").unwrap(),
Url::parse("file:///a/b/c/foo2/mod.ts").unwrap(),

View file

@ -504,9 +504,9 @@ mod npm {
action.action,
action.module,
if let Some(target) = &action.target {
&format!("@{}", target)
format!("@{}", target)
} else {
""
"".to_string()
},
if action.is_major {
" (major upgrade)"

View file

@ -36,16 +36,18 @@ pub fn maybe_auth_header_value_for_npm_registry(
return Err(AuthHeaderForNpmRegistryError::Both);
}
if username.is_some() && password.is_some() {
if let Some(username) = username
&& let Some(password) = password
{
// The npm client does some double encoding when generating the
// bearer token value, see
// https://github.com/npm/cli/blob/780afc50e3a345feb1871a28e33fa48235bc3bd5/workspaces/config/lib/index.js#L846-L851
let pw_base64 = BASE64_STANDARD
.decode(password.unwrap())
.decode(password)
.map_err(AuthHeaderForNpmRegistryError::Base64)?;
let bearer = BASE64_STANDARD.encode(format!(
"{}:{}",
username.unwrap(),
username,
String::from_utf8_lossy(&pw_base64)
));

View file

@ -602,10 +602,12 @@ impl WebWorker {
];
#[cfg(feature = "hmr")]
assert!(
cfg!(not(feature = "only_snapshotted_js_sources")),
"'hmr' is incompatible with 'only_snapshotted_js_sources'."
);
const {
assert!(
cfg!(not(feature = "only_snapshotted_js_sources")),
"'hmr' is incompatible with 'only_snapshotted_js_sources'."
);
}
for extension in &mut extensions {
if options.startup_snapshot.is_some() {

View file

@ -444,10 +444,12 @@ impl MainWorker {
}
#[cfg(feature = "hmr")]
assert!(
cfg!(not(feature = "only_snapshotted_js_sources")),
"'hmr' is incompatible with 'only_snapshotted_js_sources'."
);
const {
assert!(
cfg!(not(feature = "only_snapshotted_js_sources")),
"'hmr' is incompatible with 'only_snapshotted_js_sources'."
);
}
#[cfg(feature = "only_snapshotted_js_sources")]
options.startup_snapshot.as_ref().expect("A user snapshot was not provided, even though 'only_snapshotted_js_sources' is used.");

View file

@ -1,3 +1,3 @@
[toolchain]
channel = "1.90.0"
channel = "1.92.0"
components = ["rustfmt", "clippy"]

View file

@ -10,6 +10,6 @@ Platform: [WILDLINE]
Version: [WILDLINE]
Args: [[WILDLINE], "test", "main.js"]
[WILDCARD]
thread 'tokio-runtime-worker' panicked at [WILDLINE]
thread 'tokio-runtime-worker' ([WILDCARD]) panicked at [WILDLINE]
pledge test permissions called before restoring previous pledge
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace