Auto merge of #5741 - rust-lang:dependabot/cargo/termcolor-1.0, r=alexcrichton
Update termcolor requirement to 1.0
Updates the requirements on [termcolor](https://github.com/BurntSushi/termcolor) to permit the latest version.
<details>
<summary>Commits</summary>
- See full diff in [compare view](https://github.com/BurntSushi/termcolor/commits/wincolor-1.0.0)
</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`.
---
<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 merge` will merge this PR after your CI passes on it
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major 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)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
Updates the requirements on [termcolor](https://github.com/BurntSushi/termcolor) to permit the latest version.
- [Release notes](https://github.com/BurntSushi/termcolor/releases)
- [Commits](https://github.com/BurntSushi/termcolor/commits/wincolor-1.0.0)
Auto merge of #5723 - alexcrichton:cargo-fix, r=ehuss
Import `cargo fix` directly in to Cargo
This commit imports the `cargo fix` subcommand in rust-lang-nursery/rustfix
directly into Cargo as a subcommand. This should allow us to ease our
distribution story of `cargo fix` as we prepare for the upcoming 2018 edition
release.
It's been attempted here to make the code as idiomatic as possible for Cargo's
own codebase. Additionally all tests from cargo-fix were imported into Cargo's
test suite as well. After this lands and is published in nightly the `cargo-fix`
command in rust-lang-nursery/rustfix will likely be removed.
Alex Crichton [Sat, 14 Jul 2018 01:49:26 +0000 (18:49 -0700)]
Import `cargo fix` directly in to Cargo
This commit imports the `cargo fix` subcommand in rust-lang-nursery/rustfix
directly into Cargo as a subcommand. This should allow us to ease our
distribution story of `cargo fix` as we prepare for the upcoming 2018 edition
release.
It's been attempted here to make the code as idiomatic as possible for Cargo's
own codebase. Additionally all tests from cargo-fix were imported into Cargo's
test suite as well. After this lands and is published in nightly the `cargo-fix`
command in rust-lang-nursery/rustfix will likely be removed.
Auto merge of #5732 - Eh2406:sort_unstable, r=alexcrichton`,
most sorts can be unstable
Inspired by [this](https://github.com/rust-lang/cargo/blob/94f7058a483b05ad742da5efb66dd1c2d4b8619c/src/bin/cargo/main.rs#L112-L122) witch was improved in #5691, I did a quick review of `sort`s in the code. Most can be unstable, some can use a `_key` form, and none had unnecessary allocation.
Auto merge of #5710 - RalfJung:default-run, r=alexcrichton
implement default-run option to set default binary for cargo run
The implementation is not pretty but as good as I could make it. The fact that all this logic in `cargo_run` is for diagnosis only and essentially just re-implements the filtering done elsewhere really threw me off.
Auto merge of #5543 - roblabla:doc-private-items, r=alexcrichton
Add document-private-items flag to cargo doc
Add a `--document-private-items` flag to `cargo doc`, that mimics the equivalent `cargo rustdoc -- --document-private-items`. This works by relaying the flag to the underlying rustdoc call.
Auto merge of #5711 - alexcrichton:fix-stack-overflow, r=ehuss
Partially revert dep changes in #5651
Some logic which was tweaked around the dependencies of build script targets was
tweaked slightly in a way that causes cargo to stack overflow by accientally
adding a dependency loop. This commit implements one of the strategies discussed
in #5711 to fix this situation.
The problem here is that when calculating the deps of a build script we need the
build scripts of *other* packages, but the exact profile is somewhat difficult
to guess at the moment we're generating our build script unit. To solve this the
dependencies towards other build scripts' executions is added in a different
pass after all other units have been assembled. At this point we should know for
sure that all build script executions are in the dependency graph, and we just
need to add a few more edges.
Auto merge of #5700 - alexcrichton:update-width, r=matklad
Update terminal width each time we print a display
This should help accomodate terminals that are resized while a progress bar is
being displayed. Additionally this shouldn't come with too much of a performance
impact because we're already heavily throttling printing of a progress update!
Alex Crichton [Wed, 11 Jul 2018 16:27:08 +0000 (09:27 -0700)]
Partially revert dep changes in #5651
Some logic which was tweaked around the dependencies of build script targets was
tweaked slightly in a way that causes cargo to stack overflow by accientally
adding a dependency loop. This commit implements one of the strategies discussed
in #5711 to fix this situation.
The problem here is that when calculating the deps of a build script we need the
build scripts of *other* packages, but the exact profile is somewhat difficult
to guess at the moment we're generating our build script unit. To solve this the
dependencies towards other build scripts' executions is added in a different
pass after all other units have been assembled. At this point we should know for
sure that all build script executions are in the dependency graph, and we just
need to add a few more edges.
Auto merge of #5714 - jeremyBanks:docs-project-to-package, r=alexcrichton
Replace remaining uses of `[project]` in documentation with `[package]`
The `[project]` section is not currently referenced anywhere else in the documentation, so the use here confused me, and I spent a while trying to add it to a `Cargo.toml` that already had a `[package]`.
`[project]` seems to be a deprecated alias for `[package]`, which is documented, so let's swap it out.
Auto merge of #5713 - mbrubeck:doc, r=alexcrichton
Clarify FAQ about Cargo.lock for libraries
The current wording in the FAQ implies that checking in a Cargo.lock for a library could cause version conflicts in consumers of the library, which is not true.
The text in the FAQ was based on [this comment][1] (emphasis mine):
> If each dependent library checked in a Cargo.lock, **and Cargo used it,** you would instead get multiple, duplicate copies of those dependencies
but it accidentally dropped the "and Cargo used it" requirement, which I think is the more important part.
Jeremy Banks [Wed, 11 Jul 2018 17:52:53 +0000 (13:52 -0400)]
Replace remaining uses of `[project]` in documentation with `[package]`
The `[project]` section is not currently referenced anywhere else in the documentation, so the use here confused me. It seems to be a deprecated alias for `[package]`, which is documented, so let's swap it.
Matt Brubeck [Wed, 11 Jul 2018 16:35:55 +0000 (09:35 -0700)]
Clarify FAQ about Cargo.lock for libraries
The current wording in the FAQ implies that checking in a Cargo.lock for
a library could cause version conflicts in consumers of the library,
which is not true.
The text in the FAQ was based on [this comment][1] (emphasis mine):
> If each dependent library checked in a Cargo.lock, **and Cargo used
> it,** you would instead get multiple, duplicate copies of those
> dependencies
but it accidentally dropped the "and Cargo used it" requirement, which I
think is the more important part.
Alex Crichton [Mon, 9 Jul 2018 18:50:59 +0000 (11:50 -0700)]
Update terminal width each time we print a display
This should help accomodate terminals that are resized while a progress bar is
being displayed. Additionally this shouldn't come with too much of a performance
impact because we're already heavily throttling printing of a progress update!
Auto merge of #5698 - alexcrichton:no-progress-sad, r=kennytm
Disable progress bar for build in Cargo
This is primarily blocked on #5695 which unfortunately doesn't have a great fix
today, so disable it for now while we try to work out a better solution.
Alex Crichton [Sun, 8 Jul 2018 15:54:30 +0000 (08:54 -0700)]
Disable progress bar for build in Cargo
This is primarily blocked on #5695 which unfortunately doesn't have a great fix
today, so disable it for now while we try to work out a better solution.
- See full diff in [compare view](https://github.com/indiv0/lazycell/commits/v1.0.0)
</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`.
---
**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.
You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).
<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 merge` will merge this PR after your CI passes on it
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major 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)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
Updates the requirements on [lazycell](https://github.com/indiv0/lazycell) to permit the latest version.
- [Release notes](https://github.com/indiv0/lazycell/releases)
- [Changelog](https://github.com/indiv0/lazycell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/indiv0/lazycell/commits/v1.0.0)
Auto merge of #5651 - ehuss:panic-rustdoc, r=matklad
Fix doctests linking too many libs.
Fixes #5650. cc #5435
As part of my recent work on profiles, I introduced some situations where a
library can be compiled multiple times with different settings. Doctests were
greedily grabbing all dependencies for a package, regardless of which target
is was for. This can cause doctests to fail if it links multiple copies of
the same library.
One way to trigger this is `cargo test --release` if you have dependencies, a
build script, and `panic="abort"`. There are other (more obscure) ways to
trigger it with profile overrides.
Auto merge of #5666 - mikeyhew:fix-shell-quoting, r=alexcrichton
[needs test] always shell-escape command arguments after failure
cc @joshtriplett
fixes #5665
Removes the `debug_string` method, in favour of always using the
`fmt::Display` impl. `debug_string` didn’t escape the command
arguments, so that’s why we ended up with unescaped arguments after
compilation failed.
Don't merge this yet, because I still want to add a regression test. I don't think there's any tests on shell quoting yet, so I'll probably add a new test file including tests for the "Running <command>" output too. I still have to figure out how to write tests, and don't have the energy to do that tonight 😴
I just wanted to say, by the way, I was pleasantly surprised with how clean the code is in this repo, especially compared to rustc. It made it really easy to find the relevant part of the code and implement these changes.
Auto merge of #5673 - matklad:no-internal, r=alexcrichton
Show "duplicates in lockfile" without --verbose
It is possible to get duplicate pacakges after a merge, so it make
sense to print a little bit more details by defaults than just
"failed to parse a lockfile".
It is possible to get invalid lockfile after an automatic merge, so it
make sense to print a little bit more details by defaults than just
"failed to parse a lockfile".
bors [Sat, 30 Jun 2018 18:39:32 +0000 (18:39 +0000)]
Auto merge of #5672 - ehuss:cbfct-take3, r=alexcrichton
cbfct: Take 3
Third attempt to fix race condition in changing_bin_features_caches_targets.
Previous fix for linux re-broke Windows
(https://ci.appveyor.com/project/rust-lang-libs/cargo/build/1.0.5004)
Eric Huss [Sat, 30 Jun 2018 17:59:38 +0000 (10:59 -0700)]
cbfct: Take 3
Third attempt to fix race condition in changing_bin_features_caches_targets.
Previous fix for linux re-broke Windows
(https://ci.appveyor.com/project/rust-lang-libs/cargo/build/1.0.5004)
bors [Fri, 29 Jun 2018 20:29:18 +0000 (20:29 +0000)]
Auto merge of #5652 - Eh2406:masquerade_as_nightly_cargo, r=alexcrichton
skip test if not nightly; fix for #5648
closes #5648
The alternative was to use `set_var` to emulate `masquerade_as_nightly_cargo` but we worried that it would not get unset correctly. Although I think each test is its own process, so it should work.
bors [Fri, 29 Jun 2018 19:24:00 +0000 (19:24 +0000)]
Auto merge of #5669 - alexcrichton:less-build, r=matklad
Fix avoiding a rebuild when moving around a workspace
There's a case where Cargo will recompile a project even if the fingerprint
looks like it's fresh, when some output files are missing. This was intended to
cover the case where an output file was deleted manually or otherwise messed
with. The check here was a bit too eager, however. It checked not only the
actual output destination of the compiler but *also* the location that we hard
link the output file up to.
Due to recent changes in #5460 we don't always create the hard links for path
dependencies in the top-level dir, and this meant that if the library were
compiled and then tested later on the test may recompile the original library by
accident.
The fix in this commit is to cease looking for the hardlink if it exists or not.
This way we only check for the presence of the output file itself and only
recompile if that file is missing. The reason for this is that we
unconditionally relink files into place whether it's fresh or not, so we'll
always recreate the hard link anyway if it's missing.
Alex Crichton [Fri, 29 Jun 2018 19:17:41 +0000 (12:17 -0700)]
Fix avoiding a rebuild when moving around a workspace
There's a case where Cargo will recompile a project even if the fingerprint
looks like it's fresh, when some output files are missing. This was intended to
cover the case where an output file was deleted manually or otherwise messed
with. The check here was a bit too eager, however. It checked not only the
actual output destination of the compiler but *also* the location that we hard
link the output file up to.
Due to recent changes in #5460 we don't always create the hard links for path
dependencies in the top-level dir, and this meant that if the library were
compiled and then tested later on the test may recompile the original library by
accident.
The fix in this commit is to cease looking for the hardlink if it exists or not.
This way we only check for the presence of the output file itself and only
recompile if that file is missing. The reason for this is that we
unconditionally relink files into place whether it's fresh or not, so we'll
always recreate the hard link anyway if it's missing.
bors [Fri, 29 Jun 2018 17:48:34 +0000 (17:48 +0000)]
Auto merge of #5620 - kennytm:compile-progress, r=matklad
Displays a one line progress of what crates are currently built.
cc #2536, #3448.
The change is based on #3451, but uses the progress bar introduced in #4646 instead. The percentage is simply the number of crates processed ÷ total crates count, which is inaccurate but better than nothing.
Michael Hewson [Fri, 29 Jun 2018 04:46:12 +0000 (00:46 -0400)]
Always use the Display impl for ProcessBuilder output
fixes #5665
remove the `debug_string` method, in favour of always using the
`fat::Display` impl. `debug_string` didn’t escape the command
arguments, so that’s why we ended up with unescaped arguments after
compilation failed