Skip to content

Commit

Permalink
Merge pull request #1542 from flatcar/rust-1.75.0-main
Browse files Browse the repository at this point in the history
Upgrade dev-lang/rust and virtual/rust in main from 1.74.1 to 1.75.0
  • Loading branch information
pothos authored Jan 5, 2024
2 parents 4c41842 + bab1cef commit d0c7277
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 35 deletions.
1 change: 1 addition & 0 deletions changelog/updates/2024-01-04-rust-1.75.0-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Rust ([1.75.0](/~https://github.com/rust-lang/rust/releases/tag/1.75.0))
60 changes: 30 additions & 30 deletions sdk_container/src/third_party/coreos-overlay/dev-lang/rust/Manifest

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
From a4132f6d092b781b742679d2229c1c69f6ad7b16 Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Sat, 30 Dec 2023 15:13:27 +0000
Subject: [PATCH 1/2] Handle non-existent/empty <CARGO_HOME>/registry/src

If remap-debuginfo is set but cargo isn't vendored into
.cargo/registry/src, don't panic:

| thread 'main' panicked at src/core/builder.rs:1795:26:
| std::fs::read_dir(registry_src) failed with No such file or directory (os error 2)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
src/bootstrap/src/core/builder.rs | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index e85753a351232..08e7e0b348096 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -1812,15 +1812,19 @@ impl<'a> Builder<'a> {
if self.config.rust_remap_debuginfo {
// FIXME: handle vendored sources
let registry_src = t!(home::cargo_home()).join("registry").join("src");
- let mut env_var = OsString::new();
- for entry in t!(std::fs::read_dir(registry_src)) {
+ if registry_src.is_dir() {
+ let mut env_var = OsString::new();
+ for entry in t!(std::fs::read_dir(registry_src)) {
+ if !env_var.is_empty() {
+ env_var.push("\t");
+ }
+ env_var.push(t!(entry).path());
+ env_var.push("=/rust/deps");
+ }
if !env_var.is_empty() {
- env_var.push("\t");
+ cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
}
- env_var.push(t!(entry).path());
- env_var.push("=/rust/deps");
}
- cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
}

// Enable usage of unstable features

From 361f32e60788bb95011092a9b2a0472d4e6d38b1 Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Sat, 30 Dec 2023 15:15:40 +0000
Subject: [PATCH 2/2] Ignore blank
RUSTC_DEBUGINFO_MAP/RUSTC_CARGO_REGISTRY_SRC_TO_REMAP

If RUSTC_DEBUGINFO_MAP or RUSTC_CARGO_REGISTRY_SRC_TO_REMAP are empty,
avoid inserting `--remap-path-prefix` with no associated argument.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
src/bootstrap/src/bin/rustc.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/bootstrap/src/bin/rustc.rs b/src/bootstrap/src/bin/rustc.rs
index 38c55b2034496..a9dd687b75653 100644
--- a/src/bootstrap/src/bin/rustc.rs
+++ b/src/bootstrap/src/bin/rustc.rs
@@ -161,13 +161,17 @@ fn main() {
}

if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
- cmd.arg("--remap-path-prefix").arg(&map);
+ if !map.is_empty() {
+ cmd.arg("--remap-path-prefix").arg(&map);
+ }
}
// The remap flags for Cargo registry sources need to be passed after the remapping for the
// Rust source code directory, to handle cases when $CARGO_HOME is inside the source directory.
if let Ok(maps) = env::var("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP") {
for map in maps.split('\t') {
- cmd.arg("--remap-path-prefix").arg(map);
+ if !map.is_empty() {
+ cmd.arg("--remap-path-prefix").arg(map);
+ }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/rust.asc
PATCHES=(
#"${FILESDIR}"/1.72.0-bump-libc-deps-to-0.2.146.patch # pending refresh
"${FILESDIR}"/1.70.0-ignore-broken-and-non-applicable-tests.patch
"${FILESDIR}"/1.62.1-musl-dynamic-linking.patch
#"${FILESDIR}"/1.62.1-musl-dynamic-linking.patch # Only used by upstream Gentoo, fails for 1.75
"${FILESDIR}"/1.67.0-doc-wasm.patch
"${FILESDIR}"/1.75.0-119445.patch
)

S="${WORKDIR}/${MY_P}-src"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
=dev-lang/python-3.11.6 ~amd64

# Accept unstable host Rust compilers.
=dev-lang/rust-1.74.1 ~amd64 ~arm64
=dev-lang/rust-1.75.0 ~amd64 ~arm64

# Needed by arm64-native SDK.
=dev-lang/yasm-1.3.0-r1 ~arm64
Expand Down Expand Up @@ -93,4 +93,4 @@
=sys-process/procps-4.0.4 ~amd64

# Accept unstable host Rust compilers.
=virtual/rust-1.74.1 ~amd64 ~arm64
=virtual/rust-1.75.0 ~amd64 ~arm64
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

# Overwrite portage-stable mask. We haven't seen LLVM related problems
# with rust so far, so keep using 1.70.0.
~dev-lang/rust-1.74.1
~virtual/rust-1.74.1
~dev-lang/rust-1.75.0
~virtual/rust-1.75.0

# portage-stable masked catalyst-3, and has not provided a stable way to
# update to catalyst-4 so overriding the change for now to use catalyst-3
Expand Down

0 comments on commit d0c7277

Please sign in to comment.