mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 08:05:12 +00:00
3dfbf0bc73
This commit moves the compiler-builtins-specific build logic from `src/bootstrap/bin/rustc.rs` into the workspace `Cargo.toml`'s `[profile]` configuration. Now that rust-lang/cargo#7253 is fixed we can ensure that Cargo knows about debug assertions settings, and it can also be configured to specifically disable debug assertions unconditionally for compiler-builtins. This should improve rebuild logic when debug-assertions settings change and also improve build-std integration where Cargo externally now has an avenue to learn how to build compiler-builtins as well.
84 lines
3.2 KiB
TOML
84 lines
3.2 KiB
TOML
[workspace]
|
|
members = [
|
|
"src/bootstrap",
|
|
"src/rustc",
|
|
"src/libstd",
|
|
"src/libtest",
|
|
"src/librustc_codegen_llvm",
|
|
"src/tools/cargotest",
|
|
"src/tools/clippy",
|
|
"src/tools/compiletest",
|
|
"src/tools/error_index_generator",
|
|
"src/tools/linkchecker",
|
|
"src/tools/rustbook",
|
|
"src/tools/unstable-book-gen",
|
|
"src/tools/tidy",
|
|
"src/tools/build-manifest",
|
|
"src/tools/remote-test-client",
|
|
"src/tools/remote-test-server",
|
|
"src/tools/rust-installer",
|
|
"src/tools/cargo",
|
|
"src/tools/rustdoc",
|
|
"src/tools/rls",
|
|
"src/tools/rustfmt",
|
|
"src/tools/miri",
|
|
"src/tools/miri/cargo-miri",
|
|
"src/tools/rustdoc-themes",
|
|
"src/tools/unicode-table-generator",
|
|
"src/tools/expand-yaml-anchors",
|
|
]
|
|
exclude = [
|
|
"build",
|
|
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
|
|
"obj",
|
|
]
|
|
|
|
[profile.release.package.compiler_builtins]
|
|
# The compiler-builtins crate cannot reference libcore, and it's own CI will
|
|
# verify that this is the case. This requires, however, that the crate is built
|
|
# without overflow checks and debug assertions. Forcefully disable debug
|
|
# assertions and overflow checks here which should ensure that even if these
|
|
# assertions are enabled for libstd we won't enable then for compiler_builtins
|
|
# which should ensure we still link everything correctly.
|
|
debug-assertions = false
|
|
overflow-checks = false
|
|
|
|
# For compiler-builtins we always use a high number of codegen units.
|
|
# The goal here is to place every single intrinsic into its own object
|
|
# file to avoid symbol clashes with the system libgcc if possible. Note
|
|
# that this number doesn't actually produce this many object files, we
|
|
# just don't create more than this number of object files.
|
|
#
|
|
# It's a bit of a bummer that we have to pass this here, unfortunately.
|
|
# Ideally this would be specified through an env var to Cargo so Cargo
|
|
# knows how many CGUs are for this specific crate, but for now
|
|
# per-crate configuration isn't specifiable in the environment.
|
|
codegen-units = 10000
|
|
|
|
# We want the RLS to use the version of Cargo that we've got vendored in this
|
|
# repository to ensure that the same exact version of Cargo is used by both the
|
|
# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository
|
|
# so we use a `[patch]` here to override the github repository with our local
|
|
# vendored copy.
|
|
[patch."https://github.com/rust-lang/cargo"]
|
|
cargo = { path = "src/tools/cargo" }
|
|
|
|
[patch.crates-io]
|
|
# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt`
|
|
# that we're shipping as well (to ensure that the rustfmt in RLS and the
|
|
# `rustfmt` executable are the same exact version).
|
|
rustfmt-nightly = { path = "src/tools/rustfmt" }
|
|
|
|
# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on
|
|
# here
|
|
rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
|
|
|
|
# See comments in `tools/rustc-std-workspace-core/README.md` for what's going on
|
|
# here
|
|
rustc-std-workspace-core = { path = 'src/tools/rustc-std-workspace-core' }
|
|
rustc-std-workspace-alloc = { path = 'src/tools/rustc-std-workspace-alloc' }
|
|
rustc-std-workspace-std = { path = 'src/tools/rustc-std-workspace-std' }
|
|
|
|
[patch."https://github.com/rust-lang/rust-clippy"]
|
|
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
|