Skip to content

Commit 129ec0d

Browse files
committed
Write stdlib workspace Cargo.toml directly in prepare.rs
1 parent 9bcbe29 commit 129ec0d

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-26
lines changed

build_sysroot/Cargo.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.

build_system/prepare.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,39 @@ fn prepare_stdlib(dirs: &Dirs, rustc: &Path) {
2929
// FIXME ensure builds error out or update the copy if any of the files copied here change
3030
copy_dir_recursively(&ORIG_BUILD_SYSROOT.to_path(dirs), &STDLIB_SRC.to_path(dirs));
3131

32+
std::fs::write(
33+
STDLIB_SRC.to_path(dirs).join("Cargo.toml"),
34+
r#"
35+
[workspace]
36+
members = ["./library/sysroot"]
37+
38+
[patch.crates-io]
39+
rustc-std-workspace-core = { path = "./library/rustc-std-workspace-core" }
40+
rustc-std-workspace-alloc = { path = "./library/rustc-std-workspace-alloc" }
41+
rustc-std-workspace-std = { path = "./library/rustc-std-workspace-std" }
42+
43+
[profile.dev]
44+
lto = "off"
45+
46+
[profile.release]
47+
debug = true
48+
incremental = true
49+
lto = "off"
50+
51+
# Mandatory for correctly compiling compiler-builtins
52+
[profile.dev.package.compiler_builtins]
53+
debug-assertions = false
54+
overflow-checks = false
55+
codegen-units = 10000
56+
57+
[profile.release.package.compiler_builtins]
58+
debug-assertions = false
59+
overflow-checks = false
60+
codegen-units = 10000
61+
"#,
62+
)
63+
.unwrap();
64+
3265
let rustc_version = get_rustc_version(rustc);
3366
fs::write(SYSROOT_RUSTC_VERSION.to_path(dirs), &rustc_version).unwrap();
3467
}

0 commit comments

Comments
 (0)