11443 Commits

Author SHA1 Message Date
Jon Gjengset
1e0d564ff0 Stabilize patch-in-config 2021-08-24 12:55:04 -07:00
Jon Gjengset
d47c52e7c4 Prefer config [patch] over manifest [patch] 2021-08-24 12:54:49 -07:00
bors
851defd301 Auto merge of #9836 - Firstyear:9804-cargo-docs-improve, r=alexcrichton
Add hint for cargo metadata in environment section

Fixes #9804
2021-08-24 14:06:23 +00:00
l00556901
d26e449bb6 fix bug 2021-08-24 19:06:19 +08:00
l00556901
1bbd505a72 add fmt 2021-08-24 17:49:21 +08:00
l00556901
2929efdf88 add --examples subcommand 2021-08-24 17:44:58 +08:00
William Brown
64735934cc Add hint for cargo metadata in environment section 2021-08-24 13:15:07 +10:00
bors
9b81660b79 Auto merge of #9834 - ehuss:fix-build-std-proc-macro-only, r=alexcrichton
Fix panic with build-std of a proc-macro.

If you try to run `cargo build -Zbuild-std` in a proc-macro project, cargo would panic in [`check_collisions`](835d5576e1/src/cargo/core/compiler/context/mod.rs (L427)). This is because it iterates over every Unit in the build graph checking the `outputs` for filenames.  However, [`outputs`](835d5576e1/src/cargo/core/compiler/context/compilation_files.rs (L109-L110)) was missing the outputs for standard library units. That is because `outputs` is computed by walking the graph starting from the roots.

The bug here is that `attach_std_deps` was adding the standard library units to graph, even though they aren't reachable from the roots, thus creating orphans.

The solution is to avoid adding the standard library units if they are not needed (as is the case when building just a proc-macro).

Fixes #9828
2021-08-23 20:04:47 +00:00
bors
f066c50d65 Auto merge of #9821 - steffahn:a_an, r=Eh2406
Fix typos “a”→“an”

See rust-lang/rust#88230
2021-08-23 19:39:22 +00:00
bors
dca71e22d9 Auto merge of #9832 - Tindarid:patch-1, r=ehuss
Fix typo in git-authentication.md
2021-08-23 19:11:04 +00:00
Eric Huss
00e925f61f Fix panic with build-std of a proc-macro. 2021-08-23 12:06:32 -07:00
bors
d28ca0b421 Auto merge of #9831 - ehuss:fix-debug, r=Eh2406
Add some debug logging for `cargo fix`

This adds some debug logging to the `cargo fix` command to give better insight into what it is actually doing. I've needed to try to debug some things recently where this would have been useful, since cargo runs rustc many times with different arguments.  I think this will be useful if other people report problems, we can ask them to run with `CARGO_LOG=cargo::ops::fix=trace` to gather more information.
2021-08-23 18:45:32 +00:00
bors
835d5576e1 Auto merge of #9830 - ehuss:document-third-party-registries, r=alexcrichton
Add documentation about third-party registries.

This adds a link to the wiki where a list of third-party registries can be maintained.
2021-08-23 17:43:37 +00:00
bors
3f68ff4fe3 Auto merge of #9818 - hi-rustin:rustin-patch-fix, r=alexcrichton
unset the FIX_ENV when executing the real rustc

close https://github.com/rust-lang/cargo/issues/9706
2021-08-23 17:03:28 +00:00
Weihang Lo
a5f8bc94f5
Improve resolver message for validate_links 2021-08-24 00:39:38 +08:00
Weihang Lo
0afd40b4de
Update tests to display dep-req info for dep-chain 2021-08-24 00:39:38 +08:00
Weihang Lo
70a3ccb885
Display dep requirement info for cyclic dependencies 2021-08-24 00:39:38 +08:00
Weihang Lo
7d22a309d7
Add dep requirement info for dep-chain display 2021-08-24 00:39:37 +08:00
bors
bcfd8930b6 Auto merge of #9801 - arlosi:checksum, r=alexcrichton
Allow crate download by checksum

The `dl` key in `config.json` currently allows the following substitutions: {crate}, {version}, {prefix}, {lowerprefix}.

This change adds a {checksum} placeholder for the crate's sha256 checksum. Does not change any existing behavior.

