Bug 1945020 - build(rust): bump minimum Rust version 1.76 → 1.82 r=glandium

…but for ASAN/TSAN, use a hack: a 1.82.0 nightly commit that tolerates
`unsafe extern` blocks, but doesn't break our current toolchain patches.

Differential Revision: https://phabricator.services.mozilla.com/D236028
This commit is contained in:
Erich Gubler
2025-02-06 22:12:03 +00:00
parent 8ae194b567
commit 2fbeb9674c
6 changed files with 20 additions and 13 deletions

View File

@@ -58,7 +58,7 @@ exclude = [
resolver = "2" resolver = "2"
[workspace.package] [workspace.package]
rust-version = "1.76.0" rust-version = "1.82.0"
[workspace.dependencies] [workspace.dependencies]
# Shared across multiple UniFFI consumers. # Shared across multiple UniFFI consumers.

View File

@@ -12,10 +12,10 @@ For firefox's purposes, these patches still work fine, and are necessary
to make -Zbuild-std work in a vendored environment. to make -Zbuild-std work in a vendored environment.
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 012d64e5344..aedb53358ef 100644 index 58f86aa996d..ef8c1584011 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs --- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -927,6 +927,31 @@ fn run(self, builder: &Builder<'_>) -> GeneratedTarball { @@ -941,6 +941,35 @@ fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
builder.copy_link(&builder.src.join(file), &dst_src.join(file)); builder.copy_link(&builder.src.join(file), &dst_src.join(file));
} }
@@ -40,7 +40,11 @@ index 012d64e5344..aedb53358ef 100644
+ cmd.env("RUSTC_BOOTSTRAP", "1"); + cmd.env("RUSTC_BOOTSTRAP", "1");
+ builder.info("Dist src"); + builder.info("Dist src");
+ let _time = timeit(builder); + let _time = timeit(builder);
+ builder.run(&mut cmd); + builder.run(
+ &mut cmd,
+ crate::utils::exec::OutputMode::Print,
+ crate::utils::exec::OutputMode::Print,
+ );
+ +
+ builder.remove(&temp_lock); + builder.remove(&temp_lock);
+ +
@@ -48,10 +52,10 @@ index 012d64e5344..aedb53358ef 100644
} }
} }
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 5ed6b357e20..ad617948c4b 100644 index 453fb39327d..af579af9eca 100644
--- a/src/bootstrap/src/lib.rs --- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs
@@ -1649,6 +1649,30 @@ fn read_stamp_file(&self, stamp: &Path) -> Vec<(PathBuf, DependencyType)> { @@ -1732,6 +1732,30 @@ fn read_stamp_file(&self, stamp: &Path) -> Vec<(PathBuf, DependencyType)> {
paths paths
} }
@@ -65,7 +69,7 @@ index 5ed6b357e20..ad617948c4b 100644
+ if src == dst { + if src == dst {
+ return; + return;
+ } + }
+ let _ = fs::remove_file(&dst); + let _ = fs::remove_file(dst);
+ let metadata = t!(src.symlink_metadata()); + let metadata = t!(src.symlink_metadata());
+ if let Err(e) = fs::copy(src, dst) { + if let Err(e) = fs::copy(src, dst) {
+ panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e) + panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e)

View File

@@ -164,7 +164,7 @@ Here are the Rust versions for each Firefox version.
| Firefox 135 | Rust 1.83.0 | 1.76.0 | 2024 November 28 | 2025 January 2 | 2025 February 4 | Firefox 135 | Rust 1.83.0 | 1.76.0 | 2024 November 28 | 2025 January 2 | 2025 February 4
| Firefox 136 | Rust 1.84.0 | 1.76.0 | 2025 January 9 | 2025 January 30 | 2025 March 4 | Firefox 136 | Rust 1.84.0 | 1.76.0 | 2025 January 9 | 2025 January 30 | 2025 March 4
| **Estimated** | | **Estimated** |
| Firefox 137 | Rust 1.85.0 | ? | 2025 February 20 | 2025 February 27 | 2025 April 1 | Firefox 137 | Rust 1.85.0 | 1.83.0 | 2025 February 20 | 2025 February 27 | 2025 April 1
| Firefox 138 | Rust 1.85.0 | ? | 2025 February 20 | 2025 March 27 | 2025 April 29 | Firefox 138 | Rust 1.85.0 | ? | 2025 February 20 | 2025 March 27 | 2025 April 29
| Firefox 139 | Rust 1.86.0 | ? | 2025 April 3 | 2025 April 24 | 2025 May 27 | Firefox 139 | Rust 1.86.0 | ? | 2025 April 3 | 2025 April 24 | 2025 May 27
| Firefox 140 | Rust 1.87.0 | ? | 2025 May 15 | 2025 May 22 | 2025 June 24 | Firefox 140 | Rust 1.87.0 | ? | 2025 May 15 | 2025 May 22 | 2025 June 24

View File

@@ -13,7 +13,7 @@ from mach.site import PythonVirtualenv
from mach.util import get_state_dir from mach.util import get_state_dir
# Keep in sync with rust-version in top-level Cargo.toml. # Keep in sync with rust-version in top-level Cargo.toml.
MINIMUM_RUST_VERSION = "1.76.0" MINIMUM_RUST_VERSION = "1.82.0"
def get_tools_dir(srcdir=False): def get_tools_dir(srcdir=False):

View File

@@ -379,7 +379,10 @@ rust-1.81.0:
type: git type: git
include-dot-git: true include-dot-git: true
repo: https://github.com/rust-lang/rust/ repo: https://github.com/rust-lang/rust/
revision: eeb90cda1969383f56a2637cbd3037bdf598841c # NOTE: This is 1.81.0 and then some, to accommodate compiling some 1.82.0 code without
# breaking patches we use for sanitizers. See
# <https://bugzilla.mozilla.org/show_bug.cgi?id=1915537> for follow-up.
revision: ab1527f1d6560168f9fd36fa8cd7ba677c1d36ad
rust-nightly: rust-nightly:
description: Rust nightly source code description: Rust nightly source code

View File

@@ -11,12 +11,12 @@ task-defaults:
script: repack_rust.py script: repack_rust.py
toolchain-artifact: public/build/rustc.tar.zst toolchain-artifact: public/build/rustc.tar.zst
linux64-rust-1.76: linux64-rust-1.82:
treeherder: treeherder:
symbol: TL(rust-1.76) symbol: TL(rust-1.82)
run: run:
arguments: [ arguments: [
'--channel', '1.76.0', '--channel', '1.82.0',
'--host', 'x86_64-unknown-linux-gnu', '--host', 'x86_64-unknown-linux-gnu',
'--target', 'x86_64-unknown-linux-gnu', '--target', 'x86_64-unknown-linux-gnu',
'--target', 'i686-unknown-linux-gnu', '--target', 'i686-unknown-linux-gnu',