Skip to content

Commit 326e8ab

Browse files
authored
Merge pull request #29 from RalfJung/builtins
support using the in-tree compiler_builtins
2 parents f452b2e + bb232de commit 326e8ab

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
rust:
1919
- nightly
2020
# Check a ~3 months old nightly as "oldest supported version"
21-
- nightly-2025-01-01
21+
- nightly-2025-05-01
2222
# We want to run all of the above on Linux, macOS, windows-msvc, windows-gnu.
2323
# The semantics of combining `include` with other things in GHA are very strange
2424
# so this seems like the best way of doing that.

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,21 @@ impl<'a> SysrootBuilder<'a> {
301301
fn gen_manifest(&self, src_dir: &Path) -> String {
302302
let have_sysroot_crate = src_dir.join("sysroot").exists();
303303
let crates = match &self.config {
304+
// As long as the sysroot has a ptch for compiler_builtins, we need to include it in the
305+
// NoStd variant explicitly.
304306
SysrootConfig::NoStd => format!(
305307
r#"
306308
[dependencies.core]
307309
path = {src_dir_core:?}
308310
[dependencies.alloc]
309311
path = {src_dir_alloc:?}
310312
[dependencies.compiler_builtins]
313+
path = {src_dir_builtins:?}
311314
features = ["rustc-dep-of-std", "mem"]
312-
version = "*"
313315
"#,
314316
src_dir_core = src_dir.join("core"),
315317
src_dir_alloc = src_dir.join("alloc"),
318+
src_dir_builtins = src_dir.join("compiler-builtins").join("compiler-builtins"),
316319
),
317320
SysrootConfig::WithStd { std_features } if have_sysroot_crate => format!(
318321
r#"
@@ -524,7 +527,7 @@ impl<'a> SysrootBuilder<'a> {
524527
TempDir::new_in(&self.sysroot_dir).context("failed to create staging dir")?;
525528
// Copy the output to `$staging/lib`.
526529
let staging_lib_dir = staging_dir.path().join("lib");
527-
fs::create_dir(&staging_lib_dir).context("faiked to create staging/lib dir")?;
530+
fs::create_dir(&staging_lib_dir).context("failed to create staging/lib dir")?;
528531
let out_dir = build_target_dir
529532
.join(&target_name)
530533
.join(DEFAULT_SYSROOT_PROFILE)

tests/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn json_target() {
9595
"llvm-target": "x86_64-unknown-none",
9696
"target-endian": "little",
9797
"target-pointer-width": "64",
98-
"target-c-int-width": "32",
98+
"target-c-int-width": 32,
9999
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
100100
"arch": "x86_64",
101101
"os": "none",

0 commit comments

Comments
 (0)