b03182a8ff
Stabilize cache-messages This stabilizes the -Zcache-messages feature, making it always enabled. ## What is stabilized? This feature is intended to redisplay previous warnings on a "fresh" build instead of displaying no output. Users have occasionally indicated frustration when they know there are warnings, but no output is displayed when the build is fresh. This also improves the interaction between `cargo check` and `cargo clippy-preview`. This also simplifies the code, and opens more possibilities for `rustc` to send side-channel messages to Cargo. Cargo will now use JSON output from `rustc` and `rustdoc` 100% of the time (`rustdoc --test` does not use JSON). Previously Cargo would only use JSON for pipelined crates. Cargo will save the JSON output into a file named `output` in the `.fingerprint` directory. This file is only created when the compiler outputs a diagnostic message. If a crate is being recompiled, and Cargo considers it to be "fresh", it will replay the output file to the console. ## Notable changes in this PR - Fixed a bug where replays were erroneously including pipeline rmeta artifact json messages. - clippy-preview is now included in the metadata hash, to force its artifacts to be separate from `cargo check`. - clippy-preview is no longer force-enabled, under the assumption that caching and fingerprinting is accurate, and the cached messages will be replayed. - clippy-preview's arguments are included in the fingerprint now that it is not force-enabled. - Rustdoc colors and short messages were fixed when pipelining was stabilized, so updated tests. Closes #6986 Closes #6848 Closes #6664 Closes #2458 ## Concerns The only notable issue with this is that switching between short and long human messages only replays the format from the first invocation. That is, if you do `cargo build` and it generates warnings, then running again with `--message-format=short` will still show the full length human messages. I'm personally fine with that behavior, even though it is not ideal. I think this feature overall improves the situation (where before *no* output was displayed). Being able to re-render between short/long is a very difficult problem, and unlikely to be fixable in the foreseeable future. There was some concern expressed about being able to disable this. I think that would only be necessary if a severe bug is discovered. I do not feel that this change is risky enough to warrant a configurable option. If it does cause a problem, it can be quickly reverted with a one-line change to set `OutputOptions::cache_cell` to `None`. Since pipelining has been using JSON output for a while now without complaints, I feel pretty confident in it. |
||
---|---|---|
.github/ISSUE_TEMPLATE | ||
ci | ||
crates | ||
src | ||
tests | ||
.gitignore | ||
ARCHITECTURE.md | ||
azure-pipelines.yml | ||
Cargo.toml | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
LICENSE-THIRD-PARTY | ||
publish.py | ||
README.md |
Cargo
Cargo downloads your Rust project’s dependencies and compiles your project.
Learn more at https://doc.rust-lang.org/cargo/
Code Status
Code documentation: https://docs.rs/cargo/
Installing Cargo
Cargo is distributed by default with Rust, so if you've got rustc
installed
locally you probably also have cargo
installed locally.
Compiling from Source
Cargo requires the following tools and packages to build:
git
python
curl
(on Unix)pkg-config
(on Unix, used to figure out thelibssl
headers/libraries)- OpenSSL headers (only for Unix, this is the
libssl-dev
package on ubuntu) cargo
andrustc
First, you'll want to check out this repository
git clone https://github.com/rust-lang/cargo
cd cargo
With cargo
already installed, you can simply run:
cargo build --release
Adding new subcommands to Cargo
Cargo is designed to be extensible with new subcommands without having to modify Cargo itself. See the Wiki page for more details and a list of known community-developed subcommands.
Releases
Cargo releases coincide with Rust releases. High level release notes are available as part of Rust's release notes. Detailed release notes are available in this repo at CHANGELOG.md.
Reporting issues
Found a bug? We'd love to know about it!
Please report all issues on the GitHub issue tracker.
Contributing
See CONTRIBUTING.md. You may also find the architecture documentation useful (ARCHITECTURE.md).
License
Cargo is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.
Third party software
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (https://www.openssl.org/).
In binary form, this product includes software that is licensed under the terms of the GNU General Public License, version 2, with a linking exception, which can be obtained from the upstream repository.
See LICENSE-THIRD-PARTY for details.