Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 43ca753

Browse files
author
kavyasree
committedApr 16, 2025·
Upgrade rust to 1.85
Signed-off-by: kavyasree <kkaitepalli@microsoft.com>
1 parent 4b7b5be commit 43ca753

File tree

5 files changed

+236
-33
lines changed

5 files changed

+236
-33
lines changed
 

‎SPECS/rust/CVE-2024-9681.patch

Lines changed: 142 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 12051f0e3d8e9015ea12cde503a3d24d78e934b0 Mon Sep 17 00:00:00 2001
2+
From: kavyasree <kkaitepalli@microsoft.com>
3+
Date: Wed, 26 Feb 2025 15:53:42 +0530
4+
Subject: [PATCH] Ignoring_failing_ci_tests
5+
6+
---
7+
src/bootstrap/src/core/builder/tests.rs | 1 +
8+
src/bootstrap/src/core/config/tests.rs | 2 ++
9+
2 files changed, 3 insertions(+)
10+
11+
diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs
12+
index 21694cf46..7b701f48e 100644
13+
--- a/src/bootstrap/src/core/builder/tests.rs
14+
+++ b/src/bootstrap/src/core/builder/tests.rs
15+
@@ -202,6 +202,7 @@ fn alias_and_path_for_library() {
16+
]);
17+
}
18+
19+
+#[ignore]
20+
#[test]
21+
fn ci_rustc_if_unchanged_logic() {
22+
let config = Config::parse_inner(
23+
diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
24+
index 24f932a17..51ab892f1 100644
25+
--- a/src/bootstrap/src/core/config/tests.rs
26+
+++ b/src/bootstrap/src/core/config/tests.rs
27+
@@ -20,6 +20,7 @@ pub(crate) fn parse(config: &str) -> Config {
28+
)
29+
}
30+
31+
+#[ignore]
32+
#[test]
33+
fn download_ci_llvm() {
34+
let config = parse("");
35+
@@ -433,6 +434,7 @@ fn jobs_precedence() {
36+
assert_eq!(config.jobs, Some(123));
37+
}
38+
39+
+#[ignore]
40+
#[test]
41+
fn check_rustc_if_unchanged_paths() {
42+
let config = parse("");
43+
--
44+
2.34.1
45+

‎SPECS/rust/generate_source_tarball.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ popd > /dev/null
101101

102102
pushd $OUT_FOLDER > /dev/null
103103
echo "get additional src tarballs"
104-
CONFIG_FILE="$src_root/src/stage0.json"
105-
RUST_RELEASE_DATE=$(cat $CONFIG_FILE | jq -r '.compiler.date')
106-
RUST_STAGE0_VERSION=$(cat $CONFIG_FILE | jq -r '.compiler.version')
104+
CONFIG_FILE="$src_root/src/stage0"
105+
RUST_RELEASE_DATE=$(grep "^compiler_date=" $CONFIG_FILE | cut -d '=' -f 2)
106+
RUST_STAGE0_VERSION=$(grep "^compiler_version=" $CONFIG_FILE | cut -d '=' -f 2)
107+
107108
wget https://static.rust-lang.org/dist/$RUST_RELEASE_DATE/cargo-$RUST_STAGE0_VERSION-x86_64-unknown-linux-gnu.tar.xz
108109
wget https://static.rust-lang.org/dist/$RUST_RELEASE_DATE/rustc-$RUST_STAGE0_VERSION-x86_64-unknown-linux-gnu.tar.xz
109110
wget https://static.rust-lang.org/dist/$RUST_RELEASE_DATE/rust-std-$RUST_STAGE0_VERSION-x86_64-unknown-linux-gnu.tar.xz

‎SPECS/rust/rust.signatures.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"Signatures": {
3-
"cargo-1.74.0-aarch64-unknown-linux-gnu.tar.xz": "a18dc9132cf76ccba90bcbb53b56a4d37ebfb34845f61e79f7b5d4710a269647",
4-
"cargo-1.74.0-x86_64-unknown-linux-gnu.tar.xz": "f219386d4569c40b660518e99267afff428c13bf980bda7a614c8d4038d013f6",
5-
"rust-std-1.74.0-aarch64-unknown-linux-gnu.tar.xz": "c5ad01692bc08ce6f4db2ac815be63498b45013380c71f22b3d33bf3be767270",
6-
"rust-std-1.74.0-x86_64-unknown-linux-gnu.tar.xz": "548413213012e2f62b08ed8a913a51210ae7402619027224580176031f2789ea",
7-
"rustc-1.74.0-aarch64-unknown-linux-gnu.tar.xz": "a49bb365481913ead305658e7e9dc621da7895036b840fb57b1bc85c721d07e6",
8-
"rustc-1.74.0-x86_64-unknown-linux-gnu.tar.xz": "7d464be2ae0d6ce69f056d1ea9a8ce2b3b1d537418caea216fdd303903972181",
9-
"rustc-1.75.0-src-cargo.tar.gz": "8b41ba09a0e998fce6bafa69c93c8c5384b29b38438104db7c98e348b4759979",
10-
"rustc-1.75.0-src.tar.xz": "4526f786d673e4859ff2afa0bab2ba13c918b796519a25c1acce06dba9542340"
3+
"cargo-1.84.0-aarch64-unknown-linux-gnu.tar.xz": "68d4ad239b6d1e810e7b8591636dc408cb2c1e89661329fed906febf9c0a9d98",
4+
"cargo-1.84.0-x86_64-unknown-linux-gnu.tar.xz": "6c2371488db92a09cd50a1b4045c022f3cf2c643285b3b21105ab5f9b64fd6b6",
5+
"rust-std-1.84.0-aarch64-unknown-linux-gnu.tar.xz": "023f0b6153b23ac0e9686c2ab95bc393ee3e295b166bb36de3b4dfb53e3913e0",
6+
"rust-std-1.84.0-x86_64-unknown-linux-gnu.tar.xz": "770237080b9310d126350c3bd70820bd91064c2e96c29ab5f2e002b31b5bd067",
7+
"rustc-1.84.0-aarch64-unknown-linux-gnu.tar.xz": "9f5650aece53e083b933a57e5a8e0e2db4479f52ec897d5b6d0f77be6cd50498",
8+
"rustc-1.84.0-x86_64-unknown-linux-gnu.tar.xz": "a1737d86f80b31a6d48a6726726275dc068ecb930c9635b13aa59999486de837",
9+
"rustc-1.85.0-src-cargo.tar.gz": "aebfabef6090c81fff583d6172fbb4cf1d42d203df7ce6a9bba349abc3fc086c",
10+
"rustc-1.85.0-src.tar.xz": "d542c397217b5ba5bac7eb274f5ca62d031f61842c3ba4cc5328c709c38ea1e7"
1111
}
1212
}

‎SPECS/rust/rust.spec

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Prevent librustc_driver from inadvertently being listed as a requirement
22
%global __requires_exclude ^librustc_driver-
33

4-
# Release date and version of stage 0 compiler can be found in "src/stage0.json" inside the extracted "Source0".
4+
# Release date and version of stage 0 compiler can be found in "src/stage0" inside the extracted "Source0".
55
# Look for "date:" and "rustc:".
6-
%define release_date 2023-11-16
7-
%define stage0_version 1.74.0
6+
%define release_date 2025-01-09
7+
%define stage0_version 1.84.0
88

99
Summary: Rust Programming Language
1010
Name: rust
11-
Version: 1.75.0
12-
Release: 12%{?dist}
11+
Version: 1.85.0
12+
Release: 1%{?dist}
1313
License: (ASL 2.0 OR MIT) AND BSD AND CC-BY-3.0
1414
Vendor: Microsoft Corporation
1515
Distribution: Azure Linux
@@ -41,10 +41,10 @@ Source4: https://static.rust-lang.org/dist/%{release_date}/rust-std-%{sta
4141
Source5: https://static.rust-lang.org/dist/%{release_date}/cargo-%{stage0_version}-aarch64-unknown-linux-gnu.tar.xz
4242
Source6: https://static.rust-lang.org/dist/%{release_date}/rustc-%{stage0_version}-aarch64-unknown-linux-gnu.tar.xz
4343
Source7: https://static.rust-lang.org/dist/%{release_date}/rust-std-%{stage0_version}-aarch64-unknown-linux-gnu.tar.xz
44-
Patch0: CVE-2023-45853.patch
45-
Patch1: CVE-2024-32884.patch
46-
Patch2: CVE-2024-31852.patch
47-
44+
# These ci tests are expecting rust source to be git repository, since we are using a tarball
45+
# we are missing git metadata so these tests are failing, hence ignoring these tests
46+
Patch0: Ignore_failing_ci_tests.patch
47+
Patch100: CVE-2024-9681.patch
4848
BuildRequires: binutils
4949
BuildRequires: cmake
5050
# make sure rust relies on curl from CBL-Mariner (instead of using its vendored flavor)
@@ -61,6 +61,7 @@ BuildRequires: openssl-devel
6161
BuildRequires: python3
6262
%if 0%{?with_check}
6363
BuildRequires: glibc-static >= 2.38-9%{?dist}
64+
BuildRequires: sudo
6465
%endif
6566
# rustc uses a C compiler to invoke the linker, and links to glibc in most cases
6667
Requires: binutils
@@ -113,7 +114,7 @@ sh ./configure \
113114
--prefix=%{_prefix} \
114115
--enable-extended \
115116
--enable-profiler \
116-
--tools="cargo,clippy,rustfmt,rust-analyzer-proc-macro-srv,rust-demangler" \
117+
--tools="cargo,clippy,rustfmt,rust-analyzer-proc-macro-srv" \
117118
--release-channel="stable" \
118119
--release-description="Azure Linux %{version}-%{release}"
119120

@@ -125,21 +126,25 @@ USER=root SUDO_USER=root %make_build
125126
# We expect to generate dynamic CI contents in this folder, but it will fail since the .github folder is not included
126127
# with the published sources.
127128
mkdir -p .github/workflows
128-
./x.py run src/tools/expand-yaml-anchors
129129

130130
ln -s %{_topdir}/BUILD/rustc-%{version}-src/build/x86_64-unknown-linux-gnu/stage2-tools-bin/rustfmt %{_topdir}/BUILD/rustc-%{version}-src/build/x86_64-unknown-linux-gnu/stage0/bin/
131131
ln -s %{_topdir}/BUILD/rustc-%{version}-src/vendor/ /root/vendor
132+
# Since mariner has `aarch64-unknown-linux-gnu-gcc` as native compiler in arm64 and a ptest is expecting `aarch64-linux-gnu-gcc`
133+
ln -s /usr/bin/aarch64-unknown-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc
132134
# remove rustdoc ui flaky test issue-98690.rs (which is tagged with 'unstable-options')
133-
rm -v ./tests/rustdoc-ui/issue-98690.*
134-
%make_build check
135-
135+
rm -v ./tests/rustdoc-ui/issues/issue-98690.*
136+
useradd -m -d /home/test test
137+
chown -R test:test .
138+
sudo -u test %make_build check
139+
userdel -r test
136140
%install
137141
USER=root SUDO_USER=root %make_install
138-
mv %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY .
139-
rm %{buildroot}%{_docdir}/%{name}/{COPYRIGHT,LICENSE-APACHE,LICENSE-MIT}
140-
rm %{buildroot}%{_docdir}/%{name}/html/.lock
141-
rm %{buildroot}%{_docdir}/%{name}/*.old
142-
rm %{buildroot}%{_bindir}/*.old
142+
mv %{buildroot}%{_docdir}/cargo/LICENSE-THIRD-PARTY .
143+
rm %{buildroot}%{_docdir}/rustc/{COPYRIGHT,LICENSE-APACHE,LICENSE-MIT}
144+
rm %{buildroot}%{_docdir}/cargo/{LICENSE-APACHE,LICENSE-MIT}
145+
rm %{buildroot}%{_docdir}/clippy/{LICENSE-APACHE,LICENSE-MIT}
146+
rm %{buildroot}%{_docdir}/rustfmt/{LICENSE-APACHE,LICENSE-MIT}
147+
rm %{buildroot}%{_docdir}/docs/html/.lock
143148

144149
%ldconfig_scriptlets
145150

@@ -153,7 +158,6 @@ rm %{buildroot}%{_bindir}/*.old
153158
%{_libexecdir}/rust-analyzer-proc-macro-srv
154159
%{_bindir}/rust-gdb
155160
%{_bindir}/rust-gdbgui
156-
%{_bindir}/rust-demangler
157161
%{_bindir}/cargo
158162
%{_bindir}/cargo-clippy
159163
%{_bindir}/cargo-fmt
@@ -164,14 +168,25 @@ rm %{buildroot}%{_bindir}/*.old
164168

165169
%files doc
166170
%license LICENSE-APACHE LICENSE-MIT LICENSE-THIRD-PARTY COPYRIGHT
167-
%doc %{_docdir}/%{name}/html/*
168-
%doc %{_docdir}/%{name}/README.md
171+
%doc %{_docdir}/rustc/README.md
172+
%doc %{_docdir}/cargo/*
173+
%doc %{_docdir}/rustfmt/*
174+
%doc %{_docdir}/clippy/*
175+
%doc %{_docdir}/docs/html/*
169176
%doc CONTRIBUTING.md README.md RELEASES.md
170177
%doc src/tools/clippy/CHANGELOG.md
171178
%doc src/tools/rustfmt/Configurations.md
172179
%{_mandir}/man1/*
173180

174181
%changelog
182+
* Thu Feb 27 2025 Kavya Sree Kaitepalli <kkaitepalli@microsoft.com> - 1.85.0-1
183+
- Upgrade to 1.85.0
184+
- Drop patches
185+
- Remove expand-yaml-anchors tool in %check
186+
- Remove rust-demangler tool
187+
- Update generate_source_tarball script
188+
- Run %check as test user
189+
175190
* Thu Feb 27 2025 Chris Co <chrco@microsoft.com> - 1.75.0-12
176191
- Bump to rebuild with updated glibc
177192

0 commit comments

Comments
 (0)
Please sign in to comment.