Update to Rust 1.88.0

Resolves: RHEL-81601
Resolves: RHEL-81620
This commit is contained in:
Josh Stone 2025-07-10 17:59:33 -07:00
parent a4d2e319e4
commit 2c97649d7a
9 changed files with 139 additions and 99 deletions

1
.gitignore vendored
View File

@ -434,3 +434,4 @@
/rustc-1.86.0-src.tar.xz
/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
/rustc-1.87.0-src.tar.xz
/rustc-1.88.0-src.tar.xz

View File

@ -1,42 +0,0 @@
From dc0fbcab7e0673afe62b3e8e74905d9e5f5b74a4 Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo <jchecahi@redhat.com>
Date: Fri, 11 Apr 2025 16:57:38 +0200
Subject: [PATCH] Fix profiler_builtins build script to handle full path to
profiler lib
LLVM_PROFILER_RT_LIB may be set to an absolute path (e.g., in Fedora builds),
but `-l` expects a library name, not a path. After #138273, this caused builds
to fail with a "could not find native static library" error.
This patch updates the build script to split the path into directory and
filename, using `cargo::rustc-link-search` for the directory and
`cargo::rustc-link-lib=+verbatim` for the file. This allows profiler_builtins to
correctly link the static library even when an absolute path is provided.
---
library/profiler_builtins/build.rs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs
index dd85239fa8c..fc1a9ecc1ec 100644
--- a/library/profiler_builtins/build.rs
+++ b/library/profiler_builtins/build.rs
@@ -9,8 +9,14 @@
fn main() {
if let Ok(rt) = tracked_env_var("LLVM_PROFILER_RT_LIB") {
- println!("cargo::rustc-link-lib=static:+verbatim={rt}");
- return;
+ let rt = PathBuf::from(rt);
+ if let Some(lib) = rt.file_name() {
+ if let Some(dir) = rt.parent() {
+ println!("cargo::rustc-link-search=native={}", dir.display());
+ }
+ println!("cargo::rustc-link-lib=static:+verbatim={}", lib.to_str().unwrap());
+ return;
+ }
}
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS was not set");
--
2.49.0

View File

@ -23,6 +23,8 @@ unicode:
- rustc-*-src/vendor/idna-*/tests/IdnaTestV2.txt
- rustc-*-src/vendor/mdbook*/tests/dummy_book/src/first/unicode.md
- rustc-*-src/vendor/mdbook*/tests/searchindex_fixture.json
- rustc-*-src/vendor/mdbook*/tests/testsuite/search/reasonable_search_index/expected_index.js
- rustc-*-src/vendor/mdbook*/tests/testsuite/search/reasonable_search_index/src/first/unicode.md
- rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-string?.wat
- rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-block-comment?.wat
- rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-line-comment?.wat

79
rust-pr142047.patch Normal file
View File

@ -0,0 +1,79 @@
From 925e76167ce2465c5c9d990d97c2db99f459640b Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Wed, 4 Jun 2025 15:03:19 -0700
Subject: [PATCH 1/2] Ensure stack in `ThirBuildCx::mirror_exprs`
This solve a stack overflow found on Fedora s390x when building
`tests/ui/parser/survive-peano-lesson-queue.rs`. Note that the singular
`mirror_expr` method already has this stack check, but in this case the
plural method was the one recursing too deeply.
---
compiler/rustc_mir_build/src/thir/cx/expr.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
index 226dc920a496c..78c168778ac9d 100644
--- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
+++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
@@ -38,7 +38,10 @@ impl<'tcx> ThirBuildCx<'tcx> {
}
pub(crate) fn mirror_exprs(&mut self, exprs: &'tcx [hir::Expr<'tcx>]) -> Box<[ExprId]> {
- exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect()
+ // `mirror_exprs` may also recurse deeply, so it needs protection from stack overflow.
+ // Note that we *could* forward to `mirror_expr` for that, but we can consolidate the
+ // overhead of stack growth by doing it outside the iteration.
+ ensure_sufficient_stack(|| exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect())
}
#[instrument(level = "trace", skip(self, hir_expr))]
From af2a85bd75c011fb3453a4963400918e096e1896 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Wed, 4 Jun 2025 15:16:38 -0700
Subject: [PATCH 2/2] Ensure stack in `Parser::parse_ty`
This solve a stack overflow found on Fedora s390x when building
`tests/ui/associated-consts/issue-93775.rs`.
---
compiler/rustc_parse/src/parser/ty.rs | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
index 17481731b1107..6eaec2e29ad48 100644
--- a/compiler/rustc_parse/src/parser/ty.rs
+++ b/compiler/rustc_parse/src/parser/ty.rs
@@ -7,6 +7,7 @@ use rustc_ast::{
Pinnedness, PolyTraitRef, PreciseCapturingArg, TraitBoundModifiers, TraitObjectSyntax, Ty,
TyKind, UnsafeBinderTy,
};
+use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::{Applicability, Diag, PResult};
use rustc_span::{ErrorGuaranteed, Ident, Span, kw, sym};
use thin_vec::{ThinVec, thin_vec};
@@ -104,14 +105,17 @@ fn can_begin_dyn_bound_in_edition_2015(t: &Token) -> bool {
impl<'a> Parser<'a> {
/// Parses a type.
pub fn parse_ty(&mut self) -> PResult<'a, P<Ty>> {
- self.parse_ty_common(
- AllowPlus::Yes,
- AllowCVariadic::No,
- RecoverQPath::Yes,
- RecoverReturnSign::Yes,
- None,
- RecoverQuestionMark::Yes,
- )
+ // Make sure deeply nested types don't overflow the stack.
+ ensure_sufficient_stack(|| {
+ self.parse_ty_common(
+ AllowPlus::Yes,
+ AllowCVariadic::No,
+ RecoverQPath::Yes,
+ RecoverReturnSign::Yes,
+ None,
+ RecoverQuestionMark::Yes,
+ )
+ })
}
pub(super) fn parse_ty_with_generics_recovery(

View File

@ -1,5 +1,5 @@
Name: rust
Version: 1.87.0
Version: 1.88.0
Release: %autorelease
Summary: The Rust Programming Language
License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@ -11,12 +11,12 @@ URL: https://www.rust-lang.org
%global rust_arches x86_64 i686 aarch64 ppc64le s390x
ExclusiveArch: %{rust_arches}
# To bootstrap from scratch, set the channel and date from src/stage0.json
# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
# To bootstrap from scratch, set the channel and date from src/stage0
# e.g. 1.88.0 wants rustc: 1.87.0-2025-05-15
# or nightly wants some beta-YYYY-MM-DD
%global bootstrap_version 1.86.0
%global bootstrap_channel 1.86.0
%global bootstrap_date 2025-04-03
%global bootstrap_version 1.87.0
%global bootstrap_channel 1.87.0
%global bootstrap_date 2025-05-15
# Only the specified arches will use bootstrap binaries.
# NOTE: Those binaries used to be uploaded with every new release, but that was
@ -43,9 +43,10 @@ ExclusiveArch: %{rust_arches}
%bcond_with llvm_static
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
# is insufficient. Rust currently requires LLVM 18.0+.
%global min_llvm_version 18.0.0
%global bundled_llvm_version 20.1.1
# is insufficient. Rust currently requires LLVM 19.0+.
# See src/bootstrap/src/core/build_steps/llvm.rs, fn check_llvm_version
%global min_llvm_version 19.0.0
%global bundled_llvm_version 20.1.5
#global llvm_compat_version 19
%global llvm llvm%{?llvm_compat_version}
%bcond_with bundled_llvm
@ -72,7 +73,7 @@ ExclusiveArch: %{rust_arches}
# Cargo uses UPSERTs with omitted conflict targets
%global min_sqlite3_version 3.35
%global bundled_sqlite3_version 3.48.0
%global bundled_sqlite3_version 3.49.1
%if 0%{?rhel} && 0%{?rhel} < 10
%bcond_without bundled_sqlite3
%else
@ -138,11 +139,11 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch
Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch
# We don't want to use the bundled library in libsqlite3-sys
Patch6: rustc-1.87.0-unbundle-sqlite.patch
Patch6: rustc-1.88.0-unbundle-sqlite.patch
# Split the absolute path of libclang_rt.profile.a when passed to profiler_builtns
# Upstream PR: https://github.com/rust-lang/rust/pull/139677
Patch7: 0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
# Ensure stack in two places that affect s390x
# https://github.com/rust-lang/rust/pull/142047
Patch7: rust-pr142047.patch
### RHEL-specific patches below ###
@ -152,7 +153,7 @@ Source101: cargo_vendor.attr
Source102: cargo_vendor.prov
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
Patch100: rustc-1.86.0-disable-libssh2.patch
Patch100: rustc-1.88.0-disable-libssh2.patch
# Get the Rust triple for any architecture and ABI.
%{lua: function rust_triple(arch, abi)
@ -301,7 +302,7 @@ BuildRequires: procps-ng
# debuginfo-gdb tests need gdb
BuildRequires: gdb
# Work around https://bugzilla.redhat.com/show_bug.cgi?id=2275274:
# gdb currently prints a "Unable to load 'rpm' module. Please install the python3-rpm package."
# gdb currently prints a "Unable to load 'rpm' module. Please install the python3-rpm package."
# message that breaks version detection.
BuildRequires: python3-rpm
@ -315,7 +316,7 @@ Provides: rustc%{?_isa} = %{version}-%{release}
# Always require our exact standard library
Requires: %{name}-std-static%{?_isa} = %{version}-%{release}
# The C compiler is needed at runtime just for linking. Someday rustc might
# The C compiler is needed at runtime just for linking. Someday rustc might
# invoke the linker directly, and then we'll only need binutils.
# https://github.com/rust-lang/rust/issues/11937
Requires: /usr/bin/cc
@ -555,7 +556,7 @@ BuildRequires: git-core
# in sync since some feature development depends on them together.
Requires: %{name} = %{version}-%{release}
# "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and
# "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and
# Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too
Obsoletes: cargo-vendor <= 0.1.23
Provides: cargo-vendor = %{version}-%{release}
@ -621,7 +622,7 @@ BuildArch: noarch
Recommends: %{name}-std-static = %{version}-%{release}
%description src
This package includes source files for the Rust standard library. It may be
This package includes source files for the Rust standard library. It may be
useful as a reference for code completion tools in various editors.
@ -671,7 +672,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
%if %without bundled_sqlite3
%patch -P6 -p1
%endif
%patch -P7 -p1
%if %with disabled_libssh2
@ -734,7 +734,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
%endif
# The configure macro will modify some autoconf-related files, which upsets
# cargo when it tries to verify checksums in those files. If we just truncate
# cargo when it tries to verify checksums in those files. If we just truncate
# that file list, cargo won't have anything to complain about.
find vendor -name .cargo-checksum.json \
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
@ -779,7 +779,7 @@ end}
# Some builders have relatively little memory for their CPU count.
# At least 4GB per CPU is a good rule of thumb for building rustc.
%if ! %defined constrain_build
%if %undefined constrain_build
%define constrain_build(m:) %{lua:
for l in io.lines('/proc/meminfo') do
if l:sub(1, 9) == "MemTotal:" then

View File

@ -1,23 +0,0 @@
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-03-11 15:30:39.383119717 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-03-11 15:32:12.486164705 -0700
@@ -2571,7 +2571,6 @@ version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad8935b44e7c13394a179a438e0cebba0fe08fe01b54f152e29a93b5cf993fd4"
dependencies = [
- "cc",
"pkg-config",
"vcpkg",
]
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-04-07 20:37:44.467359012 +0200
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-04-07 20:38:17.564060339 +0200
@@ -79,7 +79,7 @@ proptest = "1.6.0"
pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
rand = "0.9.0"
regex = "1.11.1"
-rusqlite = { version = "0.33.0", features = ["bundled"] }
+rusqlite = { version = "0.33.0", features = [] }
rustc-hash = "2.1.1"
rustc-stable-hash = "0.1.2"
rustfix = { version = "0.9.0", path = "crates/rustfix" }

View File

@ -1,7 +1,7 @@
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-03-11 15:36:38.387335541 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-03-11 15:39:27.491711044 -0700
@@ -2528,7 +2528,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-06-13 15:47:08.609927319 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-06-13 15:47:54.463092386 -0700
@@ -2530,7 +2530,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c
dependencies = [
"cc",
"libc",
@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -2574,20 +2573,6 @@ dependencies = [
@@ -2576,20 +2575,6 @@ dependencies = [
"pkg-config",
"vcpkg",
]
@ -29,16 +29,16 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
-]
[[package]]
name = "libz-sys"
name = "libz-rs-sys"
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-03-11 15:36:38.389045348 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-03-11 15:38:36.948228456 -0700
@@ -47,7 +47,7 @@ curl = "0.4.47"
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-06-13 15:47:08.610402846 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-06-13 15:47:51.696071356 -0700
@@ -46,7 +46,7 @@ curl = "0.4.47"
curl-sys = "0.4.79"
filetime = "0.2.25"
flate2 = { version = "1.0.35", default-features = false, features = ["zlib"] }
flate2 = { version = "1.1.1", default-features = false, features = ["zlib-rs"] }
-git2 = "0.20.0"
+git2 = { version = "0.20.0", default-features = false, features = ["https"] }
git2-curl = "0.21.0"
gix = { version = "0.70.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
glob = "0.3.2"
# When updating this, also see if `gix-transport` further down needs updating or some auth-related tests will fail.
gix = { version = "0.71.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }

View File

@ -0,0 +1,23 @@
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-06-13 01:10:18.000000000 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-06-13 15:39:38.597882622 -0700
@@ -2573,7 +2573,6 @@ version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbb8270bb4060bd76c6e96f20c52d80620f1d82a3470885694e41e0f81ef6fe7"
dependencies = [
- "cc",
"pkg-config",
"vcpkg",
]
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-06-13 01:10:18.000000000 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-06-13 15:39:34.583102112 -0700
@@ -80,7 +80,7 @@ proptest = "1.6.0"
pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
rand = "0.9.0"
regex = "1.11.1"
-rusqlite = { version = "0.34.0", features = ["bundled"] }
+rusqlite = { version = "0.34.0", features = [] }
rustc-hash = "2.1.1"
rustc-stable-hash = "0.1.2"
rustfix = { version = "0.9.0", path = "crates/rustfix" }

View File

@ -1,2 +1,2 @@
SHA512 (rustc-1.87.0-src.tar.xz) = 2ef08c9be45434401f916d54b3739f52d255f8a3a4ce05a717499250c2333eeaf601f1d18085b878c027c609f44da74d0151f5bfc2c9ae1e01166919a91a1d2b
SHA512 (rustc-1.88.0-src.tar.xz) = e6c62af2953f49462b2369e9551b12f2bec114577f90e3e76049636da4279b1e7f4d53bc6896f5d0d4715d90ef6d29dacff529a45690ffac6af62ad64600db40
SHA512 (wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz) = 7626200112b6e55567855b950baf7c9eeaf47e7de34a30eb9e8b785e0e03063197102d2f39d0846055d6aab7c06232f947a6b8af3dda62c8f02ea39d8f765a5e