]> git.proxmox.com Git - cargo.git/log
cargo.git
3 years agoremove unnecessary 'collect'
Daniel Eades [Wed, 23 Jun 2021 10:30:28 +0000 (11:30 +0100)]
remove unnecessary 'collect'

3 years agoAuto merge of #9679 - ehuss:testsuite-custom-toolchain, r=alexcrichton
bors [Mon, 12 Jul 2021 16:41:52 +0000 (16:41 +0000)]
Auto merge of #9679 - ehuss:testsuite-custom-toolchain, r=alexcrichton

Make it easier to run testsuite with a custom toolchain.

The optimization added in #9206 to circumvent the rustup wrapper for rustc had a bad interaction when using a custom toolchain (like `cargo +stage1 test`).  It was using the `rustc` from where `cargo` is located, but custom toolchains often don't have cargo. This would instead use the nightly rustc (due to rustup's [fallback](https://github.com/rust-lang/rustup/blob/eaee3e723cd44b4b968b79b0ec2e8f766f1dfc77/src/config.rs#L942-L975)).  This changes it to query rustup directly to ask it where the overridden rustc is located.

3 years agoAuto merge of #9677 - ehuss:serialize-fix, r=alexcrichton
bors [Mon, 12 Jul 2021 16:16:36 +0000 (16:16 +0000)]
Auto merge of #9677 - ehuss:serialize-fix, r=alexcrichton

Serialize `cargo fix`

