Commit graph

4322 commits

Author SHA1 Message Date
bors 2517af47e1 Auto merge of #9654 - ehuss:windows-env-upper-check, r=alexcrichton
Update Windows env uppercase key check.

This is the followup for #9646. Rust now correctly spawns processes with preserved casing on nightly on Windows, so the exceptions here are no longer needed.
2021-07-12 14:26:23 +00:00
bors a51667c60d Auto merge of #9662 - ehuss:unignore-fix_edition_2021, r=alexcrichton
Unignore fix_edition_2021.

The issue has been fixed by https://github.com/rust-lang/rust/pull/86572.
2021-07-12 13:39:49 +00:00
hi-rustin add4ffc200 Reject when using features in replace
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-07-12 14:56:24 +08:00
Eric Huss c8e4f8e483 Serialize cargo fix 2021-07-10 18:47:52 -07:00
gilescope dc0e53b7c1
Reworking message to not care about an intial offset 2021-07-10 15:07:29 +01:00
Eric Huss 493e8b7dd1 Deduplicate compiler diagnostics. 2021-07-09 16:20:46 -07:00
Dustin J. Mitchell bd4a353e98 Prefer patched versions of dependencies
When selecting among several versions of a paackage, prefer versions
from `[patch]` sections over other versions, similar to how locked
versions are preferred.

Patches come in the form of a Dependency and not a PackageId, so this
preference is expressed with `prefer_patch_deps`, distinct from
`try_to_use`.
2021-07-09 18:23:21 +00:00
hi-rustin a846226f71 Remove unrelated cases
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-07-09 13:15:13 +08:00
Joe Ardent bc472c762b Change format character to 'lib'. 2021-07-08 15:59:07 -07:00
hi-rustin 8d2103f212 Warning when using features in patch
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-07-08 15:25:13 +08:00
Joe Ardent 6fb5a1de54 Add test for lib_name format character. 2021-07-07 00:05:08 -07:00
Eric Huss 93658ee1be Unignore fix_edition_2021. 2021-07-06 19:28:13 -07:00
Joshua Nelson 9c7cc545d7 Combine rustc and cargo's diagnostic summaries
This works by introspecting rustc's error output, using the JSON format
to determine whether it's a warning or error, then skipping it
altogether if it's a summary of the diagnostics printed.

Before:

```
src/main.rs:1:10: warning: trait objects without an explicit `dyn` are deprecated
src/main.rs:1:1: error[E0601]: `main` function not found in crate `wrong`
src/main.rs:1:9: error[E0038]: the trait `Clone` cannot be made into an object
error: aborting due to 2 previous errors; 1 warning emitted
error: could not compile `wrong`

```

After:

```
$ cargo check --message-format short
src/main.rs:1:10: warning: trait objects without an explicit `dyn` are deprecated
src/main.rs:1:1: error[E0601]: `main` function not found in crate `wrong`
src/main.rs:1:9: error[E0038]: the trait `Clone` cannot be made into an object
error: could not compile `wrong` due to 2 previous errors; 1 warning emitted
```
2021-07-06 19:46:27 -04:00
Jon Gjengset d6b4a06274 Also set RUSTC_WORKSPACE_WRAPPER for build.rs 2021-07-06 09:46:02 -07:00
Eric Huss 2c99f654c9 Update nightly failure notification. 2021-07-05 16:08:36 -07:00
Eric Huss 652c5d9d1f Update Windows env uppercase key check. 2021-07-05 10:10:51 -07:00
bjorn3 8c24820a3d Update test 2021-07-05 18:28:21 +02:00
Eric Huss 5559e028a8 Adjust the edition2021 resolver diff report. 2021-07-02 13:01:58 -07:00
bors 0a38a2138d Auto merge of #9647 - ehuss:fingerprint-linker, r=alexcrichton
Include the linker in the fingerprint.

This adds the linker from the `[target]` config table to the fingerprint. Previously, changing the value would not trigger a rebuild.
2021-07-02 15:10:51 +00:00
bors 6e31c1338d Auto merge of #9646 - ehuss:windows-case-disable, r=alexcrichton
Temporarily disable windows env test.

This temporarily disables the `target_in_environment_contains_lower_case` test on Windows until https://github.com/rust-lang/rust/pull/85270 gets into nightly.  That PR changes it so that env vars are case-preserved on Windows.  My intent is that after that is in nightly, we can remove the windows-specific code in `Config`, and this test should work the same on all platforms.

Closes #9630
2021-07-02 14:47:02 +00:00
bors b74705419e Auto merge of #9645 - ehuss:git-package-wt_deleted, r=alexcrichton
Handle git deleted files with dirty worktree.

When listing git files for things like `cargo package`, it was including unstaged deleted files. This is because the file is still in the index, so it was included in the list.  `cargo package --allow-dirty` would then fail with a confusing "file not found" error.

This fixes it by keeping a set of deleted files, and skipping those. This allows `cargo package --allow-dirty` to work.

Closes #9580
2021-07-02 14:22:23 +00:00
Eric Huss 28c3bef71a Include the linker in the fingerprint. 2021-07-01 20:33:48 -07:00
Eric Huss c10864a3c4 Temporarily disable windows env test. 2021-07-01 19:41:13 -07:00
Eric Huss 97a135049a Handle git deleted files with dirty worktree. 2021-07-01 18:10:35 -07:00
Eric Huss dd8fa9183d Adjust error message with offline and frozen. 2021-07-01 16:59:19 -07:00
bors 4952979031 Auto merge of #9531 - 5225225:cargo-doc-open-fix, r=ehuss
Fix `BorrowMutError` when calling `cargo doc --open`

~~I'm not sure why the existing test suite didn't catch this, it definitely calls `cargo doc --open`.~~

I had

```toml
[doc.extern-map]
std = "local"
```

in my `.cargo/config.toml`. Will write a test case that sets that and then tries to run `cargo doc --open`.

Closes #9530
2021-07-01 01:14:50 +00:00
Eric Huss aab51362d7 Temporarily ignore 2021 edition fix. 2021-06-30 09:36:22 -07:00
Jon Gjengset fa7c5b196f Use a more standard linker flag 2021-06-29 12:26:50 -07:00
Jon Gjengset fb0d41fcc5 Adopt CARGO_ENCODED_RUSTFLAGS 2021-06-29 12:08:50 -07:00
Eric Huss e7df0d136c Temporarily disable future_incompat tests. 2021-06-29 11:56:03 -07:00
5225225 950c415583 Fully match stderr, return if not nightly, shorten file 2021-06-28 19:01:16 +01:00
Jon Gjengset c16b9d4c55 Remove CARGO_VERSION* env vars
Cargo and Rustc are co-versioned at the moment anyway.
2021-06-25 11:01:23 -07:00
Jon Gjengset 49d33c4ec4 Expose cargo and rustc version envvars 2021-06-24 09:56:14 -07:00
Jon Gjengset 1e407453c2 Remove CARGO_ prefix for new build script envvars 2021-06-24 09:56:00 -07:00
bors 4c27c96645 Auto merge of #9612 - Bryysen:master, r=alexcrichton
Error when packaging with git dependencies without version

If `cargo package` is run on a package that specifies a git dependency
without a version, cargo will error. This should help with clarifying
that git dependencies will be stripped when packaging, and that the
dependency has to be fetched from a registry.
Closes #9442
2021-06-23 21:38:32 +00:00
Daniel Eades 706c8242e3 use 'writeln' instead of appending newline character 2021-06-23 12:20:18 +01:00
Bryysen 4e1910d9d3 Error when packaging with git dependencies without version
If `cargo package` is run on a package that specifies a git dependency
without a version, cargo will error. This should help with clarifying
that git dependencies will be stripped when packaging, and that the
dependency has to be fetched from a registry.
2021-06-23 02:01:29 +02:00
bors 9233aa06c8 Auto merge of #9607 - hi-rustin:rustin-patch-cargo-toml, r=ehuss
Detect incorrectly named cargo.toml

close https://github.com/rust-lang/cargo/issues/9541
2021-06-22 21:32:55 +00:00
bors a2589dda38 Auto merge of #9574 - ehuss:weak-namespaced, r=alexcrichton
Unify weak and namespaced features.

This unifies weak and namespaced features in order to simplify the syntax and semantics.  Previously there were four different ways to specify the feature of a dependency:

