]> git.proxmox.com Git - cargo.git/log
cargo.git
3 years agoMake windows CI happy
hi-rustin [Tue, 31 Aug 2021 08:54:16 +0000 (16:54 +0800)]
Make windows CI happy

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoprint the full destination path when no track duplicates
hi-rustin [Sat, 28 Aug 2021 04:57:41 +0000 (12:57 +0800)]
print the full destination path when no track duplicates

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9846 - ehuss:fix-only-edition-lints, r=alexcrichton
bors [Mon, 30 Aug 2021 14:17:26 +0000 (14:17 +0000)]
Auto merge of #9846 - ehuss:fix-only-edition-lints, r=alexcrichton

Change `cargo fix --edition` to only fix edition lints.

This changes it so that `cargo fix --edition` will only fix edition lints.  The reason for this is that sometimes non-edition lints get in the way, and make suggestions that can cause failures.  An example is a user that only ever runs `cargo test` or `cargo check --profile=test` locally, and doesn't realize there are problems with running without `cfg(test)` such as unused warnings.

This works by using `--cap-lints=allow` along with `--force-warn` which takes precedence over `cap-lints`.

This only works on nightly since `--force-warn` is still unstable.  I will update this as part of #9800.

Closes #5738

3 years agoAuto merge of #9848 - nipunn1313:desc, r=alexcrichton
bors [Fri, 27 Aug 2021 19:40:28 +0000 (19:40 +0000)]
Auto merge of #9848 - nipunn1313:desc, r=alexcrichton

Show desc of well known subcommands (fmt, clippy) in cargo --list

Fixes #8680

An approach to #8680 that shows these in `cargo --list` without showing them directly in the `cargo --help`.

```
➜  cargo git:(desc) target/debug/cargo --list | grep clippy
    clippy               Checks a package to catch common mistakes and improve your Rust code.
```