Allowing downloads by checksum makes it possible for crate files to be placed in a content addressable store.
2021-08-23 16:37:47 +00:00
bors
8b5771f05e Auto merge of #9792 - weihanglo:issue-9782, r=ehuss
Emit warning for migrating to unstable edition in stable channel

Resolves #9782

Also alter the original error message slightly.
2021-08-23 16:07:05 +00:00
Nursan Valeyev
793c697857
Fix typo in git-authentication.md 2021-08-23 19:03:33 +03:00
bors
491deb6de8 Auto merge of #9771 - hi-rustin:rustin-patch-dep, r=ehuss
Warning for no lib dependencies

close https://github.com/rust-lang/cargo/issues/6702
2021-08-23 15:36:56 +00:00
Eric Huss
9fe4a4e55f Add some debug logging for cargo fix 2021-08-23 08:11:30 -07:00
bors
1bc1868ea7 Auto merge of #9824 - ehuss:disable-std_docs, r=alexcrichton
Temporarily disable extern-html-root-url test.

A change in https://github.com/rust-lang/rust/pull/82776 broke this test,
so disabling for now until it is figured out how things are going to work.
2021-08-23 15:08:18 +00:00
Eric Huss
a5e069722a Add documentation about third-party registries. 2021-08-23 07:17:10 -07:00
Eric Huss
ec23482df8 Temporarily disable extern-html-root-url test.
A change in https://github.com/rust-lang/rust/pull/82776 broke this test,
so disabling for now until it is figured out how things are going to work.
2021-08-22 09:24:46 -07:00
Frank Steffahn
ff881ee262 Fix more typos, “an”→“a” and “an”→“and” 2021-08-22 17:57:35 +02:00
Frank Steffahn
0a036a2e2a Fix another typo “a”→“an” 2021-08-22 17:22:14 +02:00
Frank Steffahn
5c9d614fce Fix typos “a”→“an” 2021-08-22 14:25:31 +02:00
hi-rustin
4c11002b9d Better fmt for file body
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-08-21 23:54:59 +08:00
hi-rustin
4225c46297 unset the FIX_ENV when executing the real rustc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-08-21 23:48:49 +08:00
bors
216f915c46 Auto merge of #9814 - ehuss:move-tmp, r=alexcrichton
Move `tmp` test directory.

The `tmp` directory added in #9375 was placed within the profile directory (such as `target/debug/tmp` or `target/release/tmp`).  This causes problems for any cargo target (binary, test, etc.) with the name `tmp` as there is a name collision.  This PR attempts to address that by moving the `tmp` directory to the root of the target directory (`target/tmp`), and reserving the profile name "tmp".

Fixes #9783
2021-08-20 22:23:14 +00:00
bors
2733a6a6b6 Auto merge of #9813 - ehuss:fix-license-file, r=alexcrichton
Fix test incorrectly validating CARGO_PKG_LICENSE_FILE.

This test had two flaws. One is that it used the wrong key name for `license-file`, and the second was that it wasn't checking the value was set.
2021-08-20 21:53:10 +00:00
Eric Huss
cfcb0786dd Fix test incorrectly validating CARGO_PKG_LICENSE_FILE. 2021-08-20 12:16:25 -07:00
Eric Huss
4e7fe836d5 Move tmp test directory. 2021-08-20 12:12:42 -07:00
bors
580461bd40 Auto merge of #9774 - Aaron1011:future-incompat-config, r=ehuss
Implement `[future-incompat-report]` config section

Currently, I've just implemented the `always` and `never` frequencies
from the RFC, which don't require tracking any additional state.

cc `@ehuss`
2021-08-20 04:03:50 +00:00
bors
53ea285774 Auto merge of #9809 - ehuss:bump-curl, r=Eh2406
Bump curl.

This updates to the latest version of curl (7.78).  7.77 which is used in rust-lang/rust had an issue where it was failing in Windows 8.  I have confirmed that 7.78 works correctly.

Fixes #9788
2021-08-20 01:45:15 +00:00
Eric Huss
7f1c80ea7f Bump curl. 2021-08-19 17:46:45 -07:00
Aaron Hill
88679e07f2
Implement [future-incompat-report] config section
Currently, I've just implemented the `always` and `never` frequencies
from the RFC, which don't require tracking any additional state.
2021-08-19 15:59:36 -05:00
bors
b64c96bfa0 Auto merge of #9793 - nipunn1313:install_parallel2, r=alexcrichton
Determine packages to install prior to installing

