2016-09-02 10:55:29 +02:00
|
|
|
[workspace]
|
|
|
|
members = [
|
2018-08-22 04:50:46 +02:00
|
|
|
"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/rustdoc-themes",
|
2018-07-26 23:58:55 +02:00
|
|
|
]
|
|
|
|
exclude = [
|
2018-11-25 13:59:52 +01:00
|
|
|
"build",
|
2018-11-25 22:15:20 +01:00
|
|
|
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
|
|
|
|
"obj",
|
2017-04-20 23:32:54 +02:00
|
|
|
]
|
|
|
|
|
2018-07-14 17:04:33 +02:00
|
|
|
# Curiously, LLVM 7.0 will segfault if compiled with opt-level=3
|
|
|
|
# See issue https://github.com/rust-lang/rust/issues/52378
|
|
|
|
[profile.release]
|
|
|
|
opt-level = 2
|
|
|
|
[profile.bench]
|
|
|
|
opt-level = 2
|
|
|
|
|
2016-11-16 18:19:02 +01:00
|
|
|
# These options are controlled from our rustc wrapper script, so turn them off
|
|
|
|
# here and have them controlled elsewhere.
|
|
|
|
[profile.dev]
|
|
|
|
debug = false
|
|
|
|
debug-assertions = false
|
|
|
|
[profile.test]
|
|
|
|
debug = false
|
|
|
|
debug-assertions = false
|
2017-04-30 01:11:58 +02:00
|
|
|
|
2018-01-08 22:56:22 +01:00
|
|
|
# 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.
|
2017-09-12 02:17:31 +02:00
|
|
|
[patch."https://github.com/rust-lang/cargo"]
|
2018-08-22 04:50:46 +02:00
|
|
|
cargo = { path = "src/tools/cargo" }
|
2017-09-01 07:13:15 +02:00
|
|
|
|
2018-07-31 23:16:55 +02:00
|
|
|
[patch.crates-io]
|
2018-01-08 22:56:22 +01:00
|
|
|
# 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
|
2018-07-09 10:04:28 +02:00
|
|
|
# `rustfmt` executable are the same exact version).
|
2018-08-22 04:50:46 +02:00
|
|
|
rustfmt-nightly = { path = "src/tools/rustfmt" }
|
2018-07-09 10:04:28 +02:00
|
|
|
|
2018-08-22 04:50:46 +02:00
|
|
|
# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on
|
2018-07-31 23:16:55 +02:00
|
|
|
# here
|
2018-08-22 04:50:46 +02:00
|
|
|
rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
|
2018-07-31 23:16:55 +02:00
|
|
|
|
std: Depend directly on crates.io crates
Ever since we added a Cargo-based build system for the compiler the
standard library has always been a little special, it's never been able
to depend on crates.io crates for runtime dependencies. This has been a
result of various limitations, namely that Cargo doesn't understand that
crates from crates.io depend on libcore, so Cargo tries to build crates
before libcore is finished.
I had an idea this afternoon, however, which lifts the strategy
from #52919 to directly depend on crates.io crates from the standard
library. After all is said and done this removes a whopping three
submodules that we need to manage!
The basic idea here is that for any crate `std` depends on it adds an
*optional* dependency on an empty crate on crates.io, in this case named
`rustc-std-workspace-core`. This crate is overridden via `[patch]` in
this repository to point to a local crate we write, and *that* has a
`path` dependency on libcore.
Note that all `no_std` crates also depend on `compiler_builtins`, but if
we're not using submodules we can publish `compiler_builtins` to
crates.io and all crates can depend on it anyway! The basic strategy
then looks like:
* The standard library (or some transitive dep) decides to depend on a
crate `foo`.
* The standard library adds
```toml
[dependencies]
foo = { version = "0.1", features = ['rustc-dep-of-std'] }
```
* The crate `foo` has an optional dependency on `rustc-std-workspace-core`
* The crate `foo` has an optional dependency on `compiler_builtins`
* The crate `foo` has a feature `rustc-dep-of-std` which activates these
crates and any other necessary infrastructure in the crate.
A sample commit for `dlmalloc` [turns out to be quite simple][commit].
After that all `no_std` crates should largely build "as is" and still be
publishable on crates.io! Notably they should be able to continue to use
stable Rust if necessary, since the `rename-dependency` feature of Cargo
is soon stabilizing.
As a proof of concept, this commit removes the `dlmalloc`,
`libcompiler_builtins`, and `libc` submodules from this repository. Long
thorns in our side these are now gone for good and we can directly
depend on crates.io! It's hoped that in the long term we can bring in
other crates as necessary, but for now this is largely intended to
simply make it easier to manage these crates and remove submodules.
This should be a transparent non-breaking change for all users, but one
possible stickler is that this almost for sure breaks out-of-tree
`std`-building tools like `xargo` and `cargo-xbuild`. I think it should
be relatively easy to get them working, however, as all that's needed is
an entry in the `[patch]` section used to build the standard library.
Hopefully we can work with these tools to solve this problem!
[commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-11-20 06:52:50 +01:00
|
|
|
# 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' }
|
|
|
|
|
2018-12-01 11:36:32 +01:00
|
|
|
[patch."https://github.com/rust-lang/rust-clippy"]
|
2018-08-22 04:50:46 +02:00
|
|
|
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
|