Skip to content

Commit

Permalink
Move enabling the cranelift backend to ci/run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jul 26, 2023
1 parent b9dd977 commit 3c2fc10
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ changelog-seen = 2
# and currently the only standard options supported are `"llvm"`, `"cranelift"`
# and `"gcc"`. The first backend in this list will be used as default by rustc
# when no explicit backend is specified.
#codegen-backends = ["llvm", "cranelift"]
#codegen-backends = ["llvm"]

# Indicates whether LLD will be compiled and made available in the sysroot for
# rustc to execute.
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,7 @@ impl Config {
config.channel = "dev".to_string();
config.codegen_tests = true;
config.rust_dist_src = true;
config.rust_codegen_backends =
vec![INTERNER.intern_str("llvm"), INTERNER.intern_str("cranelift")];
config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")];
config.deny_warnings = true;
config.bindir = "bin".into();
config.dist_include_mingw_linker = true;
Expand Down
2 changes: 0 additions & 2 deletions src/bootstrap/defaults/config.dist.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ download-ci-llvm = false
# Make sure they don't get set when installing from source.
channel = "nightly"
download-rustc = false
# Skip building the cranelift backend. It isn't ready to be shipped yet.
codegen-backends = ["llvm"]

[dist]
# Use better compression when preparing tarballs.
Expand Down
13 changes: 13 additions & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,19 @@ impl Step for Rustc {
}
}

// Copy over the codegen backends
let backends_src = builder.sysroot_codegen_backends(compiler);
let backends_rel = backends_src
.strip_prefix(&src)
.unwrap()
.strip_prefix(builder.sysroot_libdir_relative(compiler))
.unwrap();
// Don't use custom libdir here because ^lib/ will be resolved again with installer
let backends_dst = image.join("lib").join(&backends_rel);

t!(fs::create_dir_all(&backends_dst));
builder.cp_r(&backends_src, &backends_dst);

// Copy libLLVM.so to the lib dir as well, if needed. While not
// technically needed by rustc itself it's needed by lots of other
// components like the llvm tools and LLD. LLD is included below and
Expand Down
3 changes: 3 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ else

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

# Test the Cranelift backend in on CI, but don't ship it.
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=llvm,cranelift"

# We enable this for non-dist builders, since those aren't trying to produce
# fresh binaries. We currently don't entirely support distributing a fresh
# copy of the compiler (including llvm tools, etc.) if we haven't actually
Expand Down

0 comments on commit 3c2fc10

Please sign in to comment.