X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=Cargo.toml;h=4e78399606445837adb68b0d7b0789c77a218a03;hb=2b76da86ef940a54bac9aee77f54d0ae39e065f6;hp=764714638a9787c214227c4580ea4203442f071f;hpb=a36dc368d7c914014356c3d1f240f2caaf4692c2;p=rust.git diff --git a/Cargo.toml b/Cargo.toml index 764714638a9..4e783996064 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,66 +1,136 @@ -[package] +[workspace] +default-members = ["src/bootstrap"] +members = [ + "src/bootstrap", + "compiler/rustc", + "library/std", + "library/test", + "src/rustdoc-json-types", + "src/tools/cargotest", + "src/tools/clippy", + "src/tools/clippy/clippy_dev", + "src/tools/compiletest", + "src/tools/error_index_generator", + "src/tools/linkchecker", + "src/tools/lint-docs", + "src/tools/rustbook", + "src/tools/unstable-book-gen", + "src/tools/tidy", + "src/tools/tier-check", + "src/tools/build-manifest", + "src/tools/remote-test-client", + "src/tools/remote-test-server", + "src/tools/rust-installer", + "src/tools/rust-demangler", + "src/tools/cargo", + "src/tools/cargo/crates/credential/cargo-credential-1password", + "src/tools/cargo/crates/credential/cargo-credential-macos-keychain", + "src/tools/cargo/crates/credential/cargo-credential-wincred", + "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", + "src/tools/jsondocck", + "src/tools/html-checker", + "src/tools/bump-stage0", + "src/tools/lld-wrapper", +] -name = "rustfmt-nightly" -version = "1.4.38" -description = "Tool to find and fix Rust formatting issues" -repository = "https://github.com/rust-lang/rustfmt" -readme = "README.md" -license = "Apache-2.0/MIT" -build = "build.rs" -categories = ["development-tools"] -edition = "2021" +exclude = [ + "build", + "compiler/rustc_codegen_cranelift", + "compiler/rustc_codegen_gcc", + "src/test/rustdoc-gui", + # HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`. + "obj", + # The `x` binary is a thin wrapper that calls `x.py`, which initializes + # submodules, before which workspace members cannot be invoked because + # not all `Cargo.toml` files are available, so we exclude the `x` binary, + # so it can be invoked before the current checkout is set up. + "src/tools/x", + # stdarch has its own Cargo workspace + "library/stdarch", +] -[[bin]] -name = "rustfmt" -path = "src/bin/main.rs" +[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 -[[bin]] -name = "cargo-fmt" -path = "src/cargo-fmt/main.rs" +# 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 -[[bin]] -name = "rustfmt-format-diff" -path = "src/format-diff/main.rs" +[profile.release.package.rustc-rayon-core] +# The rustc fork of Rayon has deadlock detection code which intermittently +# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227) +# so we turn overflow checks off for now. +# FIXME: This workaround should be removed once #90227 is fixed. +overflow-checks = false -[[bin]] -name = "git-rustfmt" -path = "src/git-rustfmt/main.rs" +# These dependencies of the standard library implement symbolication for +# backtraces on most platforms. Their debuginfo causes both linking to be slower +# (more data to chew through) and binaries to be larger without really all that +# much benefit. This section turns them all to down to have no debuginfo which +# helps to improve link times a little bit. +[profile.release.package] +addr2line.debug = 0 +adler.debug = 0 +gimli.debug = 0 +miniz_oxide.debug = 0 +object.debug = 0 -[features] -default = ["cargo-fmt", "rustfmt-format-diff"] -cargo-fmt = [] -rustfmt-format-diff = [] -generic-simd = ["bytecount/generic-simd"] +# The only package that ever uses debug builds is bootstrap. +# We care a lot about bootstrap's compile times, so don't include debug info for +# dependencies, only bootstrap itself. +[profile.dev] +debug = 0 +[profile.dev.package] +# Only use debuginfo=1 to further reduce compile times. +bootstrap.debug = 1 -[dependencies] -itertools = "0.10.1" -toml = "0.5" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -unicode-segmentation = "1.0.0" -regex = "1.0" -term = "0.6" -diff = "0.1" -log = "0.4.14" -env_logger = "0.8" -getopts = "0.2" -derive-new = "0.5" -cargo_metadata = "0.14" -bytecount = "0.6" -unicode-width = "0.1.5" -unicode_categories = "0.1.1" -dirs = "2.0.1" -ignore = "0.4.17" -annotate-snippets = { version = "0.8", features = ["color"] } -structopt = "0.3" -rustfmt-config_proc_macro = { version = "0.2", path = "config_proc_macro" } -lazy_static = "1.0.0" -anyhow = "1.0" -thiserror = "1.0" +# 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" } +cargo-util = { path = "src/tools/cargo/crates/cargo-util" } -# A noop dependency that changes in the Rust repository, it's a bit of a hack. -# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` -# for more information. -rustc-workspace-hack = "1.0.0" +[patch."https://github.com/rust-lang/rustfmt"] +# 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" } -# Rustc dependencies are loaded from the sysroot, Cargo doesn't know about them. +[patch.crates-io] +# 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 `library/rustc-std-workspace-core/README.md` for what's going on +# here +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' } + +[patch."https://github.com/rust-lang/rust-clippy"] +clippy_lints = { path = "src/tools/clippy/clippy_lints" }