Skip to content

Commit 3c2fc10

Browse files
committed
Move enabling the cranelift backend to ci/run.sh
1 parent b9dd977 commit 3c2fc10

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

config.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ changelog-seen = 2
618618
# and currently the only standard options supported are `"llvm"`, `"cranelift"`
619619
# and `"gcc"`. The first backend in this list will be used as default by rustc
620620
# when no explicit backend is specified.
621-
#codegen-backends = ["llvm", "cranelift"]
621+
#codegen-backends = ["llvm"]
622622

623623
# Indicates whether LLD will be compiled and made available in the sysroot for
624624
# rustc to execute.

src/bootstrap/config.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,7 @@ impl Config {
10651065
config.channel = "dev".to_string();
10661066
config.codegen_tests = true;
10671067
config.rust_dist_src = true;
1068-
config.rust_codegen_backends =
1069-
vec![INTERNER.intern_str("llvm"), INTERNER.intern_str("cranelift")];
1068+
config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")];
10701069
config.deny_warnings = true;
10711070
config.bindir = "bin".into();
10721071
config.dist_include_mingw_linker = true;

src/bootstrap/defaults/config.dist.toml

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ download-ci-llvm = false
1616
# Make sure they don't get set when installing from source.
1717
channel = "nightly"
1818
download-rustc = false
19-
# Skip building the cranelift backend. It isn't ready to be shipped yet.
20-
codegen-backends = ["llvm"]
2119

2220
[dist]
2321
# Use better compression when preparing tarballs.

src/bootstrap/dist.rs

+13
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,19 @@ impl Step for Rustc {
445445
}
446446
}
447447

448+
// Copy over the codegen backends
449+
let backends_src = builder.sysroot_codegen_backends(compiler);
450+
let backends_rel = backends_src
451+
.strip_prefix(&src)
452+
.unwrap()
453+
.strip_prefix(builder.sysroot_libdir_relative(compiler))
454+
.unwrap();
455+
// Don't use custom libdir here because ^lib/ will be resolved again with installer
456+
let backends_dst = image.join("lib").join(&backends_rel);
457+
458+
t!(fs::create_dir_all(&backends_dst));
459+
builder.cp_r(&backends_src, &backends_dst);
460+
448461
// Copy libLLVM.so to the lib dir as well, if needed. While not
449462
// technically needed by rustc itself it's needed by lots of other
450463
// components like the llvm tools and LLD. LLD is included below and

src/ci/run.sh

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ else
123123

124124
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"
125125

126+
# Test the Cranelift backend in on CI, but don't ship it.
127+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=llvm,cranelift"
128+
126129
# We enable this for non-dist builders, since those aren't trying to produce
127130
# fresh binaries. We currently don't entirely support distributing a fresh
128131
# copy of the compiler (including llvm tools, etc.) if we haven't actually

0 commit comments

Comments
 (0)