* `package-name/feature-name` — Enables feature `package-name` on self and enables `feature-name` on the dependency. (Today's behavior.)
* `package-name?/feature-name` — Only enables `feature-name` on the given package if it that package is enabled and will also activates a feature named `package-name` (which must be defined implicitly or explicitly).
* `dep:package-name/feature-name` — Enables dependency `package-name`, and enables `feature-name` on that dependency. This does NOT enable a feature named "package-name".
* `dep:package-name?/feature-name` — Only enables `feature-name` on the given package if it that package is enabled.  This does NOT enable a feature named "package-name".

This changes it so there are only two:

* `package-name/feature-name` — Today's behavior.
* `package-name?/feature-name` — Only enables `feature-name` on the given package if it that package is enabled.  This does NOT enable a feature named "package-name" (the same behavior as `dep:package-name?/feature-name` above).

This is a fairly subtle change, and in most cases probably won't be noticed.  However, it simplifies things which helps with writing documentation and explaining how it works.
2021-06-22 21:02:31 +00:00
bors 32238b4747 Auto merge of #9563 - ehuss:link-cdylib-warning, r=alexcrichton
Change `rustc-cdylib-link-arg` error to a warning.

In #9523, an error was added if `cargo:rustc-cdylib-link-arg` was issued in a build script without actually having a cdylib target. This uncovered that there was an unintentional change in #8441 to cause those link args to be applied to transitive dependencies.

This changes it so that the error is now a warning, with a note that this may become an error in the future. It also changes it so that the unstable `rustc-link-arg*` instructions only apply to the package that emitted them.
2021-06-22 19:27:25 +00:00
hi-rustin b3a1d0ceba Only testing on linux 2021-06-22 15:36:32 +08:00
hi-rustin cb1a3f05f0 Detect incorrectly named cargo.toml for build 2021-06-22 15:31:28 +08:00
hi-rustin a2f903275a Detect incorrectly named cargo.toml for install --path 2021-06-22 15:31:28 +08:00
hi-rustin d9daaf7a84 Detect incorrectly named cargo.toml for install --git 2021-06-22 15:31:21 +08:00
Eric Huss afe7314ede Don't trigger an update when looking for suggestions. 2021-06-21 09:55:29 -07:00
Eric Huss a93bfcbdff Print reports using shell to handle old Windows colors properly. 2021-06-21 09:50:42 -07:00
Eric Huss 71cb59b6ef Future-incompat report: Add suggestions of newer versions. 2021-06-21 09:49:43 -07:00
Eric Huss 1f7141f892 Add future-incompat as an alias for future-incompatibilities. 2021-06-21 09:49:43 -07:00
Eric Huss c2b02b3926 Updates to future-incompatible reporting. 2021-06-21 09:49:41 -07:00
bors 9548b78ac9 Auto merge of #9579 - wickerwaka:env-config-override, r=ehuss
Don't allow config env to modify vars set by cargo

This changes how the `[env]` variables are applied. They will no longer replace any variables that are being set by cargo itself, whether or not the `force` flag is set. The `force` flag still determines whether existing variables from the environment can be overridden or not.

Addresses unresolved issue in #9539
2021-06-21 15:09:41 +00:00
Eric Huss c0dca04f49 Disambiguate is_symlink. 2021-06-19 11:27:14 -07:00
5225225 9e4c0e1e44 Don't use CargoDocConfig struct 2021-06-19 17:45:44 +01:00
Jon Gjengset 8012d328ee Avoid coercing path to string for windows 2021-06-18 12:40:29 -07:00
Jon Gjengset 719eb593c8 Add tests for rustc context build script env vars 2021-06-18 12:15:03 -07:00
bors c111cad106 Auto merge of #9596 - ehuss:fix-dep-info-local, r=alexcrichton
Fix dep-info files including non-local build script paths.

I derped in #8177 and accidentally used the wrong unit when iterating over the dependencies when writing the `.d` file.  The consequence here is that all the `rerun-if-changed` paths from a unit's dependencies are included in the `.d` file. This fixes it so that it does not include non-local dependencies.

Fixes #9445
2021-06-18 03:38:12 +00:00
Eric Huss 2db502f766 Fix dep-info files including non-local build script paths. 2021-06-17 18:28:42 -07:00
Eric Huss bd4010c43d Relax doc collision error. 2021-06-17 16:28:17 -07:00
Henri Francois 0663b713b7 Handling job=0 argument in cargo config files. 2021-06-17 09:18:59 -07:00
bors 40df0f17b5 Auto merge of #9589 - ehuss:testsuite-diff, r=alexcrichton
Enhancements to testsuite error output.

This includes several changes to the testsuite error reporting in theory to help make it easier to see differences when the test output changes. The key change is to add a Myers diff with a little colored output to highlight the differences. Here is an example:

<img width="666" alt="image" src="https://user-images.githubusercontent.com/43198/122311381-e8d43580-cec6-11eb-81b4-e2675f10d6ba.png">

The rest of the changes here are various refactorings to try to clean up the diffing code.  It ended up being far more changes than I was intending, but I did try to split things into commits to separate them.
2021-06-17 14:50:47 +00:00
Eric Huss 16b5402fd7 testsuite: Switch to colored diffs with Myers diff. 2021-06-16 15:43:29 -07:00
Eric Huss 205148e645 Only normalize paths on windows.
I don't trust that all these transformations won't have unintended
consequences on other platforms. It is nice to verify there aren't any
backslash shenanigans on other platforms.
2021-06-16 10:35:26 -07:00
Eric Huss aea5ca3ca0 Remove the double-backslash escape for matching.
Using `with_json` is safer since it knows what JSON escaping is.
2021-06-16 09:44:29 -07:00
Eric Huss b73e3d4fa5 Don't export lines_match.
Use better high-level interfaces to achieve the same thing.
2021-06-16 09:44:29 -07:00
Eric Huss b9f15ab1f0 Remove got_symlink_permission, we already have one of those. 2021-06-16 09:44:29 -07:00
Eric Huss 24b8936c20 Remove normalized_lines_match, it is not needed. 2021-06-16 09:44:29 -07:00
Eric Huss 6dff99781d Remove with_either_contains.
It isn't needed anymore, and I would prefer to not keep around unused code.
It can always be added back if ever needed again.
2021-06-16 09:44:29 -07:00
Eric Huss e132bb53ab Move comparison and diffing code to a new module.
This includes various minor refactorings to try to clean things up
and provide better error messages.
2021-06-16 09:44:29 -07:00
bors 7cdf5344ff Auto merge of #9588 - ehuss:edition2021-force-warns, r=alexcrichton
Enable support for fix --edition for 2021.

This adds support for using `cargo fix --edition` to migrate to 2021.

This also uses the new, currently unstable, `--force-warns` flag. This was added because there were a significant number of crates that were "allow"ing lints that are required for migrating the edition. This wasn't a problem for 2018, because its lints were new, and all "allow" to start.  For 2021, several older "warn" lints are becoming hard errors.  "allow"ing them would cause the migration to fail.
2021-06-16 14:51:06 +00:00
bors ee8497b09f Auto merge of #9582 - hi-rustin:rustin-patch-errors, r=ehuss
Add more details for installing git repository errors

close https://github.com/rust-lang/cargo/issues/9422
close https://github.com/rust-lang/cargo/issues/9011

r? `@ehuss`
2021-06-16 13:03:19 +00:00
Eric Huss 5825206acf Enable support for fix --edition for 2021. 2021-06-15 13:13:35 -07:00
bors 3b17193594 Auto merge of #9568 - hi-rustin:rustin-patch-error, r=alexcrichton
More information for links conflicting

close https://github.com/rust-lang/cargo/issues/9294
2021-06-14 14:14:55 +00:00
hi-rustin 5e86dd455d Add more details when installing git repository errors 2021-06-14 14:41:49 +08:00
Martin Donlon ac05a8526f Don't allow config env to modify vars set by cargo 2021-06-12 08:48:23 -07:00
Eric Huss 2492bf53ab Fix package_default_run.
The output was checking the `targets`, whose order depends on the
filesystem order. Instead of checking all the output, just
check the one field this test is for.
2021-06-11 16:09:32 -07:00
Eric Huss 393077f968 Add run_json to Execs.
This is a helper to run the process and return a JSON object.
2021-06-11 16:07:20 -07:00
Eric Huss 9034e488ff Unify weak and namespaced features. 2021-06-11 07:27:33 -07:00
Sunjay Varma f68cdb9947 Change how the fix_deny_warnings_but_not_others test works to avoid breakage from new compiler suggestions 2021-06-10 16:49:29 -07:00
bors da2c7705e4 Auto merge of #9561 - In-line:add-warning-for-ignored-arguments, r=ehuss
Implement warning for ignored trailing arguments
2021-06-10 15:47:52 +00:00
bors 40b674cd11 Auto merge of #9566 - ehuss:relative-rustc-path, r=alexcrichton
Fix rustc/rustdoc config values to be config-relative.

The `rustc`, `rustdoc`, `rustc_wrapper`, and `rustc_workspace_wrapper` config values (in the `[build]` table) were being interpreted literally. This caused a problem if you used a relative path like `foo/rustc`.  This would be interpreted as a relative path from whatever cwd cargo launches rustc from, which changes for different scenarios, making it essentially unusuable (since crates.io dependencies wouldn't be buildable).

Additionally, due to https://github.com/rust-lang/rust/issues/37868, it is a bad idea to use relative paths.

This changes it so that those paths are config-relative.  Bare names (like "my-rustc-program") still use PATH as before.

This also includes a commit to centralize the rustc-wrapper program used by several tests so that it isn't built multiple times (and to allow several tests to work on windows).

Fixes #8202
2021-06-10 14:15:18 +00:00
hi-rustin 724cf0f0eb More information for links conflicting 2021-06-10 15:12:19 +08:00
Eric Huss 9362fe5ff3 Update rustfix. 2021-06-09 18:13:56 -07:00
Eric Huss 47a02919cc Fix rustc/rustdoc config values to be config-relative paths. 2021-06-09 17:46:18 -07:00
Eric Huss 7b229bbe39 Move the rustc-echo-wrapper to be shared across tests.
This helps avoid rebuilding the same project several times.
2021-06-09 17:13:33 -07:00
Eric Huss 2bcece90a8 Change rustc-cdylib-link-arg error to a warning. 2021-06-09 14:24:12 -07:00
Bryysen da1c2f3b9c Warn if an "all" target is specified, but we don't match anything
If a combination of --bins, --benches, --examples, --tests flags have
been specified, but we didn't match on anything after resolving the unit-list,
we emit a warning to make it clear that cargo didn't do anything and that the
code is unchecked.

Closes #9536
2021-06-09 19:29:24 +02:00
bors 66686fd995 Auto merge of #9550 - hi-rustin:rustin-patch-feat, r=ehuss
add default_run to SerializedPackage

close https://github.com/rust-lang/cargo/issues/9497
2021-06-09 16:50:47 +00:00
bors 2544bd3418 Auto merge of #9522 - Aelnor:respect_user_choice_of_binlib, r=ehuss
respect user choice of lib/bin over heuristics

This one fixes #9333
2021-06-09 16:26:15 +00:00
Alik Aslanyan e5d10f973d
Implement warning for ignored trailing arguments
in case built-in `cargo` command was invoked with `--`
2021-06-09 18:50:51 +04:00
bors aa8b09297b Auto merge of #9520 - weihanglo:tree-prune, r=ehuss
Add `--prune` option for cargo-tree

Part of #8105

Prune the given package from the display of the dependency tree. Also providing a nice suggestion if the package is not within the resolved dependency graph.
2021-06-09 00:28:53 +00:00
hi-rustin 1abc4f2e8a Add test and update docs 2021-06-08 11:28:58 +08:00
hi-rustin c971400330 Make test happy 2021-06-07 14:59:59 +08:00
hi-rustin f9a5625733 add default_run to SerializedPackage
Delete "default_run": null,
2021-06-07 14:59:57 +08:00
5225225 1919ce7ce5 Add test to try to catch doc --open issue with extern-map 2021-06-06 13:28:45 +01:00
Rémi Verschelde 0a40a0aea4
Replace deprecated [replace] references with [patch]
Cf. #7092.
2021-06-02 12:30:56 +02:00
bors 0cecbd6732 Auto merge of #9322 - jameshilliard:split-host, r=joshtriplett
Configure hosts separately from targets when --target is specified.

This prevents target configs from accidentally being picked up when cross compiling from hosts that have the same architecture as their targets.

closes #3349
2021-06-01 20:09:13 +00:00
bors 6597523527 Auto merge of #9523 - ehuss:link-args-validate, r=alexcrichton
Add some validation to rustc-link-arg

This adds some validation, so that if a `cargo:rustc-link-arg-*` build script instruction specifies a target that doesn't exist, it will generate an error.  This also changes a parse warning to an error if the `=` is missing from BIN=ARG.

I intentionally did not bother to add the validation to config overrides, as it is a bit trickier to do, and that feature is very rarely used (AFAIK), and I'm uncertain if rustc-link-arg is really useful in that context.

cc #9426
2021-06-01 17:26:35 +00:00
Alexey Chernyshov 3bc2341b56 change simple quotes with backticks for file names 2021-06-01 20:13:45 +03:00
Alexey Chernyshov e1a6bf454b Update tests/testsuite/init.rs
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2021-06-01 19:54:54 +03:00
bors 5fb59b0e4a Auto merge of #9420 - In-line:unknown-features-suggestions-in-workspace, r=ehuss
Implement suggestions for unknown features in workspace
2021-06-01 15:41:27 +00:00
Eric Huss 81defa6d1e Consolidate doc collision detection. 2021-05-30 19:39:48 -07:00
Alexey Chernyshov 3f8fc0e66a respect user choice of lib/bin over heuristics 2021-05-30 15:24:29 +03:00
Eric Huss 836e537bc0 Make cargo:rustc-link-arg-bin without the = an error. 2021-05-29 16:12:11 -07:00
Eric Huss f676b49e52 Add some errors if rustc-link-arg-* specifies a non-existent target. 2021-05-29 16:00:35 -07:00
Weihang Lo 64f5d10113
test(carog-tree): new --prune option 2021-05-29 11:45:10 +08:00
Weihang Lo da2327f129
Merge branch 'master' into tree-depth 2021-05-28 23:27:42 +08:00
bors 238a9fa71f Auto merge of #9488 - weihanglo:issue-9165, r=ehuss
`cargo tree -e no-proc-macro` to hide procedural macro dependencies

Probably resolves #9165

`cargo tree -e no-proc-macro` now hides procedural macro dependencies.

Note that when passed with `--invert <spec>`, the spec's reverse proc-macro dependencies are also hidden. Is this desired result?

Also, since I want `-p <spec>` and `-i <spec>` works with any valid package-id in the project, the filter logic is written in print stage instead of graph build stage
2021-05-28 14:55:26 +00:00
bors 2f3df16921 Auto merge of #9508 - dtolnay-contrib:semver, r=ehuss
Update to semver 1.0.0

I am working on a 1.0.0 of the `semver` crate some time this week. It would be good to confirm Cargo will be able to use it, beforehand!

It's a from-scratch rewrite, but https://github.com/dtolnay/semver/issues/237 has code to compare against 0.10.0 (currently used by Cargo) how every possible version requirement currently published to crates.io matches against every possible crate version. The differences are all broken syntax like `^0-.11.0` previously parsing with ".11.0" as a pre-release string (which is invalid, because pre-release are not allowed to contain empty dot-separated identifiers) and `~2.0-2.2` previously parsing with "2.2" as a pre-release string, when the user almost certainly meant `>=2.0, <=2.2`. I'm not sure how much of those you want to add code into Cargo to preserve behavior, but I would be happy to do it.
2021-05-27 22:34:28 +00:00
bors cc75485f72 Auto merge of #9517 - alexcrichton:update-rrar, r=ehuss
Update tar dependency to 0.4.35

Pulls in a fix which should avoid 0 mtime files from showing up.

Closes #9512
2021-05-27 22:08:08 +00:00
Alex Crichton a02b6e5bfc Update tar dependency to 0.4.34
Pulls in a fix which should avoid 0 mtime files from showing up.

Closes #9512
2021-05-27 14:16:59 -07:00
David Tolnay 396bdd3a89
Remove parsing of broken version syntax from 5 years ago 2021-05-26 14:37:39 -07:00
David Tolnay 3b62e466ec
Update to semver 1.0.0-rc 2021-05-25 17:42:05 -07:00
bors e931e4796b Auto merge of #9486 - Dirbaio:link-arg-bin, r=ehuss
Add `cargo:rustc-link-arg-bin` flag.

This PR implements a `cargo:rustc-link-arg-bin` command to specify per-binary link args from build scripts. This follows the suggestion from the tracking issue #9426.

Syntax is `cargo:rustc-link-arg-bin=BIN_NAME=ARG`

This was previously possible to do using the `#[link_args=".."]` attribute, but it was removed in rust-lang/rust#83820 in favor of the Cargo extra-link-args feature, which can currently not specify different link args for different bins in the same crate. This PR adds back the ability to do that.
2021-05-24 16:17:27 +00:00
bors f898eff9b9 Auto merge of #9473 - lf-:meow, r=ehuss
Add a cargo-doc.browser config option

The idea of this option is to allow cargo to use a separate browser from
the rest of the system. My motivation in doing this is that I want to
write a script that adds a symbolic link in some web root on my system
such that I can access my docs via the http protocol to avoid the
limitations of the file protocol that are accessibility problems for me.
For instance, zoom is not retained across multiple pages and Stylus
filters don't work well.
2021-05-24 15:54:16 +00:00
Eric Huss 61b762b9ff Remove unneeded masquerade_as_nightly_cargo.
This was accidentally missed when it was stabilized.
2021-05-24 08:18:14 -07:00
Dario Nieuwenhuis 160756368f Add test for cargo:rustc-link-arg-bin=foo=--bar 2021-05-20 21:41:17 +02:00
Alik Aslanyan 766c3bbcb8 Merge branch 'master' of github.com:rust-lang/cargo into unknown-feature-resolver-1 2021-05-20 08:34:48 +04:00
Weihang Lo 62d811d9f7
test(cargo-tree): --depth option 2021-05-19 09:29:47 +08:00
Jade 50486be0c0 testsuite/doc: Check the arguments used to invoke the browser
Previously we apparently weren't doing this as we weren't checking
stdout.
2021-05-15 18:59:24 -07:00
Jade ed46a9a4de test path and args 2021-05-15 14:23:44 -07:00
Weihang Lo a5139b96b9
test: cargo tree incorrect --edges arg 2021-05-16 02:00:56 +08:00
Weihang Lo c8af63795e
test: assert no-proc-macro for existing tests 2021-05-16 02:00:22 +08:00
Alik Aslanyan 503a8670d9
Another way to fix 2021-05-13 11:30:46 +04:00
Jade e840c8e81c Add a cargo-doc.browser config option
The idea of this option is to allow cargo to use a separate browser from
the rest of the system. My motivation in doing this is that I want to
write a script that adds a symbolic link in some web root on my system
such that I can access my docs via the http protocol to avoid the
limitations of the file protocol that are accessibility problems for me.
For instance, zoom is not retained across multiple pages and Stylus
filters don't work well.
2021-05-10 21:04:41 -07:00
Eric Huss a200640dbd Improve performance of git status check in cargo package. 2021-05-10 18:15:05 -07:00
bors 5b37ab3c7e Auto merge of #9472 - r00ster91:bettererrors, r=alexcrichton
Improve two error messages

The first error message saying "an integer" is confusing because if you give it `4` it's an integer but it will still complain that it must be an integer. So it's more specific now and tells you that it actually needs to be `1`, `2` or `3`.
In the second error there was a space missing. It says `is not a valid setting,must be`.
2021-05-10 15:35:17 +00:00
r00ster91 b381fdb71e Improve two error messages 2021-05-10 17:28:19 +02:00
Eric Huss 9387a308f4 Fix cargo install with a semver metadata version. 2021-05-08 17:21:52 -07:00
Vojtech Kral 64bfe7f1de Add CARGO_TARGET_TMPDIR env var for integration tests & benches
The variable is set to $target_dir/$config/tmp
This is a directory where tests & benches can place testcasei-related data
for use by the tests.
cargo makes sure the directory exists when building tests/benches.
2021-05-06 23:47:28 +02:00
Alik Aslanyan 21152659a1 Move check to the end of function, rework error message 2021-05-06 09:31:22 +04:00
bors 1228f49d74 Auto merge of #9438 - ehuss:report-subcommand, r=alexcrichton
Add `report` subcommand.

This renames the `cargo describe-future-incompatibilities` subcommand to `cargo report future-incompatibilities`. The intent here is to have a general `report` subcommand that can be used for other reports in the future. This helps avoid the proliferation of top-level subcommands, and to help keep the CLI a little more organized.
2021-05-03 14:41:36 +00:00
Alik Aslanyan 8c4b0a8559
Remove trailing space 2021-05-03 09:08:53 +00:00
Alik Aslanyan f46145312c Fix bug when with resolver = "1" non-virtual package was allowing unknown features 2021-05-03 13:06:34 +04:00
James Hilliard 6dcfe51bdb Test that setting -Zhost-config without -Ztarget-applies-to-host fails. 2021-05-01 12:28:32 -06:00
bors db741ac733 Auto merge of #9186 - weihanglo:issue-9054, r=alexcrichton
Respect Cargo.toml `[package.exclude]` even not in a git repo.

May resolves #9054

This bug (or feature?) has been lingering for a while. #7680 fixed the `cargo package` part but `cargo vendor` is still affected by the heuristic rule of ignoring dotfiles. ~~I propose to drop the rule and include dotfiles by default even if the package is not under git-controlled~~. See below.

## Updated: Changes Summary

`cargo vendor` vendors dependencies without git-controlled but `cargo package` often runs under a VCS like git. [These lines](https://github.com/rust-lang/cargo/blob/1ca930b/src/cargo/sources/path.rs#L161-L168) are where they diverges: `fn list_files_walk_except_dot_files_and_dirs` builds [its own ignore instance], which cannot merge with other filter rules from `[package.exclude]`. This causes some patterns to not work as expected, such as re-including file after ignoring dotfiles `[.*, !negated_file]`.

To make re-include (negate) rule works, this patch adds the excluding dotfiles rule directly into the `package.exclude` ignore instance if **_no include option nor git repo exists_**. Other old behaviors should not change in this patch.

[its own ignore instance]: https://github.com/rust-lang/cargo/blob/1ca930b6/src/cargo/sources/path.rs#L364-L366
2021-05-01 15:35:48 +00:00
Eric Huss ff49b829e6 Add report subcommand. 2021-04-30 13:01:21 -07:00
Alik Aslanyan f2b5271a09
Cargo fmt 2021-04-30 10:55:36 +04:00
Alik Aslanyan e80b5c2f8b
Add failing test 2021-04-30 10:47:44 +04:00
Alik Aslanyan 1439dab8c0
Add failing tests & fix them 2021-04-30 09:56:24 +04:00
bors 96be6747cd Auto merge of #9434 - ehuss:collision-doc-j1, r=Eh2406
Fix collision doc tests randomly failing.

This fixes some tests that were randomly failing on CI. The cause is that #9419 added a remove_dir_all on the `doc` directory. However, if two jobs are trying to write to that directory at the same time, this can cause errors.  The failure rate is low (a little over 1%), and I was unable to reproduce locally (only on GitHub's CI and only on the Windows job).

The solution is to run the jobs with -j1 so they run serially.

 I only saw errors for `collision_doc_sources`, but to be on the safe side I added j1 to similar tests.
2021-04-29 18:21:49 +00:00
Eric Huss 5003d53c79 Fix collision doc tests randomly failing. 2021-04-29 10:42:42 -07:00
bors 5b76b84f7a Auto merge of #9421 - lf-:meowwwwww, r=alexcrichton
Fix dep-info files emitting paths relative to deps' roots

Sample `shoo.d` file prior to this change is below, note the `build.rs`
at the end, which was not from my package.

From booping the debugger, I found this was coming from
`compiler_builtins`.  This is not really their bug though: if a build.rs
asks for rerun-if-changed on some crate relative path, this will happen
in general. So I've fixed it in Cargo and added a test to prevent it
regressing.

```
target/riscv64imac-mu-shoo-elf/release/shoo: /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/core_arch_docs.md /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/macros.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/mod.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd_llvm.rs crates/build_bits/src/lib.rs shoo/src/main.rs shoo/src/task.rs shoo/src/vectors.s build.rs
```

This change fixes it so it's like:

```
target/riscv64imac-mu-shoo-elf/release/shoo: /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.39/build.rs /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/build.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/core_arch_docs.md /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/macros.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/mod.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd_llvm.rs crates/build_bits/src/lib.rs shoo/src/main.rs shoo/src/task.rs shoo/src/vectors.s
```
2021-04-29 14:54:23 +00:00
Yuki Okushi e5ab39145f Only deny the unused_mut lint 2021-04-28 17:59:57 +09:00
Jade b998364e6b Fix test on Windows: reprise 2021-04-27 22:30:35 -07:00
Jade 5bba21afe4 Fix the test on Windows 2021-04-27 21:21:56 -07:00
bors 4369396ce7 Auto merge of #9419 - ehuss:doc-meta-rebuild, r=alexcrichton
Fix rebuild issues with rustdoc.

This fixes two issues related to rebuilds with rustdoc:

* Switching features when running `cargo doc` would result in Cargo not rebuilding the documentation. This is because it was keeping the fingerprints in separate directories based on the features used. However, the rustdoc output isn't keyed off the metadata hash, so although the old fingerprint seemed "up to date", in reality the documentation was rewritten and needs to be rebuilt. The solution is to use a simplified hash for the fingerprint directory name.
* Removing items does not remove the files from the doc directory. This changes it to clear the package's doc directory before running rustdoc, to ensure any stale files are removed.

I'm a little concerned about potential performance impact of running `remove_dir_all`, but I think it shouldn't be too bad?

Fixes #7370
2021-04-27 14:35:53 +00:00
Jade fc5840d175 Fix dep-info files emitting paths relative to deps' roots
Sample `shoo.d` file prior to this change is below, note the `build.rs`
at the end, which was not from my package.

From booping the debugger, I found this was coming from
`compiler_builtins`.  This is not really their bug though: if a build.rs
asks for rerun-if-changed on some crate relative path, this will happen
in general. So I've fixed it in Cargo and added a test to prevent it
regressing.

```
target/riscv64imac-mu-shoo-elf/release/shoo: /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/core_arch_docs.md /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/macros.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/mod.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd_llvm.rs crates/build_bits/src/lib.rs shoo/src/main.rs shoo/src/task.rs shoo/src/vectors.s build.rs
```

This change fixes it so it's like:

```
target/riscv64imac-mu-shoo-elf/release/shoo: /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.39/build.rs /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/build.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/core_arch_docs.md /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/macros.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/mod.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd.rs /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/simd_llvm.rs crates/build_bits/src/lib.rs shoo/src/main.rs shoo/src/task.rs shoo/src/vectors.s
```
2021-04-27 05:08:33 -07:00
Alik Aslanyan 3786b27367
Update test 2021-04-27 09:36:07 +00:00
Alik Aslanyan 0847630d07
Implement suggestions for unknown features in workspace 2021-04-27 13:09:44 +04:00
Eric Huss 44c549e650 Clear rustdoc output just before running rustdoc. 2021-04-26 21:04:01 -07:00
Eric Huss 77855f3636 Use consolidated fingerprint directory for rustdoc. 2021-04-26 21:02:29 -07:00
Eric Huss 256c43c2f1 Always use full metadata hash for -C metadata. 2021-04-26 20:18:53 -07:00
James Hilliard e24bf92219 Add feature gate for target-applies-to-host. 2021-04-26 21:05:34 -06:00
James Hilliard 46f9541740 Add target-applies-to-host and default to true unless host-config is enabled. 2021-04-26 16:16:22 -06:00
James Hilliard 0a603fdf6e Document and feature-gate host-config tables. 2021-04-26 16:16:22 -06:00
James Hilliard 083cc9e8d0 Configure hosts separately from targets when --target is specified.
This prevents target configs from accidentally being picked up when
cross compiling from hosts that have the same architecture as their
targets.

closes #3349
2021-04-26 16:16:20 -06:00
bors d1c0a9d9ca Auto merge of #9030 - Ekleog:target-setting, r=alexcrichton
Expose build.target .cargo/config setting as packages.target in Cargo.toml

Hey!

I'm trying to do my first cargo contribution by implementing per-crate target settings as per [the irlo thread](https://internals.rust-lang.org/t/proposal-move-some-cargo-config-settings-to-cargo-toml/13336) ; and I think I have a draft that looks good-ish (the root units returned by `generate_targets` have the right kinds set).

Closes #7004

**_Edit: the below problem description is now solved in the latest version of this PR, please ignore_**

But for some reason running on a test project now blocks on `Blocking waiting for file lock on build directory` and I have literally no idea how my changes could trigger this… would anyone have an idea of how the changes could lead to infinitely blocking there? (I already tried cargo clean just in case and it didn't appear to help)

FWIW, the output that looks hopeful to me is, on my testbed workspace:
```
Root units [out of generate_targets] are [...]:
 - package ‘smtp-client’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘smtp-server’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘yuubind-config’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘smtp-message-fuzz’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘yuubind-rpc’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘yuubind-config-example’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘smtp-message-fuzz’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘yuubind-config-example’ with kind ‘Target(CompileTarget { name: "wasm32-unknown-unknown" })’
 - package ‘smtp-queue’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘smtp-message-fuzz’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘smtp-message’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘smtp-server-fuzz’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘yuubind-config’ with kind ‘Target(CompileTarget { name: "wasm32-unknown-unknown" })’
 - package ‘yuubind’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
 - package ‘smtp-queue-fs’ with kind ‘Target(CompileTarget { name: "x86_64-unknown-linux-gnu" })’
```
(where both `yuubind-config` and `yuubind-config-example` are being configured to be `wasm32-unknown-unknown` and the other ones stay as host).

Interestingly enough, if I remove the `target` setting from `yuubind-config` (and leave it on `yuubind-config-example`) then it does no longer block on waiting for file lock on build directory, even though it does not actually compile with `wasm32-unknown-unknown`. And it does appear to correctly build yuubind-config-example as wasm32.

My investigation shows that it appears to happen iff there is a package with `package.target` being set that has dependencies.

This most likely is a bug in my code (eg. I build only the root units and not the whole unit graph maybe?), and am going to keep investigating it as such, but maybe someone would already know how dependency resolution could interact with build lock acquisition and give me hints?

Anyway, thank you all for all you do cargo!
2021-04-26 15:00:47 +00:00
Léo Gaspard 5e11afc1ab Expose build.target .cargo/config setting as packages.target in Cargo.toml 2021-04-24 19:12:52 +02:00
Eric Huss c373867304 Add tests for new rustdoc fingerprint behavior. 2021-04-24 09:08:21 -07:00
Eric Huss d17c85132b Make doc_fingerprint_respects_target_paths work on all targets. 2021-04-23 14:31:14 -07:00
bors c321437b53 Auto merge of #9392 - alexcrichton:fix-patch-git-head-issue, r=ehuss
Fix loading `branch=master` patches in the v3 lock transition

This commit fixes an issue pointed out during #9352 where in the v2->v3
lock file transition (currently happening on nightly) Cargo will not
correctly use the previous lock file entry for `[patch]` directives that
point to git dependencies using `branch = 'master'` explicitly. The
reason for this is that Cargo previously, with the v2 format, considered
`branch=master` and `DefaultBranch` to be equivalent dependencies. Now
that Cargo treats those as distinct resolve nodes we need to load lock
files that use `DefaultBranch` and transparently use those for
`branch=master` dependencies.

These lock file nodes do not naturally unify so we have to go out of our
way to get the two to line up in modern Cargo. This was previously done
for the lock file at large, but the previous logic didn't take `[patch]`
into account. Unfortunately almost everything to do with `[patch]` and
lock files is pretty complicated, and this is no exception. The fix here
is wordy, verbose, and quite subtle in how it works. I'm pretty sure it
does work though and I think that this should be good enough to at least
transition most users off the v2 lock file format. Once this has baked
in Cargo for some time (on the scale of a year) I would hope that we
could just remove this logic since it's only really here for a
transitionary period.

Closes #9352
2021-04-23 18:45:03 +00:00
Eric Huss 3b7cb69eed Fix build-std updating the index on every build. 2021-04-22 17:18:26 -07:00
Alex Crichton fe484973f0 Fix loading branch=master patches in the v3 lock transition
This commit fixes an issue pointed out during #9352 where in the v2->v3
lock file transition (currently happening on nightly) Cargo will not
correctly use the previous lock file entry for `[patch]` directives that
point to git dependencies using `branch = 'master'` explicitly. The
reason for this is that Cargo previously, with the v2 format, considered
`branch=master` and `DefaultBranch` to be equivalent dependencies. Now
that Cargo treats those as distinct resolve nodes we need to load lock
files that use `DefaultBranch` and transparently use those for
`branch=master` dependencies.

These lock file nodes do not naturally unify so we have to go out of our
way to get the two to line up in modern Cargo. This was previously done
for the lock file at large, but the previous logic didn't take `[patch]`
into account. Unfortunately almost everything to do with `[patch]` and
lock files is pretty complicated, and this is no exception. The fix here
is wordy, verbose, and quite subtle in how it works. I'm pretty sure it
does work though and I think that this should be good enough to at least
transition most users off the v2 lock file format. Once this has baked
in Cargo for some time (on the scale of a year) I would hope that we
could just remove this logic since it's only really here for a
transitionary period.

Closes #9352
2021-04-22 08:33:03 -07:00
bors 8dd5336620 Auto merge of #9384 - alexcrichton:fix-order, r=ehuss
Fix disagreement about lockfile ordering on stable/nightly

This commit fixes an issue where the order of packages serialized into a
lock file differs on stable vs nightly. This is due to a bug introduced
in #9133 where a manual `Ord` implementation was replaced with a
`#[derive]`'d one. This was an unintended consequence of #9133 and means
that the same lock file produced by two different versions of Cargo only
differs in what order items are serialized.

With #9133 being reverted soon on the current beta channel this is
intended to be the nightly fix for #9334. This will hopefully mean that
those projects which don't build with beta/nightly will remain
unaffected, and those affected on beta/nightly will need to switch to
the new nightly ordering when it's published (which matches the current
stable). The reverted beta will match this ordering as well.

Closes #9334
2021-04-21 00:13:47 +00:00
bors fb0130cdb3 Auto merge of #9365 - jyn514:rustc-bootstrap-crate-name, r=ehuss
Don't give a hard error when the end-user specifies RUSTC_BOOTSTRAP=crate_name

Fixes https://github.com/rust-lang/cargo/issues/9362.
The whole point of https://github.com/rust-lang/rust/pull/77802/ was to allow specifying this granularly, giving a hard error defeats the point.

I didn't know how to check what targets were reverse-dependencies of build.rs, so I just unconditionally use the library name (and give a hard error for anything else, even if it's the name of one of the binaries). End-users can still opt-in with RUSTC_BOOTSTRAP=1, and no public binaries use RUSTC_BOOTSTRAP=1, so I don't think this a big deal in practice.

<details><summary>Script to verify all crates using RUSTC_BOOTSTRAP=1 have a library</summary>

```sh
curl https://pastebin.com/raw/fGQ97xP6 | cut -d / -f1 | grep -v shnatsel | grep -v cargo- | sed 's#-\([0-9]\)#/\1#' | xargs -i curl -s -I -L "https://docs.rs/{}/" -w "%{http_code}\n" -o/dev/null
```

It should output 20 200s in a row.

</details>

r? `@ehuss` cc `@mark-simulacrum`

I don't know what cargo's policy is for backports, but this should be backported to 1.52.
2021-04-20 23:43:12 +00:00
bors a18936b14c Auto merge of #9369 - PicoJr:fix-9350, r=ehuss
Fix #9350 (cargo build -Z help is missing options)

> Do not merge yet, some options are still undocumented.

Fix #9350 (cargo build -Z help is missing options)

Add a procedural macro to declare `CliUnstable` struct and provide help messages instead of hard-coding help in `src/bin/cargo/cli.rs`

> Flags documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html

Feedback welcome
2021-04-20 21:58:22 +00:00
bors 05d37ae2c0 Fix #9350 (cargo build -Z help is missing options)
> Do not merge yet, some options are still undocumented.

Fix #9350 (cargo build -Z help is missing options)

Add a procedural macro to declare `CliUnstable` struct and provide help messages instead of hard-coding help in `src/bin/cargo/cli.rs`

> Flags documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html

Feedback welcome
2021-04-20 21:58:22 +00:00
Alex Crichton eb6e1b34a4 Fix disagreement about lockfile ordering on stable/nightly
This commit fixes an issue where the order of packages serialized into a
lock file differs on stable vs nightly. This is due to a bug introduced
in #9133 where a manual `Ord` implementation was replaced with a
`#[derive]`'d one. This was an unintended consequence of #9133 and means
that the same lock file produced by two different versions of Cargo only
differs in what order items are serialized.

With #9133 being reverted soon on the current beta channel this is
intended to be the nightly fix for #9334. This will hopefully mean that
those projects which don't build with beta/nightly will remain
unaffected, and those affected on beta/nightly will need to switch to
the new nightly ordering when it's published (which matches the current
stable). The reverted beta will match this ordering as well.

Closes #9334
2021-04-20 13:27:12 -07:00
bors 9ae6d41e33 Auto merge of #9368 - weihanglo:issue-9319, r=ehuss
fix: better error message when dependency/workspace member missing

May fix #9319
2021-04-19 19:15:18 +00:00
bors 1243c378b9 Auto merge of #9348 - matklad:wrapper-fingerprint, r=ehuss
Don't re-use rustc cache when RUSTC_WRAPPER changes

We cache initial `rustc --version` invocations, to speed up noop builds.

We check the mtime of `rustc` to bust the cache if the complier changed.
However, before this PR, we didn't look at mtimes of `RUSTC_WRAPPER` /
`RUSTC_WORKSPACE_WRAPPER`, so we could've re-use old cache with new
wrapper.
2021-04-18 17:24:23 +00:00
Joshua Nelson 5a7149683f Fix tests 2021-04-17 12:13:30 -04:00
Joshua Nelson 236fe8767d Use the library name to decide whether the override should be allowed from the top-level.
If there's no library, give a hard error unless features are
unconditionally allowed with RUSTC_BOOTSTRAP=1.
2021-04-17 11:36:55 -04:00
Joshua Nelson 6d6f466351 Use the crate name instead of the package name
This doesn't work because it uses the name of the build script, which is
always build_script_build. I'm not sure what to change it to - the name
of the library crate could be different than the name of the package,
and there could be multiple different crates being compiled in the same
package.
2021-04-17 10:58:40 -04:00
Joshua Nelson 04fa2f2a3b Don't give a hard error on RUSTC_BOOTSTRAP=crate_name 2021-04-17 10:50:38 -04:00
Weihang Lo 9c0d865389 fix: more error context for missing dep of workspace member 2021-04-17 14:24:29 +08:00
Weihang Lo 832fff8dd1
fix: more context when failed to load workspace member 2021-04-17 13:56:39 +08:00
Aleksey Kladov f6070b3e3f Don't re-use rustc cache when RUSTC_WRAPPER changes
We cache initial `rustc --version` invocations, to speed up noop builds.

We check the mtime of `rustc` to bust the cache if the complier changed.
However, before this PR, we didn't look at mtimes of `RUSTC_WRAPPER` /
`RUSTC_WORKSPACE_WRAPPER`, so we could've re-use old cache with new
wrapper.
2021-04-16 20:08:11 +03:00
Eric Huss 2551535ea9 Track "CARGO" in environment fingerprint. 2021-04-15 13:54:46 -07:00
Eric Huss 376619d176 Update testsuite/main.rs lint comment. 2021-04-13 12:25:13 -07:00
Eric Huss 10eb56f2c4 Update clippy lint allow set. 2021-04-13 09:02:07 -07:00
bors 335ad2ba95 Auto merge of #9323 - matthiaskrgr:clippy_v19, r=ehuss
fix clippy warnings

fixes these clippy warnings:

map_collect_result_unit
needless_borrow
needless_return
into_iter_on_ref
manual_flatten
match_like_matches_macro
bool_comparison
2021-04-02 16:47:57 +00:00
Matthias Krüger 1b7fa21f39 fix clippy warnings
fixes these clippy warnings:

map_collect_result_unit
needless_borrow
needless_return
into_iter_on_ref
manual_flatten
match_like_matches_macro
bool_comparison
2021-04-02 12:30:36 +02:00
Jon Gjengset 8d79a75b31 Don't use RUSTC_BOOTSTRAP for nightly-only tests 2021-04-01 10:39:07 -07:00
Jon Gjengset ba584a95ae Merge remote-tracking branch 'upstream/master' into z-allowed-features 2021-03-31 12:41:34 -07:00
Jon Gjengset 3b23a37acc Future-proof tests 2021-03-31 12:39:19 -07:00
Jon Gjengset be333390a4 Print features without Debug 2021-03-31 12:39:09 -07:00
bors 7204d3989d Auto merge of #9302 - ehuss:cargo-config, r=alexcrichton
Add `cargo config` subcommand.

This adds an initial version of the `cargo config` command as discussed in #2362.

Closes #2362
2021-03-30 19:07:19 +00:00
Eric Huss 23d4a68d35 Print environment note for json format, too. 2021-03-29 14:37:41 -07:00
Eric Huss d774f1f331 Bump to 0.54.0 2021-03-26 12:28:47 -07:00
Ian Jackson fe8f588263 tests: Tolerate "exit status" in error messages
"exit code" is wrong terminology on Unix.  I am trying to fix this in
Rust stdlib in
    https://github.com/rust-lang/rust/pull/83462
but this currently breaks the cargo test suite.

See that MR for full explanation of the change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-03-26 16:18:37 +00:00
bors f16bfc2b97 Auto merge of #9298 - alexcrichton:mac-split-debuginfo-default, r=ehuss
Default macOS targets to `unpacked` debuginfo

This commit continues the work from #9112 to enable `unpacked` split
debuginfo on macOS targets by default. This has been discussed on [internals]
for awhile now and no breakage has emerged while significant speedups
have. This is expected to be a compile-time and `target`-directory size
win for almost all macOS Rust projects.

While breakage is possible it's possible to mitigate this with
project-local or global cargo configuration of the `dev` and `test` profiles.

[internals]: https://internals.rust-lang.org/t/help-test-faster-incremental-debug-macos-builds-on-nightly/14016/9
2021-03-26 14:38:38 +00:00
Alex Crichton a4f0988ef8 Default macOS targets to unpacked debuginfo
This commit continues the work from #9112 to enable `unpacked` split
debuginfo on macOS targets by default. This has been discussed on [internals]
for awhile now and no breakage has emerged while significant speedups
have. This is expected to be a compile-time and `target`-directory size
win for almost all macOS Rust projects.

While breakage is possible it's possible to mitigate this with
project-local or global cargo configuration of the `dev` and `test` profiles.

[internals]: https://internals.rust-lang.org/t/help-test-faster-incremental-debug-macos-builds-on-nightly/14016/9
2021-03-26 07:38:17 -07:00
Eric Huss 96a5642217 Add cargo config subcommand. 2021-03-25 13:52:31 -07:00
Alex Crichton 6bc74556f9 Fix publication of packages with metadata and resolver
This commit fixes an issue where packages which specify `resolver = '2'`
cannot be packaged if they also have a `package.metadata` table. The
issue is that the `toml` serialization implementation serializes fields
in order which requires that tables be emitted last.
2021-03-25 09:13:40 -07:00
Eric Huss 1130bc076f Fix config includes not working. 2021-03-24 20:21:09 -07:00
Jon Gjengset 85f7c800f8 Forward -Zallow-features to rustc 2021-03-24 10:14:53 -07:00
Jon Gjengset caca4d43a0 Test that allowed-features in config works 2021-03-24 09:42:36 -07:00
bors 58a9613144 Auto merge of #9263 - Aaron1011:zero-incompat-note, r=ehuss
Emit note when `--future-incompat-report` had nothing to report
2021-03-22 22:59:56 +00:00
Jade 160b7f1dac Test the generated manifest does not contain authors = 2021-03-22 13:39:18 -07:00
Jade de45c6f97a Delete uses of the USER env var from tests 2021-03-22 13:39:18 -07:00
Jade b09988649a Restore the tests that could be reused 2021-03-22 13:39:18 -07:00
lf- 47347de87e Delete redundant broken tests 2021-03-22 13:39:18 -07:00
Jade c685eb322b RFC 3052: Stop including authors field in manifests made by cargo new
See https://github.com/rust-lang/rust/issues/83227
2021-03-22 13:39:15 -07:00
bors 39d9413ca2 Auto merge of #9290 - ehuss:non-member-features, r=alexcrichton
Refactor feature handling, and improve error messages.

This changes the way feature strings are handled with an eye towards fixing some improper handling and to improve error messages. The key change is to stop treating all features as free-form strings and instead try to handle them as typed values. This helps avoid needing to deal with parsing different feature syntax (like `dep:` or `foo/bar`) or forgetting to handle it properly.

Overview of refactoring changes:

* `RequestedFeatures` changed to an enum to differentiate between features coming from the command-line, and those that are from a dependency.
* Moved parsing of CLI features to an earlier stage (now stored in `CompileOptions`), and ensures that they are properly handled as `FeatureValue` instead of strings.
* Pushed some feature validation earlier. For example, `DetailedTomlDependency` now validates things so you can see the location for the errant `Cargo.toml` (previously some validation was deep in the resolver, which provided poor errors).

This is a pretty large PR, but at the core it is just changing `RequestedFeatures` and then dealing with the fallout from that. Hopefully this is an improvement overall.

List of user-visible changes:

* Fix handling in resolver V2 of `--features bar?/feat` and `--features dep:bar`
* Better error handling for `bar/feat` and `dep:bar` in dependency declarations.
* Feature keys in the `[features]` table can no longer contain slashes.
* Fixed a minor issue with `cargo tree -e features --all-features -Z namespaced-features`
* Fixed a panic with `cargo tree` involving `-Z weak-dep-features`

I did a small amount of benchmarking, and I wasn't able to record much of a difference.
2021-03-22 14:40:21 +00:00
Eric Huss 1dae5acb7d Move paths to cargo-util. 2021-03-20 17:42:41 -07:00
Eric Huss dbfdd49559 Move is_ci to cargo-util. 2021-03-20 17:42:32 -07:00
Eric Huss 888100352a Move ProcessBuilder to cargo-util. 2021-03-20 15:19:03 -07:00
Mukund Lakshman 54742ce726 Use serde's error message option to avoid implementing Deserialize. 2021-03-19 23:22:39 +00:00
Eric Huss 85854b1884 Refactor feature handling, and improve error messages. 2021-03-19 14:59:53 -07:00
bors c9ce0ec40d Auto merge of #9279 - Revantus:offline_precise, r=alexcrichton
Allow `cargo update` to operate with the --offline flag

Closes #9248

Limiting to `--precise` operations as the package should be cached locally prior to the usage of offline.

Added an additional test to [offline.rs](tests/testsuite/offline.rs).
2021-03-18 18:23:28 +00:00
Revantus 61a8f711df Fix offline tests. Rename to cached/not_cached. 2021-03-18 08:33:55 -06:00
Revantus 8ae547233f Remove eager fail for update --offline 2021-03-18 08:04:42 -06:00
Jon Gjengset 4a90ab6910 Add -Zallow-features to match rustc's -Z 2021-03-17 15:23:48 -07:00
bors 90691f2bfe Auto merge of #9268 - ehuss:2021-fix-edition-v2-warning, r=alexcrichton
Add report if `cargo fix --edition` changes features.

This adds a small report if using `cargo fix --edition` to transition from 2018 to 2021 to determine if the new resolver will result in different features.

There is a gauntlet of checks that must pass before it even tries to show the differences:
* If the resolver is already specified, skip.
* If in a virtual workspace, skip (no way to specify global edition).
* If not migrating the root package, skip. The edition only changes the resolver in the root package.
* If not migrating all targets, skip. It's uncertain if the user intends to set the package edition or not.

Closes #9048
2021-03-16 21:36:55 +00:00
bors 841179ee60 Auto merge of #9275 - ehuss:features-non-member, r=alexcrichton
Fix --feature pkg/feat for V1 resolver for non-member.

#8997 had an unintended regression where `-p foo --feature foo/feat` syntax where `foo` is an **optional non-member** fails with an error that `foo` did not match any packages.  The issue is that the member/feature selection routine needed to slot this into the features for the package in the current working directory (it was incorrectly treating `foo` as a workspace member).

V2 outright does not allow specifying features for non-workspace members.

Fixes #9265
2021-03-16 20:55:20 +00:00
Eric Huss 501499c5f9 Add report if cargo fix --edition changes features. 2021-03-16 11:39:21 -07:00
Eric Huss e50292a153 Fix doc duplicate removal of root units. 2021-03-16 10:32:08 -07:00
bors 695465c79a Auto merge of #9204 - jonhoo:patch-in-config, r=alexcrichton
Support [patch] in .cargo/config files

This patch adds support for `[patch]` sections in `.cargo/config.toml`
files. Patches from config files defer to `[patch]` in `Cargo.toml` if
both provide a patch for the same crate.

The current implementation merge config patches into the workspace
manifest patches. It's unclear if that's the right long-term plan, or
whether these patches should be stored separately (though likely still
in the manifest). Regardless, they _should_ likely continue to be
parsed when the manifest is parsed so that errors and such occur in the
same place regardless of where a patch is specified.

Fixes #5539.
2021-03-15 16:58:26 +00:00
Aaron Hill f9512ff822
Emit note when --future-incompat-report had nothing to report 2021-03-14 23:22:51 -04:00
Eric Huss 6b320cb801 Fix --feature pkg/feat for V1 resolver for non-member. 2021-03-14 19:05:12 -07:00
Aaron Hill 63ed725fd8
Add --future-incompat-report support to cargo test
This was missed in the original PR
2021-03-14 15:50:01 -04:00
Revantus 06eed4afe4 Allowing update --offline with precise flags
Adding additional test for updating against changed offline
dependancies.

rust-lang/cargo#9248
2021-03-14 07:17:59 -06:00
Eric Huss 8ce2a1bef3 Fix issue with filtering exclusive target dependencies. 2021-03-11 11:41:00 -08:00
bors 0f3f47e3c3 Auto merge of #9188 - weihanglo:issue-9041, r=ehuss
Package ID specification urls must contain a host

Resolves https://github.com/rust-lang/cargo/issues/9041

Not sure which commit breaks this. Cargo shipped with rust 1.46 didn't unwrap on a `None` but 1.47 did. Even checkouted to 149022b1d8 (cargo of rust 1.46), it still unwrap unexpectedly.

So I ended up following the [Specification grammer](https://doc.rust-lang.org/cargo/reference/pkgid-spec.html#specification-grammar) to make sure there is a `host` in the pkgid urls.

<details>
<summary>See console output</summary>

cargo of rust 1.46
```console
$ cargo +1.46 -vV
cargo 1.46.0 (149022b1d 2020-07-17)
release: 1.46.0
commit-hash: 149022b1d8
commit-date: 2020-07-17

$ cargo +1.46 pkgid /path
error: package ID specification `/path` matched no packages
```

cargo of rust 1.47

```console
$ cargo +1.47 -vV
cargo 1.47.0 (f3c7e066a 2020-08-28)
release: 1.47.0
commit-hash: f3c7e066ad
commit-date: 2020-08-28

$ cargo +1.47 pkgid /path
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/tools/cargo/src/cargo/core/package_id_spec.rs:234:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

cargo on commit 149022b1d8

```console
$ git checkout 149022b1d8
$ cargo run -- pkgid /path
   Compiling cargo-platform v0.1.1 ([..]/cargo/crates/cargo-platform)
   Compiling crates-io v0.31.1 ([..]/cargo/crates/crates-io)
   Compiling cargo v0.47.0 ([..]/cargo)
    Finished dev [unoptimized + debuginfo] target(s) in 22.90s
     Running `target/debug/cargo pkgid /path`
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/cargo/core/package_id_spec.rs:234:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
</details>
2021-03-09 18:47:47 +00:00
Jon Gjengset 6bc97fc223 Merge branch 'master' into patch-in-config 2021-03-08 13:54:22 -08:00
Jon Gjengset 6995e1dd1b Extract config patch on use 2021-03-08 13:53:29 -08:00
Eric Huss 95827ad3bf Fix filter_platform to run on targets other than x86. 2021-03-08 07:54:01 -08:00
Eric Huss 9ea3503680 Fix some minor formatting issues. 2021-03-05 14:01:01 -08:00
Aaron Hill f03d47ce4b
Address review comments 2021-03-04 15:21:16 -05:00
Aaron Hill 6177c6584b
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.
2021-03-04 15:21:15 -05:00
bors c69409658a Auto merge of #9022 - nagisa:nagisa/manifest_path, r=alexcrichton
Add the path to the manifest in json output

This allows consumers of the json messages to avoid guessing where
exactly the package root is. Having access to the package root is
difficult by virtue of requiring logic to guess its location by e.g.
walking filesystem from the source file.

This guessing logic becomes further complicated in presence of
workspaces and nigh impossible to implement correctly in instances where
artifacts end up produced from paths above the package root (e.g.
`../foo.rs`).

Since Cargo has access to this data in the first place, there doesn't
seem to be much reason to force consumers to invent their own, possibly
flawed, logic.
2021-03-04 19:50:20 +00:00
Simonas Kazlauskas 548300b20f Add the path to the manifest in json output
This allows consumers of the json messages to avoid guessing where
exactly the package root is. Having access to the package root is
difficult by virtue of requiring logic to guess its location by e.g.
walking filesystem from the source file.

This guessing logic becomes further complicated in presence of
workspaces and nigh impossible to implement correctly in instances where
artifacts end up produced from paths above the package root (e.g.
`../foo.rs`).

Since Cargo has access to this data in the first place, there doesn't
seem to be much reason to force consumers to invent their own, possibly
flawed, logic.
2021-03-04 20:09:51 +02:00
bors 99e714c05b Auto merge of #9230 - kornelski:nobinaries, r=alexcrichton
Explain `cargo install` is not for libraries

On a few occasions I've seen novice users assume that `cargo install` works like `npm install` or `apt install`, and they're confused that they can't use library dependencies this way.

I've expanded the error message to hopefully clarify the misconception.
2021-03-04 18:01:51 +00:00
Jon Gjengset ce0b8e8574 Merge remote-tracking branch 'upstream/master' into patch-in-config 2021-03-03 09:20:28 -08:00
Kornel 3f7f0942cd track_caller on custom assert functions 2021-03-03 17:17:07 +00:00
Kornel 6977dee109 Explain cargo install is not for libraries 2021-03-03 17:10:56 +00:00
bors b219f0eb7a Auto merge of #9181 - jyn514:computer-says-no, r=ehuss
Forbid setting `RUSTC_BOOTSTRAP` from a build script on stable

Instead, recommend `RUSTC_BOOTSTRAP=crate_name`. If cargo is using a nightly toolchain, or if RUSTC_BOOTSTRAP was set in *cargo*'s build environment, the error is downgraded to a warning, since the variable won't affect the build.

This is mostly the same as suggested in https://github.com/rust-lang/cargo/issues/7088#issuecomment-713867773, except that `RUSTC_BOOTSTRAP=` values other than 1 are treated the same as `RUSTC_BOOTSTRAP=1`. My reasoning was that https://github.com/rust-lang/rust/pull/77802 is now on 1.50 stable, so some crates may have started using it, and I would still prefer not to give hard errors when there's no workaround.

Closes https://github.com/rust-lang/cargo/issues/7088.

r? `@joshtriplett`
2021-03-03 03:19:33 +00:00
bors c68432f1e5 Auto merge of #9226 - matklad:utf8everywhere, r=alexcrichton
Don't panic when printing JSON with non-utf8 paths

Before:

    λ cd \Xff/foo/ && cargo verify-project && cargo metadata
    {"success":"true"}
    warning: please specify `--format-version` flag explicitly to avoid compatibility problems
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("path contains invalid UTF-8 characters", line: 0, column: 0)', /rustc/a5a775e3f9e8043dad405e00aee0ae60882a7b71/src/tools/cargo/src/cargo/core/shell.rs:346:51
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After:

    λ cd \Xff/foo/ && $cargo verify-project && $cargo metadata
    {"success":"true"}
    warning: please specify `--format-version` flag explicitly to avoid compatibility problems
    error: path contains invalid UTF-8 characters

I am pretty  sure that this has zero real-world impact, but the diff is
small, so why not handle it?
2021-03-02 18:26:29 +00:00
Aleksey Kladov dd5806d146 Don't panic when printing JSON with non-utf8 paths
Before:

    λ cd \Xff/foo/ && cargo verify-project && cargo metadata
    {"success":"true"}
    warning: please specify `--format-version` flag explicitly to avoid compatibility problems
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("path contains invalid UTF-8 characters", line: 0, column: 0)', /rustc/a5a775e3f9e8043dad405e00aee0ae60882a7b71/src/tools/cargo/src/cargo/core/shell.rs:346:51
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After:

    λ cd \Xff/foo/ && $cargo verify-project && $cargo metadata
    {"success":"true"}
    warning: please specify `--format-version` flag explicitly to avoid compatibility problems
    error: path contains invalid UTF-8 characters

I am pretty  sure that this has zero real-world impact, but the diff is
small, so why not handle it?
2021-03-02 20:27:52 +03:00
Weihang Lo ade33c20d1
teset(pkgid): suggestion for bad parsing 2021-03-02 16:18:21 +08:00
Weihang Lo 2e3a74cc95
test(pkgid): bad file URL suggestion 2021-03-02 08:40:59 +08:00
Eric Huss 83487e41a9 Detect changes for JSON spec targets. 2021-03-01 12:19:14 -08:00
bors ccf781ab90 Auto merge of #9213 - ehuss:registry-api-errors, r=alexcrichton
Minor update to registry API error messages.

This is a minor update to the registry API errors, trying to make them a little clearer and more helpful. My concerns were:

* `api errors (status 200 OK): some error message` — why was there both an error and 200 OK?
* `api errors` — What is an "api error" anyways?  The user is probably not familiar with the "registry API".
* Adds the URL of the server it is actually talking to, in case you may be confused when using a registry other than crates.io. This also tries to make it clearer that the message is coming from the remote server, and not cargo itself.
2021-03-01 15:13:36 +00:00
Weihang Lo 153146ecc5
test(vendor): respect to Cargo.toml [package.exclude] 2021-03-01 22:06:57 +08:00
Eric Huss e58c544f37 Some minor code cleanup. 2021-02-28 19:03:06 -08:00
Eric Huss c9bd6e12e1 Minor update to registry API error messages. 2021-02-27 12:38:17 -08:00
Jon Gjengset 140a7707ad Only apply config patches on resolve 2021-02-26 09:29:33 -08:00
bors f3e63d6ab4 Auto merge of #8939 - Andy-Python-Programmer:master, r=alexcrichton
Throw error if CARGO_TARGET_DIR is an empty string

This pull request makes the target dir to be target/ if `CARGO_TARGET_DIR` is `` with spaces trimmed and not delete the current project.

Fixes: #8866
2021-02-25 19:40:08 +00:00
bors 6780fbd22a Auto merge of #9207 - ehuss:testsuite-splitdebug, r=Eh2406
testsuite: Use split debuginfo on macos.

This switches the testsuite to use "unpacked" debuginfo on macos, which is a substantial performance boost. On my system, the testsuite runs 1.55 times faster with this change.  Along with #9206, total testsuite time is 3.1 times faster.
2021-02-25 19:06:49 +00:00
Eric Huss c73765f9c3 testsuite: Improve performance when using rustup. 2021-02-25 09:07:48 -08:00
Eric Huss 0f78dbd38e testsuite: Use split debuginfo on macos. 2021-02-25 09:06:11 -08:00