Skip to content

Commit 533325d

Browse files
feat(rust): upgrade to 1.75.0-dev
TODO: Update the Rust fork with the changes. Signed-off-by: Anhad Singh <[email protected]>
1 parent 5173571 commit 533325d

File tree

4 files changed

+85
-748
lines changed

4 files changed

+85
-748
lines changed

bootstrap.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ sources:
7373

7474
- name: rust
7575
subdir: 'bundled'
76-
git: 'https://github.com/rust-lang/rust.git'
76+
git: 'https://github.com/aero-os/rust.git'
7777
branch: 'master'
78-
commit: '0416b1a6f6d5c42696494e1a3a33580fd3f669d8'
78+
commit: 'dee2030a44019048171c03d7ddcb134b945df8c5'
7979

8080
- name: llvm
8181
subdir: 'bundled'
@@ -386,19 +386,20 @@ tools:
386386
compile:
387387
- args: |
388388
cat << EOF > config.toml
389-
changelog-seen = 2
389+
change-id = 115898
390390
391391
[llvm]
392392
download-ci-llvm = false
393393
targets = "X86"
394394
395395
[build]
396-
target = ["x86_64-unknown-aero-system", "x86_64-unknown-linux-gnu"]
396+
target = ["x86_64-unknown-aero", "x86_64-unknown-linux-gnu"]
397397
build-dir = "@THIS_BUILD_DIR@"
398398
docs = false
399399
400400
[install]
401401
prefix = "@PREFIX@"
402+
sysconfdir = "@PREFIX@/etc"
402403
403404
[rust]
404405
codegen-tests = false
@@ -407,7 +408,7 @@ tools:
407408
[target.x86_64-unknown-linux-gnu]
408409
llvm-config = "@BUILD_ROOT@/tools/host-llvm/bin/llvm-config"
409410
410-
[target.x86_64-unknown-aero-system]
411+
[target.x86_64-unknown-aero]
411412
llvm-config = "@BUILD_ROOT@/tools/host-llvm/bin/llvm-config"
412413
EOF
413414
- args: ['python3', '@THIS_SOURCE_DIR@/x.py', 'build', '--stage', '2', '-j', '@PARALLELISM@']

extra-files/rust/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ patch-in-config = true
33

44
[build]
55
rustc = "@BUILD_ROOT@/tools/host-rust/bin/rustc"
6-
target = "x86_64-unknown-aero-system"
6+
target = "x86_64-unknown-aero"
77
rustflags = ["-C", "link-args=-no-pie"]
88

9-
[target.x86_64-unknown-aero-system]
9+
[target.x86_64-unknown-aero]
1010
linker = "@BUILD_ROOT@/tools/host-gcc/bin/x86_64-aero-gcc"
1111

1212
[patch.crates-io]
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
From 1f0ded570575781c7e8dbd0d60c57a2ec72ec987 Mon Sep 17 00:00:00 2001
2+
From: Anhad Singh <[email protected]>
3+
Date: Wed, 18 Oct 2023 19:23:49 +1100
4+
Subject: [PATCH] fix(bootstrap): build target in x.py and bootstrap
5+
6+
Signed-off-by: Anhad Singh <[email protected]>
7+
---
8+
src/bootstrap/bootstrap.py | 7 +++++--
9+
src/bootstrap/src/core/builder.rs | 6 ++++--
10+
2 files changed, 9 insertions(+), 4 deletions(-)
11+
12+
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
13+
index 1a1125a107f..3f3171a9ddf 100644
14+
--- a/src/bootstrap/bootstrap.py
15+
+++ b/src/bootstrap/bootstrap.py
16+
@@ -881,7 +881,7 @@ class RustBuild(object):
17+
... "debug", "bootstrap")
18+
True
19+
"""
20+
- return os.path.join(self.build_dir, "bootstrap", "debug", "bootstrap")
21+
+ return os.path.join(self.build_dir, "bootstrap", self.build, "debug", "bootstrap")
22+
23+
def build_bootstrap(self):
24+
"""Build bootstrap"""
25+
@@ -903,7 +903,7 @@ class RustBuild(object):
26+
build_dir = os.path.join(self.build_dir, "bootstrap")
27+
if self.clean and os.path.exists(build_dir):
28+
shutil.rmtree(build_dir)
29+
- # `CARGO_BUILD_TARGET` breaks bootstrap build.
30+
+ # `CARGO_BUILD_TARGET` and `build.target` breaks bootstrap build.
31+
# See also: <https://github.com/rust-lang/rust/issues/70208>.
32+
if "CARGO_BUILD_TARGET" in env:
33+
del env["CARGO_BUILD_TARGET"]
34+
@@ -987,6 +987,9 @@ class RustBuild(object):
35+
except KeyError:
36+
pass
37+
38+
+ args.append("--target")
39+
+ args.append(self.build)
40+
+
41+
return args
42+
43+
def build_triple(self):
44+
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
45+
index 039a87e760d..cbbbce4f515 100644
46+
--- a/src/bootstrap/src/core/builder.rs
47+
+++ b/src/bootstrap/src/core/builder.rs
48+
@@ -1587,6 +1587,8 @@ pub fn cargo(
49+
self.clear_if_dirty(&out_dir, &self.rustc(compiler));
50+
}
51+
52+
+ let artifact_dir = self.out.join("bootstrap/").join(self.build.build.triple).join("debug/");
53+
+
54+
// Customize the compiler we're running. Specify the compiler to cargo
55+
// as our shim and then pass it some various options used to configure
56+
// how the actual compiler itself is called.
57+
@@ -1599,7 +1601,7 @@ pub fn cargo(
58+
.env("RUSTC_STAGE", stage.to_string())
59+
.env("RUSTC_SYSROOT", &sysroot)
60+
.env("RUSTC_LIBDIR", &libdir)
61+
- .env("RUSTDOC", self.bootstrap_out.join("rustdoc"))
62+
+ .env("RUSTDOC", artifact_dir.join("rustdoc"))
63+
.env(
64+
"RUSTDOC_REAL",
65+
if cmd == "doc" || cmd == "rustdoc" || (cmd == "test" && want_rustdoc) {
66+
@@ -1613,7 +1615,7 @@ pub fn cargo(
67+
// Clippy support is a hack and uses the default `cargo-clippy` in path.
68+
// Don't override RUSTC so that the `cargo-clippy` in path will be run.
69+
if cmd != "clippy" {
70+
- cargo.env("RUSTC", self.bootstrap_out.join("rustc"));
71+
+ cargo.env("RUSTC", artifact_dir.join("rustc"));
72+
}
73+
74+
// Dealing with rpath here is a little special, so let's go into some
75+
--
76+
2.42.0
77+

0 commit comments

Comments
 (0)