2016-09-02 08:55:29 +00:00
|
|
|
[workspace]
|
|
|
|
members = [
|
2018-08-22 02:50:46 +00:00
|
|
|
"src/bootstrap",
|
|
|
|
"src/rustc",
|
|
|
|
"src/librustc_codegen_llvm",
|
2020-06-12 02:31:49 +00:00
|
|
|
"library/std",
|
|
|
|
"library/test",
|
2018-08-22 02:50:46 +00:00
|
|
|
"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",
|
2020-07-02 18:27:15 +00:00
|
|
|
"src/tools/rust-demangler",
|
2018-08-22 02:50:46 +00:00
|
|
|
"src/tools/cargo",
|
|
|
|
"src/tools/rustdoc",
|
|
|
|
"src/tools/rls",
|
|
|
|
"src/tools/rustfmt",
|
|
|
|
"src/tools/miri",
|
2020-06-01 18:17:20 +00:00
|
|
|
"src/tools/miri/cargo-miri",
|
2018-08-22 02:50:46 +00:00
|
|
|
"src/tools/rustdoc-themes",
|
2020-01-13 21:40:19 +00:00
|
|
|
"src/tools/unicode-table-generator",
|
2019-11-26 11:06:30 +00:00
|
|
|
"src/tools/expand-yaml-anchors",
|
2018-07-26 21:58:55 +00:00
|
|
|
]
|
|
|
|
exclude = [
|
2018-11-25 12:59:52 +00:00
|
|
|
"build",
|
2018-11-25 21:15:20 +00:00
|
|
|
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
|
|
|
|
"obj",
|
2017-04-20 21:32:54 +00:00
|
|
|
]
|
|
|
|
|
2020-06-15 14:54:20 +00:00
|
|
|
[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.
|
2016-11-16 17:19:02 +00:00
|
|
|
debug-assertions = false
|
2020-06-15 14:54:20 +00:00
|
|
|
overflow-checks = false
|
2017-04-29 23:11:58 +00:00
|
|
|
|
2020-06-08 16:02:57 +00:00
|
|
|
# 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
|
|
|
|
|
2018-01-08 21:56:22 +00: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 00:17:31 +00:00
|
|
|
[patch."https://github.com/rust-lang/cargo"]
|
2018-08-22 02:50:46 +00:00
|
|
|
cargo = { path = "src/tools/cargo" }
|
2017-09-01 05:13:15 +00:00
|
|
|
|
2018-07-31 21:16:55 +00:00
|
|
|
[patch.crates-io]
|
2018-01-08 21:56:22 +00: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 08:04:28 +00:00
|
|
|
# `rustfmt` executable are the same exact version).
|
2018-08-22 02:50:46 +00:00
|
|
|
rustfmt-nightly = { path = "src/tools/rustfmt" }
|
2018-07-09 08:04:28 +00:00
|
|
|
|
2018-08-22 02:50:46 +00:00
|
|
|
# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on
|
2018-07-31 21:16:55 +00:00
|
|
|
# here
|
2018-08-22 02:50:46 +00:00
|
|
|
rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
|
2018-07-31 21:16:55 +00:00
|
|
|
|
2020-06-12 02:31:49 +00:00
|
|
|
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
|
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 05:52:50 +00:00
|
|
|
# here
|
2020-06-12 02:31:49 +00:00
|
|
|
rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
|
|
|
|
rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
|
|
|
|
rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
|
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 05:52:50 +00:00
|
|
|
|
2018-12-01 10:36:32 +00:00
|
|
|
[patch."https://github.com/rust-lang/rust-clippy"]
|
2018-08-22 02:50:46 +00:00
|
|
|
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
|