Here's what mine looks like visually now:
![image](https://user-images.githubusercontent.com/1300387/131178775-2255ef0d-1993-47dd-bc73-9015394b967c.png)

3 years agoShow desc of well known subcommands (fmt, clippy) in cargo --list
Nipunn Koorapati [Fri, 27 Aug 2021 19:20:55 +0000 (12:20 -0700)]
Show desc of well known subcommands (fmt, clippy) in cargo --list

3 years agoChange `cargo fix --edition` to only fix edition lints.
Eric Huss [Fri, 27 Aug 2021 16:26:11 +0000 (09:26 -0700)]
Change `cargo fix --edition` to only fix edition lints.

3 years agoAuto merge of #9843 - ehuss:fix-test-cargo-env, r=alexcrichton
bors [Thu, 26 Aug 2021 22:54:55 +0000 (22:54 +0000)]
Auto merge of #9843 - ehuss:fix-test-cargo-env, r=alexcrichton

Fix test not to rely on `cargo` in PATH.

This fixes a test that was trying to execute `cargo` from PATH.  This test doesn't work on rust-lang/rust where the rustup installation is removed, and thus there is no `cargo` in PATH.

3 years agoFix test not to rely on `cargo` in PATH.
Eric Huss [Thu, 26 Aug 2021 21:06:32 +0000 (14:06 -0700)]
Fix test not to rely on `cargo` in PATH.

3 years agoAuto merge of #9827 - weihanglo:issue-6199, r=Eh2406
bors [Wed, 25 Aug 2021 17:36:11 +0000 (17:36 +0000)]
Auto merge of #9827 - weihanglo:issue-6199, r=Eh2406

Improve resolver message to include dependency requirements

Resolves #6199.

Thanks for previous efforts: #5452, #6374, #6665, which are great but somehow outdated, so I tweak them and create this PR. This will also be obsolete if we ship pubgrub-rs with cargo in the future πŸ˜ƒ But before that happens, IMO these changes are still helpful.

---

This PR changes the resolver error message from

https://github.com/rust-lang/cargo/blob/216f915c46b8ada2323423d049314ba18247ef95/tests/testsuite/build.rs#L1104-L1106

to

https://github.com/rust-lang/cargo/blob/0afd40b4de17a5c45145a0762beb4ef001720fe1/tests/testsuite/build.rs#L1104-L1106

Also provide different message for different source kinds, such like:

https://github.com/rust-lang/cargo/blob/0afd40b4de17a5c45145a0762beb4ef001720fe1/tests/testsuite/build.rs#L2810-L2812

## TODO?

From https://github.com/rust-lang/cargo/pull/5452#issuecomment-402832200, there shall be at least one task left behind:

> 3. Special case pind by a lock file and not a `"=1.1.2"` in a dependency. Also add a "note: try cargo update" to the end.

In this PR, `validate_links` also faces this issue that a dependency requirement is locked into a precise version `=0.1.0`.

https://github.com/rust-lang/cargo/blob/a5f8bc94f5d38539dd127f735ea4d3a515c230fd/tests/testsuite/build_script.rs#L1002-L1004

I am uncertain about how to resolve this. Besides  the function`validate_links`, is this problem really a thing that may happen? If not, since `validate_links` only handles old validation logic, it may be ok to drop the commit a5f8bc94f5d38539dd127f735ea4d3a515c230fd and leave it as is.

3 years agoAuto merge of #9836 - Firstyear:9804-cargo-docs-improve, r=alexcrichton
bors [Tue, 24 Aug 2021 14:06:23 +0000 (14:06 +0000)]
Auto merge of #9836 - Firstyear:9804-cargo-docs-improve, r=alexcrichton

Add hint for cargo metadata in environment section

Fixes #9804

3 years agoAdd hint for cargo metadata in environment section
William Brown [Tue, 24 Aug 2021 03:15:07 +0000 (13:15 +1000)]
Add hint for cargo metadata in environment section

3 years agoAuto merge of #9834 - ehuss:fix-build-std-proc-macro-only, r=alexcrichton
bors [Mon, 23 Aug 2021 20:04:47 +0000 (20:04 +0000)]
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`](https://github.com/rust-lang/cargo/blob/835d5576e1f0b917a42ba18a9556242204377cd1/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`](https://github.com/rust-lang/cargo/blob/835d5576e1f0b917a42ba18a9556242204377cd1/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

3 years agoAuto merge of #9821 - steffahn:a_an, r=Eh2406
bors [Mon, 23 Aug 2021 19:39:22 +0000 (19:39 +0000)]
Auto merge of #9821 - steffahn:a_an, r=Eh2406

Fix typos β€œaβ€β†’β€œan”

See rust-lang/rust#88230

3 years agoAuto merge of #9832 - Tindarid:patch-1, r=ehuss
bors [Mon, 23 Aug 2021 19:11:04 +0000 (19:11 +0000)]
Auto merge of #9832 - Tindarid:patch-1, r=ehuss

Fix typo in git-authentication.md

3 years agoFix panic with build-std of a proc-macro.
Eric Huss [Mon, 23 Aug 2021 19:06:32 +0000 (12:06 -0700)]
Fix panic with build-std of a proc-macro.

3 years agoAuto merge of #9831 - ehuss:fix-debug, r=Eh2406
bors [Mon, 23 Aug 2021 18:45:32 +0000 (18:45 +0000)]
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.

3 years agoAuto merge of #9830 - ehuss:document-third-party-registries, r=alexcrichton
bors [Mon, 23 Aug 2021 17:43:37 +0000 (17:43 +0000)]
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.

3 years agoAuto merge of #9818 - hi-rustin:rustin-patch-fix, r=alexcrichton
bors [Mon, 23 Aug 2021 17:03:28 +0000 (17:03 +0000)]
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

3 years agoImprove resolver message for validate_links
Weihang Lo [Mon, 23 Aug 2021 03:36:42 +0000 (11:36 +0800)]
Improve resolver message for validate_links

3 years agoUpdate tests to display dep-req info for dep-chain
Weihang Lo [Sun, 22 Aug 2021 16:10:15 +0000 (00:10 +0800)]
Update tests to display dep-req info for dep-chain

3 years agoDisplay dep requirement info for cyclic dependencies
Weihang Lo [Sun, 22 Aug 2021 16:08:02 +0000 (00:08 +0800)]
Display dep requirement info for cyclic dependencies

3 years agoAdd dep requirement info for dep-chain display
Weihang Lo [Sun, 22 Aug 2021 16:04:41 +0000 (00:04 +0800)]
Add dep requirement info for dep-chain display

3 years agoAuto merge of #9801 - arlosi:checksum, r=alexcrichton
bors [Mon, 23 Aug 2021 16:37:47 +0000 (16:37 +0000)]
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.

3 years agoAuto merge of #9792 - weihanglo:issue-9782, r=ehuss
bors [Mon, 23 Aug 2021 16:07:05 +0000 (16:07 +0000)]
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.

3 years agoFix typo in git-authentication.md
Nursan Valeyev [Mon, 23 Aug 2021 16:03:33 +0000 (19:03 +0300)]
Fix typo in git-authentication.md

3 years agoAuto merge of #9771 - hi-rustin:rustin-patch-dep, r=ehuss
bors [Mon, 23 Aug 2021 15:36:56 +0000 (15:36 +0000)]
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

3 years agoAdd some debug logging for `cargo fix`
Eric Huss [Mon, 23 Aug 2021 15:11:30 +0000 (08:11 -0700)]
Add some debug logging for `cargo fix`

3 years agoAuto merge of #9824 - ehuss:disable-std_docs, r=alexcrichton
bors [Mon, 23 Aug 2021 15:08:18 +0000 (15:08 +0000)]
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.

3 years agoAdd documentation about third-party registries.
Eric Huss [Mon, 23 Aug 2021 14:17:10 +0000 (07:17 -0700)]
Add documentation about third-party registries.

3 years agoTemporarily disable extern-html-root-url test.
Eric Huss [Sun, 22 Aug 2021 16:24:46 +0000 (09:24 -0700)]
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.

3 years agoFix more typos, β€œanβ€β†’β€œa” and β€œanβ€β†’β€œand”
Frank Steffahn [Sun, 22 Aug 2021 15:57:35 +0000 (17:57 +0200)]
Fix more typos, β€œanβ€β†’β€œa” and β€œanβ€β†’β€œand”

3 years agoFix another typo β€œaβ€β†’β€œan”
Frank Steffahn [Sun, 22 Aug 2021 15:22:14 +0000 (17:22 +0200)]
Fix another typo β€œaβ€β†’β€œan”

3 years agoFix typos β€œaβ€β†’β€œan”
Frank Steffahn [Sun, 22 Aug 2021 12:25:31 +0000 (14:25 +0200)]
Fix typos β€œaβ€β†’β€œan”

3 years agoBetter fmt for file body
hi-rustin [Sat, 21 Aug 2021 15:54:59 +0000 (23:54 +0800)]
Better fmt for file body

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agounset the FIX_ENV when executing the real rustc
hi-rustin [Sat, 21 Aug 2021 15:48:49 +0000 (23:48 +0800)]
unset the FIX_ENV when executing the real rustc

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9814 - ehuss:move-tmp, r=alexcrichton
bors [Fri, 20 Aug 2021 22:23:14 +0000 (22:23 +0000)]
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

3 years agoAuto merge of #9813 - ehuss:fix-license-file, r=alexcrichton
bors [Fri, 20 Aug 2021 21:53:10 +0000 (21:53 +0000)]
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.

3 years agoFix test incorrectly validating CARGO_PKG_LICENSE_FILE.
Eric Huss [Fri, 20 Aug 2021 19:16:25 +0000 (12:16 -0700)]
Fix test incorrectly validating CARGO_PKG_LICENSE_FILE.

3 years agoMove `tmp` test directory.
Eric Huss [Fri, 20 Aug 2021 19:12:42 +0000 (12:12 -0700)]
Move `tmp` test directory.

3 years agoAuto merge of #9774 - Aaron1011:future-incompat-config, r=ehuss
bors [Fri, 20 Aug 2021 04:03:50 +0000 (04:03 +0000)]
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`

3 years agoAuto merge of #9809 - ehuss:bump-curl, r=Eh2406
bors [Fri, 20 Aug 2021 01:45:15 +0000 (01:45 +0000)]
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

3 years agoBump curl.
Eric Huss [Fri, 20 Aug 2021 00:46:45 +0000 (17:46 -0700)]
Bump curl.

3 years agoImplement `[future-incompat-report]` config section
Aaron Hill [Tue, 4 May 2021 04:24:08 +0000 (00:24 -0400)]
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.

3 years agoAuto merge of #9793 - nipunn1313:install_parallel2, r=alexcrichton
bors [Thu, 19 Aug 2021 19:13:11 +0000 (19:13 +0000)]
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.

3 years agoFactor into struct InstallablePackage
Nipunn Koorapati [Wed, 18 Aug 2021 18:34:33 +0000 (11:34 -0700)]
Factor into struct InstallablePackage

3 years agoAuto merge of #9803 - ehuss:fix-edition-resolve-differences-dev-deps, r=alexcrichton
bors [Wed, 18 Aug 2021 14:09:06 +0000 (14:09 +0000)]
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.

3 years agoShow feature resolver differences for dev-dependencies.
Eric Huss [Tue, 17 Aug 2021 23:41:53 +0000 (16:41 -0700)]
Show feature resolver differences for dev-dependencies.

3 years agoAuto merge of #9802 - joshtriplett:triagebot-windows, r=alexcrichton
bors [Tue, 17 Aug 2021 22:58:47 +0000 (22:58 +0000)]
Auto merge of #9802 - joshtriplett:triagebot-windows, r=alexcrichton

Support using rustbot to ping the Windows group

3 years agoSupport using rustbot to ping the Windows group
Josh Triplett [Tue, 17 Aug 2021 21:45:20 +0000 (14:45 -0700)]
Support using rustbot to ping the Windows group

3 years agoAllow crate download by checksum
Arlo Siemsen [Mon, 16 Aug 2021 20:55:33 +0000 (13:55 -0700)]
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.

3 years agoAuto merge of #9799 - ehuss:fix-abnormal-error, r=alexcrichton
bors [Tue, 17 Aug 2021 18:47:05 +0000 (18:47 +0000)]
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.

3 years agoShow information about abnormal `fix` errors.
Eric Huss [Tue, 17 Aug 2021 15:04:02 +0000 (08:04 -0700)]
Show information about abnormal `fix` errors.

3 years agoAuto merge of #9798 - ehuss:bump-jobserver, r=alexcrichton
bors [Tue, 17 Aug 2021 14:03:02 +0000 (14:03 +0000)]
Auto merge of #9798 - ehuss:bump-jobserver, r=alexcrichton

Bump jobserver.

Pulls in https://github.com/alexcrichton/jobserver-rs/pull/35 to fix https://github.com/rust-lang/rust/issues/88091.

3 years agoBump jobserver.
Eric Huss [Tue, 17 Aug 2021 13:57:49 +0000 (06:57 -0700)]
Bump jobserver.

3 years agoAuto merge of #9795 - johnthagen:patch-2, r=ehuss
bors [Tue, 17 Aug 2021 01:30:38 +0000 (01:30 +0000)]
Auto merge of #9795 - johnthagen:patch-2, r=ehuss

Render build-std web links as hyperlinks

Several hyperlinks in the unstable docs page are not rendered properly as links when the documentation is built. This PR addresses this.

<img width="622" alt="Screenshot 2021-08-16 201532" src="https://user-images.githubusercontent.com/10340167/129644467-2c8ec535-3d44-497e-8fba-d8364b794faf.png">

3 years agoFix an additional link
johnthagen [Tue, 17 Aug 2021 00:18:30 +0000 (20:18 -0400)]
Fix an additional link

3 years agoRender build-std web links as hyperlinks
johnthagen [Tue, 17 Aug 2021 00:14:30 +0000 (20:14 -0400)]
Render build-std web links as hyperlinks

3 years agoRefactor additional validation steps to determine_package
Nipunn Koorapati [Mon, 16 Aug 2021 20:46:11 +0000 (13:46 -0700)]
Refactor additional validation steps to determine_package

3 years agoRefactor install_one into two parts
Nipunn Koorapati [Sun, 15 Aug 2021 07:02:01 +0000 (00:02 -0700)]
Refactor install_one into two parts

3 years agoAuto merge of #9791 - nipunn1313:cargo_crash_alias_loop, r=alexcrichton
bors [Mon, 16 Aug 2021 15:01:11 +0000 (15:01 +0000)]
Auto merge of #9791 - nipunn1313:cargo_crash_alias_loop, r=alexcrichton

Teach cargo to failfast on recursive/corecursive aliases

Eg.
[alias]
test-1 = test-2
test-2 = test-3
test-3 = test-1

Previously it would stack overflow
Pulled out non controversial bits from from #9768

3 years agoAuto merge of #9789 - ehuss:fix-value-after-table-profile, r=alexcrichton
bors [Mon, 16 Aug 2021 14:09:42 +0000 (14:09 +0000)]
Auto merge of #9789 - ehuss:fix-value-after-table-profile, r=alexcrichton

Fix value-after-table error with profiles.

If the `strip`, `dir-name`, or `inherits` fields were included along with a profile override, then `cargo publish` would fail with a `ValueAfterTable` error because the fields were listed in the wrong order in the struct definition.

Fixes #9787

3 years agoRefine warnings and better code
hi-rustin [Mon, 16 Aug 2021 02:04:18 +0000 (10:04 +0800)]
Refine warnings and better code

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoTeach cargo to failfast on recursive/corecursive aliases
Nipunn Koorapati [Fri, 6 Aug 2021 00:21:13 +0000 (17:21 -0700)]
Teach cargo to failfast on recursive/corecursive aliases

Eg.
[alias]
test-1 = test-2
test-2 = test-3
test-3 = test-1

Previously it would stack overflow

It pulls out non controversial bits from from #9768

3 years agoTest for warning of migrating to unstable edition
Weihang Lo [Sun, 15 Aug 2021 09:16:39 +0000 (17:16 +0800)]
Test for warning of migrating to unstable edition

3 years agoEmit warning for migrating to unstable edition in stable channel
Weihang Lo [Sun, 15 Aug 2021 09:14:59 +0000 (17:14 +0800)]
Emit warning for migrating to unstable edition in stable channel

3 years agoRefactor echo cargo subcommand test helper into cargo-test-support
Nipunn Koorapati [Mon, 9 Aug 2021 17:01:04 +0000 (10:01 -0700)]
Refactor echo cargo subcommand test helper into cargo-test-support

3 years agoAuto merge of #9790 - ehuss:fix-plugin-registrar, r=alexcrichton
bors [Sun, 15 Aug 2021 05:02:47 +0000 (05:02 +0000)]
Auto merge of #9790 - ehuss:fix-plugin-registrar, r=alexcrichton

Fix plugin registrar change.

The plugin tests were broken due to a change in https://github.com/rust-lang/rust/pull/85296 which removed the `plugin_registrar` attribute.

3 years agoFix plugin registrar change.
Eric Huss [Sat, 14 Aug 2021 22:28:30 +0000 (15:28 -0700)]
Fix plugin registrar change.

3 years agoFix value-after-table error with profiles.
Eric Huss [Sat, 14 Aug 2021 21:45:25 +0000 (14:45 -0700)]
Fix value-after-table error with profiles.

3 years agoAuto merge of #9627 - whereistejas:many-bin-names, r=ehuss
bors [Wed, 11 Aug 2021 21:11:45 +0000 (21:11 +0000)]
Auto merge of #9627 - whereistejas:many-bin-names, r=ehuss

Ability to specify the output name for a bin target different from the crate name

Hi,

I have opened this to close the following issue #1706 .

I have decided to start by writing a test to outline what behavior is expected from `Cargo`.
As of now, this test fails (for obvious reasons). I will now start writing the code needed to pass this test.

This is my first time contributing to cargo. Please, feel free to let me know if there are any protocols/processes that need to be followed. I'm a newbie at this.

Closes issue #1706

3 years agoAbility to specify the output name for a bin target different from the crate name
Tejas Sanap [Sat, 26 Jun 2021 12:21:55 +0000 (17:51 +0530)]
Ability to specify the output name for a bin target different from the crate name

3 years agoSeparate warning and with root_id
hi-rustin [Tue, 10 Aug 2021 14:49:00 +0000 (22:49 +0800)]
Separate warning and with root_id

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9773 - nipunn1313:cargo_list_dupe, r=alexcrichton
bors [Mon, 9 Aug 2021 18:40:05 +0000 (18:40 +0000)]
Auto merge of #9773 - nipunn1313:cargo_list_dupe, r=alexcrichton

Deduplicate entries in cargo --list

Fixes #6088

3 years agoDeduplicate entries in cargo --list
Nipunn Koorapati [Sat, 7 Aug 2021 07:11:01 +0000 (00:11 -0700)]
Deduplicate entries in cargo --list

Fixes #6088

3 years agoAuto merge of #9764 - djmitche:issue8486, r=alexcrichton
bors [Mon, 9 Aug 2021 16:15:43 +0000 (16:15 +0000)]
Auto merge of #9764 - djmitche:issue8486, r=alexcrichton

Include aliases with other commands

The principal result is that they are now automatically included in the
`cargo --list` output.  Fixes #8486.

3 years agoJust return a vec
hi-rustin [Mon, 9 Aug 2021 08:35:09 +0000 (16:35 +0800)]
Just return a vec

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoInclude aliases with other commands
Dustin J. Mitchell [Thu, 5 Aug 2021 01:04:24 +0000 (01:04 +0000)]
Include aliases with other commands

The principal result is that they are now automatically included in the
`cargo --list` output.  Fixes #8486.

3 years agoUse batch warnings and only warn about used dependency packages
hi-rustin [Sat, 7 Aug 2021 06:10:14 +0000 (14:10 +0800)]
Use batch warnings and only warn about used dependency packages

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoWarning for no lib dependencies
hi-rustin [Sat, 7 Aug 2021 03:51:56 +0000 (11:51 +0800)]
Warning for no lib dependencies

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9118 - bjorn3:profile_codegen_backend_option, r=joshtriplett
bors [Fri, 6 Aug 2021 20:43:21 +0000 (20:43 +0000)]
Auto merge of #9118 - bjorn3:profile_codegen_backend_option, r=joshtriplett

Add a profile option to select the codegen backend

This makes it possible to compile only specific crates with a certain codegen backend.

I have tested this by compiling Bevy with cg_llvm, but one of the examples using cg_clif.

By the way I noticed that many unstable profile options are not checked when using profile overrides.

3 years agoFix compile error
bjorn3 [Fri, 6 Aug 2021 18:10:26 +0000 (20:10 +0200)]
Fix compile error

3 years agoAuto merge of #9617 - danieleades:refactor/useless-conversions, r=ehuss
bors [Fri, 6 Aug 2021 17:09:04 +0000 (17:09 +0000)]
Auto merge of #9617 - danieleades:refactor/useless-conversions, r=ehuss

remove useless conversions

3 years agoAuto merge of #9613 - danieleades:refactor/collapse-if-blocks, r=ehuss
bors [Fri, 6 Aug 2021 16:44:10 +0000 (16:44 +0000)]
Auto merge of #9613 - danieleades:refactor/collapse-if-blocks, r=ehuss

collapse nested if blocks

3 years agoAuto merge of #9767 - nipunn1313:refactor, r=alexcrichton
bors [Fri, 6 Aug 2021 14:39:45 +0000 (14:39 +0000)]
Auto merge of #9767 - nipunn1313:refactor, r=alexcrichton

Refactor fake_file() away from cargo_command tests

There are already similar preexisting test helpers which
also work on windows. Port over the executable-creation
helper into the file() helper and things appear to pass.

Was inspired to do this when trying to add tests to solve a separate issue.

3 years agoRefactor fake_file() away from cargo_command tests
Nipunn Koorapati [Fri, 6 Aug 2021 00:19:42 +0000 (17:19 -0700)]
Refactor fake_file() away from cargo_command tests

There are already similar preexisting test helpers which
also work on windows. Port over the executable-creation
helper into the file() helper and things appear to pass.

3 years agoFix test
bjorn3 [Thu, 5 Aug 2021 15:17:50 +0000 (17:17 +0200)]
Fix test

3 years agoUpdate error message
bjorn3 [Thu, 5 Aug 2021 15:15:22 +0000 (17:15 +0200)]
Update error message

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
3 years agoOnly allow internal backends
bjorn3 [Thu, 5 Aug 2021 13:26:01 +0000 (15:26 +0200)]
Only allow internal backends

3 years agoAuto merge of #9762 - erickt:bump, r=ehuss
bors [Thu, 5 Aug 2021 01:23:53 +0000 (01:23 +0000)]
Auto merge of #9762 - erickt:bump, r=ehuss

Update cargo-platform to 0.1.2

This preps cargo-platform for a release. The only substantial change is that this should include the license files into the archive that is uploaded to crates.io.

Closes #9758

3 years agoAuto merge of #9760 - alexcrichton:bump-jobserver, r=Eh2406
bors [Thu, 5 Aug 2021 00:59:49 +0000 (00:59 +0000)]
Auto merge of #9760 - alexcrichton:bump-jobserver, r=Eh2406

Bump to the latest jobserver dependency

This should help mitigate #9739 at least with a better error message as
opposed to deadlocking.

3 years agoAuto merge of #9763 - erickt:fix-semver-check, r=ehuss
bors [Thu, 5 Aug 2021 00:36:09 +0000 (00:36 +0000)]
Auto merge of #9763 - erickt:fix-semver-check, r=ehuss

Fix semver check for rust 1.54.0

This updates semver.md to use the new error message for reporting missing generic arguments.

3 years agoFix semver check for rust 1.54.0
Erick Tryzelaar [Wed, 4 Aug 2021 23:59:38 +0000 (16:59 -0700)]
Fix semver check for rust 1.54.0

This updates semver.md to use the new error message for reporting missing
generic arguments.

3 years agoUpdate cargo-platform to 0.1.2
Erick Tryzelaar [Wed, 4 Aug 2021 23:11:52 +0000 (16:11 -0700)]
Update cargo-platform to 0.1.2

This preps cargo-platform for a release. The only substantial change is that
this should include the license files into the archive that is uploaded to
crates.io.

Closes #9758

3 years agoUpdate test
bjorn3 [Sun, 31 Jan 2021 17:08:47 +0000 (18:08 +0100)]
Update test

3 years agoAdd a profile option to select the codegen backend
bjorn3 [Sun, 31 Jan 2021 15:45:38 +0000 (16:45 +0100)]
Add a profile option to select the codegen backend

This makes it possible to compile only specific crates with a certain
codegen backend.

3 years agoBump to the latest jobserver dependency
Alex Crichton [Wed, 4 Aug 2021 14:25:07 +0000 (07:25 -0700)]
Bump to the latest jobserver dependency

This should help mitigate #9739 at least with a better error message as
opposed to deadlocking.

3 years agoAuto merge of #9732 - djc:rust-version-docs, r=ehuss
bors [Mon, 2 Aug 2021 20:28:08 +0000 (20:28 +0000)]
Auto merge of #9732 - djc:rust-version-docs, r=ehuss

Stabilize the rust-version field

I've tried to make the documentation here fairly comprehensive. I've also updated the first version for the 2021 edition, which should now be stable pending substantial unforeseen changes.

See #8072.

3 years agoAdd a CHANGELOG entry
Dirkjan Ochtman [Mon, 2 Aug 2021 09:28:47 +0000 (11:28 +0200)]
Add a CHANGELOG entry

3 years agoStabilize rust-version
Dirkjan Ochtman [Tue, 27 Jul 2021 18:57:46 +0000 (20:57 +0200)]
Stabilize rust-version

3 years agoDocument the rust-version field
Dirkjan Ochtman [Tue, 27 Jul 2021 14:33:57 +0000 (16:33 +0200)]
Document the rust-version field