2021-04-13 19:25:13 +00:00
|
|
|
// See src/cargo/lib.rs for notes on these lint settings.
|
|
|
|
#![warn(rust_2018_idioms)]
|
2021-04-13 16:02:07 +00:00
|
|
|
#![allow(clippy::all)]
|
2019-03-27 00:53:53 +00:00
|
|
|
#![warn(clippy::needless_borrow)]
|
2019-03-27 01:51:13 +00:00
|
|
|
#![warn(clippy::redundant_clone)]
|
2021-04-13 16:02:07 +00:00
|
|
|
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
|
2018-03-16 09:32:31 +00:00
|
|
|
|
2019-05-02 21:58:52 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate cargo_test_macro;
|
|
|
|
|
2019-11-24 17:43:59 +00:00
|
|
|
mod advanced_env;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod alt_registry;
|
|
|
|
mod bad_config;
|
|
|
|
mod bad_manifest_path;
|
|
|
|
mod bench;
|
2021-06-26 12:21:55 +00:00
|
|
|
mod binary_name;
|
2018-08-28 09:20:03 +00:00
|
|
|
mod build;
|
2017-08-03 14:02:00 +00:00
|
|
|
mod build_plan;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod build_script;
|
2018-08-28 09:20:03 +00:00
|
|
|
mod build_script_env;
|
2020-07-02 09:45:41 +00:00
|
|
|
mod build_script_extra_link_arg;
|
2019-05-12 00:35:25 +00:00
|
|
|
mod cache_messages;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod cargo_alias_config;
|
2018-02-08 16:30:58 +00:00
|
|
|
mod cargo_command;
|
2021-03-25 19:56:24 +00:00
|
|
|
mod cargo_config;
|
2021-02-15 23:17:00 +00:00
|
|
|
mod cargo_env_config;
|
2018-08-28 09:20:03 +00:00
|
|
|
mod cargo_features;
|
2020-03-02 22:47:38 +00:00
|
|
|
mod cargo_targets;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod cfg;
|
|
|
|
mod check;
|
|
|
|
mod clean;
|
2018-11-12 15:13:13 +00:00
|
|
|
mod collisions;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod concurrent;
|
|
|
|
mod config;
|
2019-11-30 21:55:52 +00:00
|
|
|
mod config_cli;
|
2019-12-01 18:19:02 +00:00
|
|
|
mod config_include;
|
2018-03-02 17:44:47 +00:00
|
|
|
mod corrupt_git;
|
2020-12-01 19:16:16 +00:00
|
|
|
mod credential_process;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod cross_compile;
|
|
|
|
mod cross_publish;
|
2018-03-24 20:38:48 +00:00
|
|
|
mod custom_target;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod death;
|
|
|
|
mod dep_info;
|
|
|
|
mod directory;
|
|
|
|
mod doc;
|
2018-08-04 15:44:16 +00:00
|
|
|
mod edition;
|
2020-02-18 02:46:48 +00:00
|
|
|
mod error;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod features;
|
2019-09-10 22:38:01 +00:00
|
|
|
mod features2;
|
2020-10-19 23:51:02 +00:00
|
|
|
mod features_namespaced;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod fetch;
|
2018-07-14 01:49:26 +00:00
|
|
|
mod fix;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod freshness;
|
Implement future incompatibility report support
cc rust-lang/rust#71249
This implements the Cargo side of 'Cargo report future-incompat'
Based on feedback from alexcrichton and est31, I'm implemented this a
flag `--future-compat-report` on `cargo check/build/rustc`, rather than
a separate `cargo describe-future-incompatibilities` command. This
allows us to avoid writing additional information to disk (beyond the
pre-existing recording of rustc command outputs).
This PR contains:
* Gating of all functionality behind `-Z report-future-incompat`.
Without this flag, all user output is unchanged.
* Passing `-Z emit-future-incompat-report` to rustc when
`-Z report-future-incompat` is enabled
* Parsing the rustc JSON future incompat report, and displaying it
it a user-readable format.
* Emitting a warning at the end of a build if any crates had
future-incompat reports
* A `--future-incompat-report` flag, which shows the full report for
each affected crate.
* Tests for all of the above.
At the moment, we can use the `array_into_iter` to write a test.
However, we might eventually get to a point where rustc is not currently
emitting future-incompat reports for any lints. What would we want the
cargo tests to do in this situation?
This functionality didn't require any significant internal changes to
Cargo, with one exception: we now process captured command output for
all units, not just ones where we want to display warnings. This may
result in a slightly longer time to run `cargo build/check/rustc` from
a full cache. since we do slightly more work for each upstream
dependency. Doing this seems unavoidable with the current architecture,
since we need to process captured command outputs to detect
any future-incompat-report messages that were emitted.
2020-10-29 21:48:09 +00:00
|
|
|
mod future_incompat_report;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod generate_lockfile;
|
|
|
|
mod git;
|
2019-11-25 02:42:45 +00:00
|
|
|
mod git_auth;
|
|
|
|
mod git_gc;
|
2020-10-04 15:25:53 +00:00
|
|
|
mod glob_targets;
|
2020-07-06 00:51:22 +00:00
|
|
|
mod help;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod init;
|
|
|
|
mod install;
|
2019-03-31 00:33:35 +00:00
|
|
|
mod install_upgrade;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod jobserver;
|
2020-10-25 18:46:26 +00:00
|
|
|
mod list_availables;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod local_registry;
|
2019-12-10 00:18:12 +00:00
|
|
|
mod locate_project;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod lockfile_compat;
|
|
|
|
mod login;
|
2020-12-01 19:16:16 +00:00
|
|
|
mod logout;
|
2020-04-01 18:41:27 +00:00
|
|
|
mod lto;
|
2020-07-19 11:34:19 +00:00
|
|
|
mod member_discovery;
|
2018-10-09 13:05:10 +00:00
|
|
|
mod member_errors;
|
2019-08-05 16:42:28 +00:00
|
|
|
mod message_format;
|
2021-07-09 22:30:15 +00:00
|
|
|
mod messages;
|
2018-06-11 17:44:55 +00:00
|
|
|
mod metabuild;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod metadata;
|
2019-11-25 02:42:45 +00:00
|
|
|
mod minimal_versions;
|
2020-04-27 19:28:39 +00:00
|
|
|
mod multitarget;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod net_config;
|
|
|
|
mod new;
|
2019-04-23 22:13:55 +00:00
|
|
|
mod offline;
|
2021-02-10 18:58:07 +00:00
|
|
|
mod old_cargos;
|
2018-04-03 06:51:52 +00:00
|
|
|
mod out_dir;
|
2020-01-09 13:18:45 +00:00
|
|
|
mod owner;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod package;
|
2020-04-08 21:06:09 +00:00
|
|
|
mod package_features;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod patch;
|
|
|
|
mod path;
|
2019-11-25 02:42:45 +00:00
|
|
|
mod paths;
|
2019-12-24 08:52:57 +00:00
|
|
|
mod pkgid;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod plugins;
|
|
|
|
mod proc_macro;
|
2018-05-06 22:14:46 +00:00
|
|
|
mod profile_config;
|
2019-09-12 13:27:15 +00:00
|
|
|
mod profile_custom;
|
2018-04-21 20:47:01 +00:00
|
|
|
mod profile_overrides;
|
2018-04-21 20:57:54 +00:00
|
|
|
mod profile_targets;
|
2018-08-28 09:20:03 +00:00
|
|
|
mod profiles;
|
2020-09-12 17:15:47 +00:00
|
|
|
mod progress;
|
2019-03-20 23:25:59 +00:00
|
|
|
mod pub_priv;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod publish;
|
2019-04-05 20:25:08 +00:00
|
|
|
mod publish_lockfile;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod read_manifest;
|
|
|
|
mod registry;
|
2018-02-22 16:37:51 +00:00
|
|
|
mod rename_deps;
|
2019-11-25 02:42:45 +00:00
|
|
|
mod replace;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod required_features;
|
|
|
|
mod run;
|
2020-03-24 21:31:28 +00:00
|
|
|
mod rust_version;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod rustc;
|
2018-04-14 10:39:59 +00:00
|
|
|
mod rustc_info_cache;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod rustdoc;
|
2020-05-26 17:44:57 +00:00
|
|
|
mod rustdoc_extern_html;
|
2018-08-28 09:20:03 +00:00
|
|
|
mod rustdocflags;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod rustflags;
|
|
|
|
mod search;
|
2018-07-04 15:04:10 +00:00
|
|
|
mod shell_quoting;
|
2019-08-01 16:11:22 +00:00
|
|
|
mod standard_lib;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod test;
|
2019-09-20 21:11:49 +00:00
|
|
|
mod timings;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod tool_paths;
|
2020-03-19 17:51:25 +00:00
|
|
|
mod tree;
|
|
|
|
mod tree_graph_features;
|
2020-03-08 22:12:18 +00:00
|
|
|
mod unit_graph;
|
2018-03-06 05:21:47 +00:00
|
|
|
mod update;
|
Import the cargo-vendor subcommand into Cargo
This commit imports the external [alexcrichton/cargo-vendor
repository][repo] into Cargo itself. This means it will no longer be
necessary to install the `cargo-vendor` subcommand in order to vendor
dependencies. Additionally it'll always support the latest feature set
of Cargo as it'll be built into Cargo!
All tests were imported as part of this commit, but not all features
were imported. Some flags have been left out that were added later in
the lifetime of `cargo vendor` which seem like they're more questionable
to stabilize. I'm hoping that they can have separate PRs adding their
implementation here, and we can make a decision of their stabilization
at a later date.
The current man page for `cargo vendor -h` will look like:
cargo-vendor
Vendor all dependencies for a project locally
USAGE:
cargo vendor [OPTIONS] [--] [path]
OPTIONS:
-q, --quiet No output printed to stdout
--manifest-path <PATH> Path to Cargo.toml
--no-delete Don't delete older crates in the vendor directory
-s, --sync <TOML>... Additional `Cargo.toml` to sync and vendor
--respect-source-config Respect `[source]` config in `.cargo/config`
-v, --verbose Use verbose output (-vv very verbose/build.rs output)
--color <WHEN> Coloring: auto, always, never
--frozen Require Cargo.lock and cache are up to date
--locked Require Cargo.lock is up to date
-Z <FLAG>... Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help Prints help information
ARGS:
<path> Where to vendor crates (`vendor` by default)
This cargo subcommand will vendor all crates.io and git dependencies for a
project into the specified directory at `<path>`. After this command completes
the vendor directory specified by `<path>` will contain all remote sources from
dependencies specified. Additionally manifest beyond the default one can be
specified with the `-s` option.
The `cargo vendor` command will also print out the configuration necessary
to use the vendored sources, which when needed is then encoded into
`.cargo/config`.
Since this change is not importing 100% of the functionality of the
existing `cargo vendor` this change does run a risk of being a breaking
change for any folks using such functionality. Executing `cargo vendor`
will favor the built-in command rather than an external subcommand,
causing unimplemented features to become errors about flag usage.
[repo]: https://github.com/alexcrichton/cargo-vendor
2019-04-23 00:54:27 +00:00
|
|
|
mod vendor;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod verify_project;
|
|
|
|
mod version;
|
|
|
|
mod warn_on_failure;
|
2020-10-25 23:34:03 +00:00
|
|
|
mod weak_dep_features;
|
2018-02-08 00:13:17 +00:00
|
|
|
mod workspaces;
|
2020-01-09 13:18:45 +00:00
|
|
|
mod yank;
|
2018-09-16 09:07:24 +00:00
|
|
|
|
2019-06-05 18:52:53 +00:00
|
|
|
#[cargo_test]
|
2018-09-16 09:07:24 +00:00
|
|
|
fn aaa_trigger_cross_compile_disabled_check() {
|
|
|
|
// This triggers the cross compile disabled check to run ASAP, see #5141
|
2019-09-12 17:14:29 +00:00
|
|
|
cargo_test_support::cross_compile::disabled();
|
2018-09-16 09:07:24 +00:00
|
|
|
}
|