This changes `cargo fix` so that it only fixes one crate at a time. Previously, it would allow concurrent fixing across packages. This caused a problem if a workspace uses things like `#[path]` or `include!()` of a shared file between packages. A real-world example of this is serde, which has [this](https://github.com/serde-rs/serde/blob/9c39115f827170f7adbdfa4115f5916c5979393c/serde_derive_internals/lib.rs#L43-L45) which reuses the some source files between the `serde` and `serde_derive` packages. Modifying those files concurrently causes corruption and the fix will fail.

Closes #6528

3 years agoAuto merge of #9658 - ehuss:cargo.toml-preamble-link, r=alexcrichton
bors [Mon, 12 Jul 2021 15:24:26 +0000 (15:24 +0000)]
Auto merge of #9658 - ehuss:cargo.toml-preamble-link, r=alexcrichton

Don't recommend filing issues on rust-lang/cargo for Cargo.toml errors.

I don't think this suggestion has ever led to something useful, and is just confusing.

cc #9610

3 years agoAuto merge of #9657 - ehuss:clearer-nightly-requirements, r=alexcrichton
bors [Mon, 12 Jul 2021 14:55:37 +0000 (14:55 +0000)]
Auto merge of #9657 - ehuss:clearer-nightly-requirements, r=alexcrichton

Update nightly failure notification.

This makes several changes to try to clarify errors with nightly requirements.

- Don't tell the user to edit `Cargo.toml` if it is not a local package. Things like registry packages are not under their control.
- Include the version number in the error message.
- Try to make better suggestions on what to do.
- Remove the redirects for stabilized features in unstable.md, and instead include a small stub that tells the user when it was stabilized and where to find more information. This should help with people using older releases which provide links to this page, to help them know which version they will need.

Closes #9610

3 years agoAuto merge of #9654 - ehuss:windows-env-upper-check, r=alexcrichton
bors [Mon, 12 Jul 2021 14:26:23 +0000 (14:26 +0000)]
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.

3 years agoAuto merge of #9662 - ehuss:unignore-fix_edition_2021, r=alexcrichton
bors [Mon, 12 Jul 2021 13:39:49 +0000 (13:39 +0000)]
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.

3 years agoMake it easier to run testsuite with a custom toolchain.
Eric Huss [Sun, 11 Jul 2021 21:02:47 +0000 (14:02 -0700)]
Make it easier to run testsuite with a custom toolchain.

3 years agoSerialize `cargo fix`
Eric Huss [Sun, 11 Jul 2021 01:47:52 +0000 (18:47 -0700)]
Serialize `cargo fix`

3 years agoAuto merge of #9666 - hi-rustin:rustin-patch-warn, r=ehuss
bors [Fri, 9 Jul 2021 19:29:28 +0000 (19:29 +0000)]
Auto merge of #9666 - hi-rustin:rustin-patch-warn, r=ehuss

Warning when using features in patch

part of https://github.com/rust-lang/cargo/issues/3034

3 years agoRemove unrelated cases
hi-rustin [Fri, 9 Jul 2021 05:15:13 +0000 (13:15 +0800)]
Remove unrelated cases

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoDon't recommend filing issues on rust-lang/cargo for Cargo.toml errors.
Eric Huss [Mon, 5 Jul 2021 23:20:31 +0000 (16:20 -0700)]
Don't recommend filing issues on rust-lang/cargo for Cargo.toml errors.

3 years agoWarning when using features in patch
hi-rustin [Thu, 8 Jul 2021 07:25:13 +0000 (15:25 +0800)]
Warning when using features in patch

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9655 - jyn514:verbose, r=ehuss
bors [Wed, 7 Jul 2021 16:51:14 +0000 (16:51 +0000)]
Auto merge of #9655 - jyn514:verbose, r=ehuss

Unify cargo and rustc's error reporting

Fixes https://github.com/rust-lang/rust/issues/86854.

 ## Don't print "run the command again with --verbose"

Here is a typical error seen by users of Cargo:

```
error[E0601]: `main` function not found in crate `wrong`
  |
  = note: consider adding a `main` function to `src/main.rs`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0601`.
error: could not compile `wrong`

To learn more, run the command again with --verbose.
```

The `--verbose` output is not particularly helpful in this case. The
error is unrelated to what cargo is doing, and passing `--verbose` will
not give useful information about how to proceed. Additionally, it's
unclear that `--verbose` is referring to the cargo command and not
rustc; this is especially true when cargo is wrapped by another build
system (such as Meson, x.py, or Make).

This omits the "run the command again with --verbose" output. --verbose
is still shown in `cargo build --help`, but it's not singled out above
all the other options.

 ##  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:

```
$ 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: 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
```

3 years agoUnignore fix_edition_2021.
Eric Huss [Wed, 7 Jul 2021 02:28:13 +0000 (19:28 -0700)]
Unignore fix_edition_2021.

3 years agoCombine rustc and cargo's diagnostic summaries
Joshua Nelson [Mon, 5 Jul 2021 21:32:40 +0000 (17:32 -0400)]
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
```

3 years agoUpdate nightly failure notification.
Eric Huss [Mon, 5 Jul 2021 23:08:36 +0000 (16:08 -0700)]
Update nightly failure notification.

3 years agoDon't print "run the command again with --verbose"
Joshua Nelson [Mon, 5 Jul 2021 20:27:51 +0000 (16:27 -0400)]
Don't print "run the command again with --verbose"

Here is a typical error seen by users of Cargo:

```
error[E0601]: `main` function not found in crate `wrong`
  |
  = note: consider adding a `main` function to `src/main.rs`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0601`.
error: could not compile `wrong`

To learn more, run the command again with --verbose.
```

The `--verbose` output is not particularly helpful in this case. The
error is unrelated to what cargo is doing, and passing `--verbose` will
not give useful information about how to proceed. Additionally, it's
unclear that `--verbose` is referring to the cargo command and not
rustc; this is especially true when cargo is wrapped by another build
system (such as Meson, x.py, or Make).

This omits the "run the command again with --verbose" output. --verbose
is still shown in `cargo build --help`, but it's not singled out above
all the other options.

3 years agoUpdate Windows env uppercase key check.
Eric Huss [Mon, 5 Jul 2021 17:10:51 +0000 (10:10 -0700)]
Update Windows env uppercase key check.

3 years agoAuto merge of #9649 - ehuss:edition2021-report-tweaking, r=alexcrichton
bors [Fri, 2 Jul 2021 20:35:38 +0000 (20:35 +0000)]
Auto merge of #9649 - ehuss:edition2021-report-tweaking, r=alexcrichton

Adjust the edition2021 resolver diff report.

This makes some adjustments to the report given on `cargo fix --edition` when there are differences in the feature resolver.

- Tweak the wording to be clearer.
- Removed the "activated dependencies" differences. This doesn't actually work (dependencies aren't ever completely removed), and isn't all that interesting (since it would be duplicating the same information from the feature differences).

3 years agoAdjust the edition2021 resolver diff report.
Eric Huss [Fri, 2 Jul 2021 20:01:58 +0000 (13:01 -0700)]
Adjust the edition2021 resolver diff report.

3 years agoAuto merge of #9647 - ehuss:fingerprint-linker, r=alexcrichton
bors [Fri, 2 Jul 2021 15:10:51 +0000 (15:10 +0000)]
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.

3 years agoAuto merge of #9646 - ehuss:windows-case-disable, r=alexcrichton
bors [Fri, 2 Jul 2021 14:47:02 +0000 (14:47 +0000)]
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

3 years agoAuto merge of #9645 - ehuss:git-package-wt_deleted, r=alexcrichton
bors [Fri, 2 Jul 2021 14:22:23 +0000 (14:22 +0000)]
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

3 years agoAuto merge of #9644 - ehuss:offline-and-frozen, r=alexcrichton
bors [Fri, 2 Jul 2021 13:56:54 +0000 (13:56 +0000)]
Auto merge of #9644 - ehuss:offline-and-frozen, r=alexcrichton

Adjust error message with offline and frozen.

Using --offline with --frozen when the lock file needed to be updated gave a confusing error message. This updates it to make it slightly clearer.

Closes #9572

3 years agoInclude the linker in the fingerprint.
Eric Huss [Fri, 2 Jul 2021 03:33:48 +0000 (20:33 -0700)]
Include the linker in the fingerprint.

3 years agoTemporarily disable windows env test.
Eric Huss [Fri, 2 Jul 2021 02:41:13 +0000 (19:41 -0700)]
Temporarily disable windows env test.

3 years agoHandle git deleted files with dirty worktree.
Eric Huss [Fri, 2 Jul 2021 01:10:35 +0000 (18:10 -0700)]
Handle git deleted files with dirty worktree.

3 years agoAdjust error message with offline and frozen.
Eric Huss [Thu, 1 Jul 2021 22:58:45 +0000 (15:58 -0700)]
Adjust error message with offline and frozen.

3 years agoAuto merge of #9531 - 5225225:cargo-doc-open-fix, r=ehuss
bors [Thu, 1 Jul 2021 01:14:50 +0000 (01:14 +0000)]
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

3 years agoAuto merge of #9635 - toothbrush7777777:patch-1, r=alexcrichton
bors [Wed, 30 Jun 2021 17:57:59 +0000 (17:57 +0000)]
Auto merge of #9635 - toothbrush7777777:patch-1, r=alexcrichton

Exclude `target` from content-indexing on Windows

This has a noticeable performance improvement for most projects, especially when the storage device is a hard drive.

Closes #8694

3 years agoAuto merge of #9642 - ehuss:2021-edition-disable, r=alexcrichton
bors [Wed, 30 Jun 2021 16:45:52 +0000 (16:45 +0000)]
Auto merge of #9642 - ehuss:2021-edition-disable, r=alexcrichton

Temporarily ignore 2021 edition fix.

The latest nightly broke the interaction of `--force-warns` and `--cap-lints`.  Since this will likely take at least a few days to fix, I am temporarily disabling this test to get cargo's CI working again.

3 years agoTemporarily ignore 2021 edition fix.
Eric Huss [Wed, 30 Jun 2021 16:36:22 +0000 (09:36 -0700)]
Temporarily ignore 2021 edition fix.

3 years agoAuto merge of #9638 - ehuss:ignore-future_incompat, r=alexcrichton
bors [Tue, 29 Jun 2021 19:01:57 +0000 (19:01 +0000)]
Auto merge of #9638 - ehuss:ignore-future_incompat, r=alexcrichton

Temporarily disable future_incompat tests.

The `array_into_iter` lint is no longer future-breaking (via https://github.com/rust-lang/rust/pull/86330), so these tests won't work anymore.  This disables the tests until https://github.com/rust-lang/rust/pull/86478 is merged to provide a way to start testing again.

3 years agoTemporarily disable future_incompat tests.
Eric Huss [Tue, 29 Jun 2021 18:56:03 +0000 (11:56 -0700)]
Temporarily disable future_incompat tests.

3 years agorustfmt
Toothbrush [Tue, 29 Jun 2021 17:18:28 +0000 (18:18 +0100)]
rustfmt

3 years agoChange `if cfg!(..) { }` to `#[cfg!(..)] { }`
Toothbrush [Tue, 29 Jun 2021 16:19:14 +0000 (17:19 +0100)]
Change `if cfg!(..) { }` to `#[cfg!(..)] { }`

This fixes builds on non-Windows platforms.

3 years agoFormat `exclude_from_content_indexing`
Toothbrush [Mon, 28 Jun 2021 20:45:59 +0000 (21:45 +0100)]
Format `exclude_from_content_indexing`

3 years agoExclude `target` from content-indexing on Windows
Toothbrush [Mon, 28 Jun 2021 19:12:44 +0000 (20:12 +0100)]
Exclude `target` from content-indexing on Windows

This has a noticeable performance improvement for most projects, especially when the storage device is a hard drive.

Closes #8694

3 years agoFully match stderr, return if not nightly, shorten file
5225225 [Mon, 28 Jun 2021 17:29:38 +0000 (18:29 +0100)]
Fully match stderr, return if not nightly, shorten file

3 years agoAuto merge of #9625 - hi-rustin:rustin-msg, r=ehuss
bors [Fri, 25 Jun 2021 17:17:55 +0000 (17:17 +0000)]
Auto merge of #9625 - hi-rustin:rustin-msg, r=ehuss

Include toolchain specification in error message

close https://github.com/rust-lang/rustup/issues/2795

3 years agoInclude toolchain specification in error message
hi-rustin [Fri, 25 Jun 2021 13:59:32 +0000 (21:59 +0800)]
Include toolchain specification in error message

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9612 - Bryysen:master, r=alexcrichton
bors [Wed, 23 Jun 2021 21:38:32 +0000 (21:38 +0000)]
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

3 years agoAuto merge of #9615 - danieleades:refactor/simplify-block, r=joshtriplett
bors [Wed, 23 Jun 2021 15:37:42 +0000 (15:37 +0000)]
Auto merge of #9615 - danieleades:refactor/simplify-block, r=joshtriplett

simply 'if' block

3 years agoAuto merge of #9614 - danieleades:refactor/closures-and-iterators, r=Eh2406
bors [Wed, 23 Jun 2021 14:00:49 +0000 (14:00 +0000)]
Auto merge of #9614 - danieleades:refactor/closures-and-iterators, r=Eh2406

tidy some closures and iterators

3 years agoAuto merge of #9620 - danieleades:refactor/use-writeln, r=Eh2406
bors [Wed, 23 Jun 2021 13:33:38 +0000 (13:33 +0000)]
Auto merge of #9620 - danieleades:refactor/use-writeln, r=Eh2406

use 'writeln' instead of appending newline character

3 years agouse 'writeln' instead of appending newline character
Daniel Eades [Wed, 23 Jun 2021 11:20:18 +0000 (12:20 +0100)]
use 'writeln' instead of appending newline character

3 years agosimply 'if' block
Daniel Eades [Wed, 23 Jun 2021 10:22:04 +0000 (11:22 +0100)]
simply 'if' block

3 years agotidy some closures and iterators
Daniel Eades [Wed, 23 Jun 2021 10:10:02 +0000 (11:10 +0100)]
tidy some closures and iterators

3 years agoError when packaging with git dependencies without version
Bryysen [Tue, 22 Jun 2021 23:55:57 +0000 (01:55 +0200)]
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.

3 years agoAuto merge of #9607 - hi-rustin:rustin-patch-cargo-toml, r=ehuss
bors [Tue, 22 Jun 2021 21:32:55 +0000 (21:32 +0000)]
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

3 years agoAuto merge of #9574 - ehuss:weak-namespaced, r=alexcrichton
bors [Tue, 22 Jun 2021 21:02:31 +0000 (21:02 +0000)]
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.

3 years agoAuto merge of #9563 - ehuss:link-cdylib-warning, r=alexcrichton
bors [Tue, 22 Jun 2021 19:27:25 +0000 (19:27 +0000)]
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.

3 years agoOnly testing on linux
hi-rustin [Tue, 22 Jun 2021 07:36:32 +0000 (15:36 +0800)]
Only testing on linux

3 years agoDetect incorrectly named cargo.toml for build
hi-rustin [Tue, 22 Jun 2021 06:43:19 +0000 (14:43 +0800)]
Detect incorrectly named cargo.toml for build

3 years agoDetect incorrectly named cargo.toml for install --path
hi-rustin [Tue, 22 Jun 2021 06:12:27 +0000 (14:12 +0800)]
Detect incorrectly named cargo.toml for install --path

3 years agoDetect incorrectly named cargo.toml for install --git
hi-rustin [Mon, 21 Jun 2021 07:24:50 +0000 (15:24 +0800)]
Detect incorrectly named cargo.toml for install --git

3 years agoAuto merge of #9606 - ehuss:future-incompat-enhancements, r=alexcrichton
bors [Mon, 21 Jun 2021 17:51:53 +0000 (17:51 +0000)]
Auto merge of #9606 - ehuss:future-incompat-enhancements, r=alexcrichton

Updates to future-incompatible reporting.

This includes several changes to future-incompatible reports:

- Now able to retain multiple reports on disk (currently 5).
- `cargo report future-incompatibilities` will now show the last report without `--id`.
- Changed `cargo report future-incompatibilities` to display the report on stdout. Although these are "diagnostics", I see this more as a human-readable "report", which might benefit from being more easily piped (like to a pager). I also expect all other report subcommands to print to stdout.
- Fixed a bug where saving the reports to disk was not truncating the file. If multiple reports were saved, and future ones were *shorter* than a previous one, the on-disk structure would be corrupted.
- Reports are now always stored with ANSI escape codes, and the color filtering is done only when displayed.
- Some slight adjustments to the formatting of the report.
- When the wrong `--id` is passed, show available reports.
- Give a slightly better error message when there are no reports.
- Fixed bug where "0 dependencies has warnings" was unconditionally displayed (it should only be displayed if --future-incompat-report is used)
- Added `future-incompat` as an alias for the `future-incompatibilities` subcommand which can be quite a verbose command.
- When showing the note at the end of the build, make sure the list is unique (for example, if a single package had multiple targets that trigger a warning).
- Added a note at the bottom of the report that indicates if newer versions of a package are available.

3 years agoDon't trigger an update when looking for suggestions.
Eric Huss [Mon, 21 Jun 2021 16:55:29 +0000 (09:55 -0700)]
Don't trigger an update when looking for suggestions.

3 years agoPrint reports using shell to handle old Windows colors properly.
Eric Huss [Mon, 21 Jun 2021 16:43:35 +0000 (09:43 -0700)]
Print reports using shell to handle old Windows colors properly.

3 years agoAdd ON_DISK_VERSION constant.
Eric Huss [Mon, 21 Jun 2021 16:27:36 +0000 (09:27 -0700)]
Add ON_DISK_VERSION constant.

3 years agoFuture-incompat report: Add suggestions of newer versions.
Eric Huss [Sun, 20 Jun 2021 22:58:55 +0000 (15:58 -0700)]
Future-incompat report: Add suggestions of newer versions.

3 years agoAdd `future-incompat` as an alias for `future-incompatibilities`.
Eric Huss [Sun, 20 Jun 2021 16:38:08 +0000 (09:38 -0700)]
Add `future-incompat` as an alias for `future-incompatibilities`.

3 years agoUpdates to future-incompatible reporting.
Eric Huss [Sun, 20 Jun 2021 16:32:43 +0000 (09:32 -0700)]
Updates to future-incompatible reporting.

3 years agoAuto merge of #9602 - ehuss:diesel-warning, r=alexcrichton
bors [Mon, 21 Jun 2021 15:43:27 +0000 (15:43 +0000)]
Auto merge of #9602 - ehuss:diesel-warning, r=alexcrichton

Add a compatibility notice for diesel and the new resolver.

This adds a notice about a compatibility issue with diesel and the new feature resolver. This will display a notice if it detects the scenario where diesel causes a build error.  It also prints a not when using `cargo fix --edition` when it detects a setup that may fail.

3 years agoAuto merge of #9579 - wickerwaka:env-config-override, r=ehuss
bors [Mon, 21 Jun 2021 15:09:41 +0000 (15:09 +0000)]
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

3 years agoAuto merge of #9604 - ehuss:is_symlink, r=alexcrichton
bors [Mon, 21 Jun 2021 14:06:50 +0000 (14:06 +0000)]
Auto merge of #9604 - ehuss:is_symlink, r=alexcrichton

Disambiguate is_symlink.

`Path::is_symlink` was added in https://github.com/rust-lang/rust/pull/85747 which triggers the `unstable_name_collisions` lint, breaking Cargo's CI.  This switches it to a free function to avoid the collision.

3 years agoRemove mention of diesel 2.0.
Eric Huss [Mon, 21 Jun 2021 13:28:02 +0000 (06:28 -0700)]
Remove mention of diesel 2.0.

3 years agoDisambiguate is_symlink.
Eric Huss [Sat, 19 Jun 2021 18:00:19 +0000 (11:00 -0700)]
Disambiguate is_symlink.

3 years agoDon't use CargoDocConfig struct
5225225 [Sat, 19 Jun 2021 16:45:44 +0000 (17:45 +0100)]
Don't use CargoDocConfig struct

3 years agoAuto merge of #9583 - rust-lang:dependabot/cargo/opener-0.5, r=ehuss
bors [Fri, 18 Jun 2021 20:57:46 +0000 (20:57 +0000)]
Auto merge of #9583 - rust-lang:dependabot/cargo/opener-0.5, r=ehuss

Update opener requirement from 0.4 to 0.5

Updates the requirements on [opener](https://github.com/Seeker14491/opener) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Seeker14491/opener/blob/master/CHANGELOG.md">opener's changelog</a>.</em></p>
<blockquote>
<h2>[0.5.0] - 2021-06-11</h2>
<h3>Added</h3>
<ul>
<li><code>open_browser()</code>, which uses the <code>$BROWSER</code> environment variable before falling back to <code>open()</code>.</li>
<li>WSL-specific implementation. Previously, WSL used the same implementation as Linux. Now the strategy on WSL is to use
the system's <code>wslview</code> command from <a href="https://github.com/wslutilities/wslu"><code>wslu</code></a> if available, falling back to the
system <code>xdg-open</code>, if available.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>On Linux (non-WSL), the system <code>xdg-open</code> is now used if present. Otherwise, the bundled version is used, as before.</li>
<li>Avoid blocking the thread on Linux and WSL.</li>
</ul>
<h3>Removed</h3>
<ul>
<li><code>impl From&lt;io::Error&gt; for OpenError</code>.</li>
</ul>
<h2>[0.4.1] - 2019-09-30</h2>
<h3>Changed</h3>
<ul>
<li>Update <code>xdg-open</code>.</li>
</ul>
<h2>[0.4.0] - 2019-05-02</h2>
<h3>Added</h3>
<ul>
<li><code>OpenError</code> now implements <code>std::error::Error</code>.</li>
</ul>
<h3>Changed</h3>
<ul>
<li><code>OpenError</code>'s <code>failure::Fail</code> impl was removed from this crate, but the failure crate provides a blanket impl of
<code>failure::Fail</code> for types implementing <code>std::error::Error</code>, so this shouldn't break anything.</li>
</ul>
<h2>[0.3.0] - 2018-08-18</h2>
<h3>Added</h3>
<ul>
<li><code>stderr</code> field to <code>OpenError::ExitStatus</code> variant, which captures anything the failed process wrote to stderr.</li>
</ul>
<h2>[0.2.0] - 2018-08-08</h2>
<h3>Removed</h3>
<ul>
<li>The <code>open_sys</code> function, which was erroneously pub on non-Windows builds.</li>
</ul>
<h2>[0.1.0] - 2018-08-08</h2>
<ul>
<li>Initial release.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Seeker14491/opener/commit/86e0a154d29a87fbde1dd2548ccb216f078951ee"><code>86e0a15</code></a> Fix Drakefile.ts</li>
<li><a href="https://github.com/Seeker14491/opener/commit/4261c2be991e5ebb1c2de296658cb6bdfabea3ed"><code>4261c2b</code></a> Release v0.5.0</li>
<li><a href="https://github.com/Seeker14491/opener/commit/5d24271a6512089d57cbf8dccf34bc419f918046"><code>5d24271</code></a> Revert command name in error type to <code>&amp;'static str</code></li>
<li><a href="https://github.com/Seeker14491/opener/commit/9a36c6e656cd1100d81b0b37adb64a29bfa3dc91"><code>9a36c6e</code></a> Remove dependency on <code>wsl</code> crate</li>
<li><a href="https://github.com/Seeker14491/opener/commit/165b933775cc2a3ebd7818c6c23f813a86b920f0"><code>165b933</code></a> Avoid blocking</li>
<li><a href="https://github.com/Seeker14491/opener/commit/5c1e99a1c1a2dab3d49780116148c77b3be7d314"><code>5c1e99a</code></a> Update changelog</li>
<li><a href="https://github.com/Seeker14491/opener/commit/2da976eb48d44c1763128461a3547f8168bd60a0"><code>2da976e</code></a> Refactor <code>linux_and_more</code> module</li>
<li><a href="https://github.com/Seeker14491/opener/commit/f5c5564a9cfa17efb8e6d3e7115742818791795d"><code>f5c5564</code></a> Fix newline being included after WSL path conversion</li>
<li><a href="https://github.com/Seeker14491/opener/commit/bd30011d61476bb5d31f898d4127af38b18e15eb"><code>bd30011</code></a> [WSL] Try <code>wslview</code> first instead of second</li>
<li><a href="https://github.com/Seeker14491/opener/commit/e16875d7978f7bbb659dad7518c589813defa80b"><code>e16875d</code></a> Misc formatting changes</li>
<li>Additional commits viewable in <a href="https://github.com/Seeker14491/opener/compare/v0.4.1...v0.5.0">compare view</a></li>
</ul>
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

3 years agoAdd a compatibility notice for diesel and the new resolver.
Eric Huss [Fri, 18 Jun 2021 20:44:39 +0000 (13:44 -0700)]
Add a compatibility notice for diesel and the new resolver.

3 years agoAuto merge of #9586 - tmiasko:lines, r=alexcrichton
bors [Fri, 18 Jun 2021 20:01:46 +0000 (20:01 +0000)]
Auto merge of #9586 - tmiasko:lines, r=alexcrichton

Avoid quadratic complexity when splitting output into lines

When searching for newlines in a process output keep track which part of
buffer was already examined to avoid processing the same data again and
again.

3 years agoAvoid quadratic complexity when splitting output into lines
Tomasz Miąsko [Thu, 17 Jun 2021 00:00:00 +0000 (00:00 +0000)]
Avoid quadratic complexity when splitting output into lines

When searching for newlines in a process output keep track which part of
buffer was already examined to avoid processing the same data again and
again.

3 years agoSimplify line splitting code in `exec_with_streaming` NFC
Tomasz Miąsko [Thu, 17 Jun 2021 00:00:00 +0000 (00:00 +0000)]
Simplify line splitting code in `exec_with_streaming` NFC

3 years agoAuto merge of #9597 - ehuss:version-bump, r=alexcrichton
bors [Fri, 18 Jun 2021 15:56:22 +0000 (15:56 +0000)]
Auto merge of #9597 - ehuss:version-bump, r=alexcrichton

Bump to 0.56.0, update changelog

3 years agoUpdate changelog for 1.54
Eric Huss [Fri, 18 Jun 2021 13:54:22 +0000 (06:54 -0700)]
Update changelog for 1.54

3 years agoBump to 0.56.0
Eric Huss [Fri, 18 Jun 2021 13:17:40 +0000 (06:17 -0700)]
Bump to 0.56.0

3 years agoAuto merge of #9596 - ehuss:fix-dep-info-local, r=alexcrichton
bors [Fri, 18 Jun 2021 03:38:12 +0000 (03:38 +0000)]
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

3 years agoAuto merge of #9595 - ehuss:ws-doc-collision-back-compat, r=alexcrichton
bors [Fri, 18 Jun 2021 03:12:08 +0000 (03:12 +0000)]
Auto merge of #9595 - ehuss:ws-doc-collision-back-compat, r=alexcrichton

Relax doc collision error.

#9526 moved the `cargo doc` output name collision code to be shared with the other collision detection code. However, the way it detected collisions wasn't quite the same, and started generating errors for situations that were just warnings before. It was intended that the code should behave the same, so this PR relaxes the checks to be more like the original code.  (It's still not 100% the same, but should be close enough.)

Closes #9564

3 years agoFix dep-info files including non-local build script paths.
Eric Huss [Fri, 18 Jun 2021 01:28:42 +0000 (18:28 -0700)]
Fix dep-info files including non-local build script paths.

3 years agoRelax doc collision error.
Eric Huss [Thu, 17 Jun 2021 22:56:45 +0000 (15:56 -0700)]
Relax doc collision error.

3 years agoAuto merge of #9584 - henrifrancois:master, r=ehuss
bors [Thu, 17 Jun 2021 16:20:56 +0000 (16:20 +0000)]
Auto merge of #9584 - henrifrancois:master, r=ehuss

Handle "jobs = 0" case in cargo config files

Cargo hangs without output if the jobs argument under build in a cargo/config file is set to 0. This PR handles this case by providing an appropriate error.

Closes #9219

3 years agoHandling job=0 argument in cargo config files.
Henri Francois [Mon, 14 Jun 2021 15:22:22 +0000 (11:22 -0400)]
Handling job=0 argument in cargo config files.

3 years agoAuto merge of #9589 - ehuss:testsuite-diff, r=alexcrichton
bors [Thu, 17 Jun 2021 14:50:47 +0000 (14:50 +0000)]
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.

3 years agoAuto merge of #9590 - hi-rustin:rustin-patch-fix-typo, r=Eh2406
bors [Thu, 17 Jun 2021 14:25:43 +0000 (14:25 +0000)]
Auto merge of #9590 - hi-rustin:rustin-patch-fix-typo, r=Eh2406

Fix typo

 manfiest -> manifest

3 years agoFix typo
hi-rustin [Thu, 17 Jun 2021 07:14:56 +0000 (15:14 +0800)]
Fix typo

3 years agotestsuite: Switch to colored diffs with Myers diff.
Eric Huss [Wed, 16 Jun 2021 22:40:09 +0000 (15:40 -0700)]
testsuite: Switch to colored diffs with Myers diff.

3 years agoOnly normalize paths on windows.
Eric Huss [Wed, 16 Jun 2021 17:28:43 +0000 (10:28 -0700)]
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.

3 years agoRemove the double-backslash escape for matching.
Eric Huss [Wed, 16 Jun 2021 16:41:38 +0000 (09:41 -0700)]
Remove the double-backslash escape for matching.

Using `with_json` is safer since it knows what JSON escaping is.

3 years agoDon't export lines_match.
Eric Huss [Wed, 16 Jun 2021 02:23:17 +0000 (19:23 -0700)]
Don't export lines_match.

Use better high-level interfaces to achieve the same thing.

3 years agoRemove got_symlink_permission, we already have one of those.
Eric Huss [Wed, 16 Jun 2021 01:11:02 +0000 (18:11 -0700)]
Remove got_symlink_permission, we already have one of those.

3 years agoRemove normalized_lines_match, it is not needed.
Eric Huss [Wed, 16 Jun 2021 01:04:50 +0000 (18:04 -0700)]
Remove normalized_lines_match, it is not needed.

3 years agoRemove with_either_contains.
Eric Huss [Wed, 16 Jun 2021 00:48:05 +0000 (17:48 -0700)]
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.

3 years agoMove comparison and diffing code to a new module.
Eric Huss [Tue, 15 Jun 2021 23:23:06 +0000 (16:23 -0700)]
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.

3 years agotestsuite: Support anyhow error chains in error messages.
Eric Huss [Tue, 15 Jun 2021 23:09:03 +0000 (16:09 -0700)]
testsuite: Support anyhow error chains in error messages.

This is intended to help with adding more usage of anyhow in the
testsuite, which can help show context for errors.

This also includes some small improvements to the error messages to
provide more information.

3 years agoAuto merge of #9588 - ehuss:edition2021-force-warns, r=alexcrichton
bors [Wed, 16 Jun 2021 14:51:06 +0000 (14:51 +0000)]
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.

3 years agoAuto merge of #9582 - hi-rustin:rustin-patch-errors, r=ehuss
bors [Wed, 16 Jun 2021 13:03:19 +0000 (13:03 +0000)]
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`

3 years agoRemove some unused code.
Eric Huss [Tue, 15 Jun 2021 22:38:02 +0000 (15:38 -0700)]
Remove some unused code.

3 years agoEnable support for fix --edition for 2021.
Eric Huss [Mon, 7 Jun 2021 20:21:36 +0000 (13:21 -0700)]
Enable support for fix --edition for 2021.