Old logic (pseudocode)
```
for krate in to_install {
    pkg = determine_pkg(krate);
    install_pkg(pkg);
}
```
New logic
```
let pkgs = to_install.into_iter(|krate| determine_pkg(krate));
pkgs.into_iter(|pkg| install_pkg(pkg));
```

This has the short term benefit of dumping most error messages out earlier in the process (eg a typo in the second package name).

Longer term, it might help with #9741 - as only the second loop would be parallelized. First loop shouldn't be parallelized because it would lead to redundant registry/git updates.
2021-08-19 19:13:11 +00:00
Nipunn Koorapati
f9c2d04592 Factor into struct InstallablePackage 2021-08-19 09:57:53 -07:00
l00556901
51d48e96c2 fmt 2021-08-19 19:53:28 +08:00
heisenberg
16865630d9
Update doc.rs 2021-08-19 19:39:40 +08:00
QiangHeisenberg
6b0e2f7423 Add cargo doc --examples subcommand 2021-08-19 19:23:58 +08:00
bors
259ea8c055 Auto merge of #9803 - ehuss:fix-edition-resolve-differences-dev-deps, r=alexcrichton
Show feature resolver differences for dev-dependencies.

During the crater run for 2021, there was a package that failed to update in a confusing way. The issue is that a feature was removed in the new resolver, but only for a dev-dependency. The report displayed with `cargo fix --edition` did not say anything about that, so it took me a bit to figure it out.  This changes it so that the report also includes changes to features of dev-dependencies.  I honestly don't remember my thought process behind the original code.

For example, the offending package now says:

```
When building the following dependencies, the given features will no longer be used:

  log v0.4.8 removed features: std
  syn v0.15.44 (as host dependency) removed features: extra-traits, visit

The following differences only apply when building with dev-dependencies:

  phf_shared v0.7.24 (as host dependency) removed features: unicase
```

And the error that happens after updating to 2021 is:

```
error[E0277]: the trait bound `UniCase<&str>: phf_shared::PhfHash` is not satisfied
  --> /Users/eric/.cargo/registry/src/github.com-1ecc6299db9ec823/mime_guess-1.8.7/build.rs:37:21
   |
37 |         forward_map.entry(UniCase(key), &format!("{:?}", val));
   |                     ^^^^^ the trait `phf_shared::PhfHash` is not implemented for `UniCase<&str>`
```

Hopefully developers will be able to see the note about the feature `unicase` being removed from `phf_shared`, and the error message about `UniCase` not implementing `PhfHash`, and connect the two together.  Previously, the upgrade report didn't mention anything about `phf_shared`, and thus no clues on what went wrong.
2021-08-18 14:09:06 +00:00
Eric Huss
5939e212e0 Show feature resolver differences for dev-dependencies. 2021-08-17 16:41:53 -07:00
bors
e96bdb0c3d Auto merge of #9802 - joshtriplett:triagebot-windows, r=alexcrichton
Support using rustbot to ping the Windows group
2021-08-17 22:58:47 +00:00
Josh Triplett
83c87e702f Support using rustbot to ping the Windows group 2021-08-17 14:45:20 -07:00
Arlo Siemsen
c890be276d Allow crate download by checksum
The `dl` key in `config.json` currently allows the following substitutions:
{crate}, {version}, {prefix}, {lowerprefix}.

This change adds a {sha256-checksum} placeholder for the crate's sha256 checksum.

Allowing download by checksum makes it easier for crate files to be placed
in a content addressable store.
2021-08-17 11:56:06 -07:00
bors
d837917526 Auto merge of #9799 - ehuss:fix-abnormal-error, r=alexcrichton
Show information about abnormal `fix` errors.

During a recent crater run, we ran into a few circumstances where `cargo fix` failed unexpectedly, and we can't reproduce the errors locally.  The sequence was:

1. Cargo ran `rustc` and collected the diagnostics to apply, and modified the files.
2. Cargo ran `rustc` again to verify the fixes. This step failed, but only emitted warnings.
3. Cargo ran `rustc` again to show the original diagnostics, and this exited normally with warnings.

We don't know why the second step failed.  This change makes it so that cargo will collect any non-diagnostic messages (like ICEs), and will also display the exit code if it is abnormal.
2021-08-17 18:47:05 +00:00