Justin Geibel [Fri, 22 Dec 2017 01:14:12 +0000 (20:14 -0500)]
Always respect `CARGO_TARGET_DIR` during `cargo install`
This aligns the behavior of crates.io and `--git` sources with that of `--path`
regarding the `CARGO_TARGET_DIR` and `CARGO_BUILD_TARGET_DIR` environment
variables. If neither environment variable is set, then a temporary directory
is still used when installing from crates.io or `--git`.
As discussed in #4725, this can be used to enable caching of artifacts between
continuous integration builds.
bors [Wed, 20 Dec 2017 15:01:01 +0000 (15:01 +0000)]
Auto merge of #4837 - alexcrichton:failed-submodule-checkout, r=matklad
Fix updating submodules past failures
If a submodule-of-a-submodule failed to update then Cargo the next time
around wouldn't automatically retry updating the next submodule. This commit
fixes that by ensuring that if a parent git repository looks updated we still
recurse into its own submodules to ensure they're all updated.
Alex Crichton [Tue, 19 Dec 2017 15:34:14 +0000 (07:34 -0800)]
Fix updating submodules past failures
If a submodule-of-a-submodule failed to update then Cargo the next time
around wouldn't automatically retry updating the next submodule. This commit
fixes that by ensuring that if a parent git repository looks updated we still
recurse into its own submodules to ensure they're all updated.
bors [Tue, 19 Dec 2017 02:48:27 +0000 (02:48 +0000)]
Auto merge of #4795 - alexcrichton:failure, r=withoutboats
Start migration to the `failure` crate
This commit is the initial steps to migrate Cargo's error handling from the
`error-chain` crate to the `failure` crate. This is intended to be a low-cost
(in terms of diff) transition where possible so it's note "purely idiomatic
`failure` crate" just yet.
The `error-chain` dependency is dropped in this commit and Cargo now canonically
uses the `Error` type from the `failure` crate. The main last remnant of
`error-chain` is a custom local extension trait to use `chain_err` instead of
`with_context`. I'll try to follow up with a commit that renames this later but
I wanted to make sure everything worked first! (and `chain_err` is used
practically everywhere).
Some minor tweaks happened in the tests as I touched up a few error messages
here and there but overall the UI of Cargo should be exactly the same before and
after this commit.
bors [Tue, 19 Dec 2017 01:48:52 +0000 (01:48 +0000)]
Auto merge of #4836 - sfackler:dl-template, r=withoutboats
Template a registry's dl field
Previously, crate files were always downloaded from
`/{crate}/{version}/download`. However, if the backing crate store for a
custom registry is a raw file server rather than an API endpoint that
requires every file to be named `download` which is a bit weird. Now a
registry's dl URL can be templated with `{crate}` and `{version}` to
have more control over the resulting path.
For backwards compatibility, we append the default template suffix onto
the dl URL if neither of the template parameters are present for
backwards compatibility.
Alex Crichton [Fri, 8 Dec 2017 19:31:17 +0000 (11:31 -0800)]
Start migration to the `failure` crate
This commit is the initial steps to migrate Cargo's error handling from the
`error-chain` crate to the `failure` crate. This is intended to be a low-cost
(in terms of diff) transition where possible so it's note "purely idiomatic
`failure` crate" just yet.
The `error-chain` dependency is dropped in this commit and Cargo now canonically
uses the `Error` type from the `failure` crate. The main last remnant of
`error-chain` is a custom local extension trait to use `chain_err` instead of
`with_context`. I'll try to follow up with a commit that renames this later but
I wanted to make sure everything worked first! (and `chain_err` is used
practically everywhere).
Some minor tweaks happened in the tests as I touched up a few error messages
here and there but overall the UI of Cargo should be exactly the same before and
after this commit.
bors [Tue, 19 Dec 2017 00:41:01 +0000 (00:41 +0000)]
Auto merge of #4832 - andreastt:dumb_terminal_progress, r=alexcrichton
util/progress: no progress reporting in dumb terminals
cargo should not assume that all terminals have direct access to
the terminal. Dumb terminals are those that can interpret only a
limited number of control codes (CR, LF, &c.) and the escape codes
used by the progress bar breaks output in these by asserting control
over the cursor position to draw a bar.
A dumb terminal is identified by the TERM output variable being set to
"dumb". This adds a direct check for this in src/cargo/util/progress.rs
because TERM=dumb does not imply the same as the -q flag.
Steven Fackler [Mon, 18 Dec 2017 23:22:04 +0000 (15:22 -0800)]
Template a registry's dl field
Previously, crate files were always downloaded from
`/{crate}/{version}/download`. However, if the backing crate store for a
custom registry is a raw file server rather than an API endpoint that
requires every file to be named `download` which is a bit weird. Now a
registry's dl URL can be templated with `{crate}` and `{version}` to
have more control over the resulting path.
For backwards compatibility, we append the default template suffix onto
the dl URL if neither of the template parameters are present for
backwards compatibility.
bors [Mon, 18 Dec 2017 19:30:28 +0000 (19:30 +0000)]
Auto merge of #4818 - alexcrichton:rename-link-paths, r=matklad
Fix renaming a project using build scripts
This commit fixes an issue in Cargo where if a project's folder was
renamed but it also contained a build script the project could break.
Cargo would continue to use the previous `rustc-link-search` arguments
to configure env vars like `LD_LIBRARY_PATH` but the literal values from
the previous compilation would be stale as the directories would no
longer be there.
To fix this when parsing the build script output we now retain a log of
the previous output directory of a build script invocation as well as
the current output, tweaking paths as appropriate if they were contained
in the output folder.
Alex Crichton [Thu, 14 Dec 2017 04:54:01 +0000 (20:54 -0800)]
Fix renaming a project using build scripts
This commit fixes an issue in Cargo where if a project's folder was
renamed but it also contained a build script the project could break.
Cargo would continue to use the previous `rustc-link-search` arguments
to configure env vars like `LD_LIBRARY_PATH` but the literal values from
the previous compilation would be stale as the directories would no
longer be there.
To fix this when parsing the build script output we now retain a log of
the previous output directory of a build script invocation as well as
the current output, tweaking paths as appropriate if they were contained
in the output folder.
Andreas Tolfsen [Mon, 18 Dec 2017 16:01:30 +0000 (16:01 +0000)]
util/progress: no progress reporting in dumb terminals
cargo should not assume that all terminals have direct access to
the terminal. Dumb terminals are those that can interpret only a
limited number of control codes (CR, LF, &c.) and the escape codes
used by the progress bar breaks output in these by asserting control
over the cursor position to draw a bar.
A dumb terminal is identified by the TERM output variable being set to
"dumb". This adds a direct check for this in src/cargo/util/progress.rs
because TERM=dumb does not imply the same as the -q flag.
Errors returned by `to_virtual_manifest` were always ignored. As a result, when something was wrong in a virtual manifest, Cargo would unhelpfully exit with no more output than:
```
error: failed to parse manifest at `/tmp/a/Cargo.toml`
Caused by:
no `package` section found.
```
http://doc.crates.io/manifest.html#virtual-manifest defines a virtual manifest as “the `package` table is not present”, so let’s first determine if a manifest is virtual based on that criteria, and then only call one of the two methods.
Although it is not mentioned in the documentation, `[project]` seems to be in the code an alias for `[package]`. So let’s preserve that here too.
Errors returned by `to_virtual_manifest` were always ignored.
As a result, when something was wrong in a virtual manifest,
Cargo would unhelpfully exit with no more output than:
```
error: failed to parse manifest at `/tmp/a/Cargo.toml`
Caused by:
no `package` section found.
```
http://doc.crates.io/manifest.html#virtual-manifest defines
a virtual manifest as “the `package` table is not present”,
so let’s first determine if a manifest is virtual based
on that criteria, and then only call one of the two methods.
Although it is not mentioned in the documentation,
`[project]` seems to be in the code an alias for `[package]`.
So let’s preserve that here too.
bors [Thu, 14 Dec 2017 23:21:33 +0000 (23:21 +0000)]
Auto merge of #4821 - aidanhs:aphs-allow-overflow, r=alexcrichton
Remove overflow checks to eliminate rust build warnings
Although the checks are desirable, they cause warnings in the rust build (due to workspaces) which could cause needless concern. The checks aren't too important, so just disable them.
Remove overflow checks to eliminate rust build warnings
Although the checks are desirable, they cause warnings in the rust build
(due to workspaces) which could cause needless concern. The checks
aren't too important, so just disable them.
bors [Wed, 13 Dec 2017 21:22:53 +0000 (21:22 +0000)]
Auto merge of #4816 - alexcrichton:fix-workspace-is-home, r=matklad
Defer bailing out workspace root probing
This commit alters the logic to bail out on probing for `CARGO_HOME` to
do it a little later rather than early on in the loop iteration, notably
allowing members to reside in `CARGO_HOME` itself.
Alex Crichton [Wed, 13 Dec 2017 21:19:12 +0000 (13:19 -0800)]
Defer bailing out workspace root probing
This commit alters the logic to bail out on probing for `CARGO_HOME` to
do it a little later rather than early on in the loop iteration, notably
allowing members to reside in `CARGO_HOME` itself.
bors [Tue, 12 Dec 2017 20:00:10 +0000 (20:00 +0000)]
Auto merge of #4788 - alexcrichton:rename-works, r=matklad
Avoid rebuilding a project when cwd changes
This commit is targeted at solving a use case which typically comes up during CI
builds -- the `target` directory is cached between builds but the cwd of the
build changes over time. For example the following scenario can happen:
1. A project is compiled at `/projects/a`.
2. The `target` directory is cached.
3. A new build is started in `/projects/b`.
4. The previous `target` directory is restored to `/projects/b`.
5. The build start, and Cargo rebuilds everything.
The last piece of behavior is indeed unfortunate! Cargo's internal hashing
currently isn't that resilient to changing cwd and this PR aims to help improve
the situation!
The first point of too-much-hashing came up with `Target::src_path`. Each
`Target` was hashed and stored for all compilations, and the `src_path` field
was an absolute path on the filesystem to the file that needed to be compiled.
This path then changed over time when cwd changed, but otherwise everything else
remained the same!
This commit updates the handling of the `src_path` field to simply ignore it
when hashing. Instead the path we actually pass to rustc is later calculated and
then passed to the fingerprint calculation.
The next problem this fixes is that the dep info files were augmented after
creation to have the cwd of the compiler at the time to find the files at a
later date. This, unfortunately, would cause issues if the cwd itself changed.
Instead the cwd is now left out of dep-info files (they're no longer augmented)
and instead the cwd is recalculated when parsing the dep info later.
The final problem that this commit fixes is actually an existing issue in Cargo
today. Right now you can actually execute `cargo build` from anywhere in a
project and Cargo will execute the build. Unfortunately though the argument to
rustc was actually different depending on what directory you were in (the
compiler was invoked with a path relative to cwd). This path ends up being used
for metadata like debuginfo which means that different directories would cause
different artifacts to be created, but Cargo wouldn't rerun the compiler!
To fix this issue the matter of cwd is now entirely excluded from compilation
command lines. Instead rustc is unconditionally invoked with a relative path
*if* the path is underneath the workspace root, and otherwise it's invoked as an
absolute path (in which case the cwd doesn't matter).
Once all these fixes were added up it means that now we can have projects where
if you move the entire directory Cargo won't rebuild the original source!
Note that this may be a bit of a breaking change, however. This means that the
paths in error messages for cargo will no longer be unconditionally relative to
the current working directory, but rather relative to the root of the workspace
itself. Unfortunately this is moreso of a feature right now rather than a bug,
so it may be one that we just have to stomach.
Alex Crichton [Fri, 8 Dec 2017 15:43:45 +0000 (07:43 -0800)]
Change Cargo's own dep-file format
This commit alters the format of the dependency info that Cargo keeps track of
for each crate. In order to be more resilient against directory renames and such
Cargo will now postprocess the compiler's dep-info output and serialize into its
own format. This format is intended to primarily list relative paths *to the
root of the relevant package* rather than absolute or relative to some other
location. If paths aren't actually relative to the package root they're still
stored as absolute, but there's not much we can do about that!
bors [Tue, 12 Dec 2017 05:41:53 +0000 (05:41 +0000)]
Auto merge of #4806 - alexcrichton:fix-infinite-loop, r=matklad
Fix an infinite loop in error reporting
The `path_to_root` function unfortunately didn't account for cycles in the
dependency graph introduced through dev-dependencies, so if a cycle was present
then the function would infinitely loop pushing items onto a vector.
This commit fixes the infinite loop and also touches up the reporting to be a
little more consistent with the rest of Cargo
bors [Tue, 12 Dec 2017 04:46:25 +0000 (04:46 +0000)]
Auto merge of #4797 - lukaslueg:issue3169, r=alexcrichton
Bail out when trying to link to a library that is not linkable.
There are more subtleties here than expected, as we can have situations where it is actually Ok to have no linkable targets: Build scripts are a common case, yet benchmark tests started to also fail. I have to say I'm not convinced if the situation "not one target is linkable, yet at least one target is a library (and therefor at least something should be linked)" is actually correct. All tests pass, however, including the one that checks for #3169
Alex Crichton [Sun, 10 Dec 2017 18:14:23 +0000 (10:14 -0800)]
Fix an infinite loop in error reporting
The `path_to_root` function unfortunately didn't account for cycles in the
dependency graph introduced through dev-dependencies, so if a cycle was present
then the function would infinitely loop pushing items onto a vector.
This commit fixes the infinite loop and also touches up the reporting to be a
little more consistent with the rest of Cargo
Alex Crichton [Wed, 6 Dec 2017 22:53:09 +0000 (14:53 -0800)]
Avoid rebuilding a project when cwd changes
This commit is targeted at solving a use case which typically comes up during CI
builds -- the `target` directory is cached between builds but the cwd of the
build changes over time. For example the following scenario can happen:
1. A project is compiled at `/projects/a`.
2. The `target` directory is cached.
3. A new build is started in `/projects/b`.
4. The previous `target` directory is restored to `/projects/b`.
5. The build start, and Cargo rebuilds everything.
The last piece of behavior is indeed unfortunate! Cargo's internal hashing
currently isn't that resilient to changing cwd and this PR aims to help improve
the situation!
The first point of too-much-hashing came up with `Target::src_path`. Each
`Target` was hashed and stored for all compilations, and the `src_path` field
was an absolute path on the filesystem to the file that needed to be compiled.
This path then changed over time when cwd changed, but otherwise everything else
remained the same!
This commit updates the handling of the `src_path` field to simply ignore it
when hashing. Instead the path we actually pass to rustc is later calculated and
then passed to the fingerprint calculation.
The next problem this fixes is that the dep info files were augmented after
creation to have the cwd of the compiler at the time to find the files at a
later date. This, unfortunately, would cause issues if the cwd itself changed.
Instead the cwd is now left out of dep-info files (they're no longer augmented)
and instead the cwd is recalculated when parsing the dep info later.
The final problem that this commit fixes is actually an existing issue in Cargo
today. Right now you can actually execute `cargo build` from anywhere in a
project and Cargo will execute the build. Unfortunately though the argument to
rustc was actually different depending on what directory you were in (the
compiler was invoked with a path relative to cwd). This path ends up being used
for metadata like debuginfo which means that different directories would cause
different artifacts to be created, but Cargo wouldn't rerun the compiler!
To fix this issue the matter of cwd is now entirely excluded from compilation
command lines. Instead rustc is unconditionally invoked with a relative path
*if* the path is underneath the workspace root, and otherwise it's invoked as an
absolute path (in which case the cwd doesn't matter).
Once all these fixes were added up it means that now we can have projects where
if you move the entire directory Cargo won't rebuild the original source!
Note that this may be a bit of a breaking change, however. This means that the
paths in error messages for cargo will no longer be unconditionally relative to
the current working directory, but rather relative to the root of the workspace
itself. Unfortunately this is moreso of a feature right now rather than a bug,
so it may be one that we just have to stomach.
bors [Tue, 5 Dec 2017 21:51:52 +0000 (21:51 +0000)]
Auto merge of #4782 - aidanhs:aphs-dont-incorrectly-compute-cur, r=alexcrichton
Don't incorrectly compute cur from binary heap
In the resolver, [`cur`](https://github.com/rust-lang/cargo/blob/0.23.0/src/cargo/core/resolver/mod.rs#L624) indicates how far through a 'deps frame' the resolver is, i.e. it indicates you're on the nth dep for a particular parent.
In 2015, [this refactoring commit](https://github.com/rust-lang/cargo/commit/502fa5b60a46a2349155562dcd7522ea56d338a7) made the value of `cur` be computed from the top of `remaining_deps`, a stack.
In 2016, [this commit](https://github.com/rust-lang/cargo/commit/4ec278feff81c8cbb92e37ea3dc6811f62351c7f) changed `remaining_deps` to be a binary heap to optimize cargo to choose the 'most constrained' dependencies first. Unfortunately, this means that you can no longer compute `cur`, because the relevant dep frame may not be at the 'top'. The result is that `cur` has been pretty arbitrary for about a year.
Is this a problem? `cur` is only used for debugging printouts so no...but it can underflow, panicking in debug mode! This PR stops incorrectly computing `cur`, storing it instead. It also enables overflow checking in Cargo in release mode for extra sanity checking - this (minor) bug would likely have been caught long ago and the opportunity to flush out other bugs in code that doesn't look arithmetic heavy seems like a good idea.
bors [Tue, 5 Dec 2017 16:32:16 +0000 (16:32 +0000)]
Auto merge of #4774 - lukaslueg:issue4771, r=alexcrichton
Break crate-descriptions at char-, not byte-boundary, avoiding a panic
Fixes #4771. The basic panicking-problem could be fixed by truncating at `char`- instead of `byte`-boundary. This PR takes the long route and uses the unicode-width to always truncate at grapheme-boundary, which should be visually correct in more cases. It adds two extra (extremely common) dependencies to Cargo, though. I have no strong opinions if this is worth it.
While truncating the descriptions, we now also take the length of the names-column into account, including margin, run a little shorter, and have them all of the same total true length.
Before
```
$ cargo search serde
serde = "1.0.23" # A generic serialization/deserialization framework
serde_json = "1.0.7" # A JSON serialization file format
serde_derive_internals = "0.17.0" # AST representation used by Serde derive macros. Unstable.
serde_yaml = "0.7.3" # YAML support for Serde
serde_derive = "1.0.23" # Macros 1.1 implementation of #[derive(Serialize, Deserialize)]
serde_test = "1.0.23" # Token De/Serializer for testing De/Serialize implementations
serde_bytes = "0.10.2" # Optimized handling of `&[u8]` and `Vec<u8>` for Serde
serde_millis = "0.1.1" # A serde wrapper that stores integer millisecond value for timestamps and durations (used similarly to serde_bytes)
serde_codegen_internals = "0.14.2" # AST representation used by Serde codegen. Unstable.
courier = "0.3.1" # Utility to make it easier to send and receive data when using the Rocket framework.
... and 275 crates more (use --limit N to see more)
```
After
```
$ cargo search serde
serde = "1.0.23" # A generic serialization/deserialization framework
serde_json = "1.0.7" # A JSON serialization file format
serde_derive_internals = "0.17.0" # AST representation used by Serde derive macros. Unstable.
serde_yaml = "0.7.3" # YAML support for Serde
serde_derive = "1.0.23" # Macros 1.1 implementation of #[derive(Serialize, Deserialize)]
serde_test = "1.0.23" # Token De/Serializer for testing De/Serialize implementations
serde_bytes = "0.10.2" # Optimized handling of `&[u8]` and `Vec<u8>` for Serde
serde_millis = "0.1.1" # A serde wrapper that stores integer millisecond value for …
serde_codegen_internals = "0.14.2" # AST representation used by Serde codegen. Unstable.
courier = "0.3.1" # Utility to make it easier to send and receive data when using …
... and 275 crates more (use --limit N to see more)
```
Lukas Lueg [Mon, 4 Dec 2017 15:43:53 +0000 (16:43 +0100)]
Break crate-descriptions at char-, not byte-boundary, avoiding a panic
Long running descriptions were truncated at byte-boundary, leading to a
panic during registry::search(); we now break at char-boundary.
Also take length of names-column into account to shorten descriptions.
bors [Wed, 29 Nov 2017 20:57:15 +0000 (20:57 +0000)]
Auto merge of #4764 - matklad:yo-dawg, r=alexcrichton
Document that cargo sets `CARGO` for build scripts
This documents and tests the current behavior.
However, I have two questions:
* Do we support recursively invoking Cargo from the build script?
* Do we support recursively invoking Cargo on the crate's own sources (ie, stuff inside `CARGO_HOME` which gets extracted from `.crate` files, and which in general is not byte-equal to the original sources).
Here's an interesting problem that Servo faced:
* Servo is a workspace.
* Servo's `CARGO_HOME` is inside sources.
* One of Servo's deps uses cbindgen from build.rs
* cbindgen [invokes](https://github.com/eqrion/cbindgen/blob/ef3bd8d307f01ad1171ab69cf911b712fbd73583/src/bindgen/cargo/cargo_metadata.rs#L106) Cargo to read Cargo.toml from a crate inside CARGO_HOME (which is inside worksapce).
This all failed to work as expected, because Cargo invoked by bindgen thought that workspace configuration was wrong.
The problem was fixed on the Servo side by using `exclude` key for workspace.
But do we actually guarantee that this is supposed to work? :) If we do, we might want to apply fix suggested by @nox and avoid looking for workspace root if we are inside `CARGO_HOME`.
Note that cbindgen will probably be broken for crates which are workspaces themselves, because we rewrite members to path dependencies, but, if you have an explicit `members` key, `cargo metadata` inside such workspace in `CARGO_HOME` will complain.
Original IRC discussion: https://botbot.me/mozilla/cargo/2017-11-29/?msg=94061970&page=3
bors [Wed, 29 Nov 2017 20:04:34 +0000 (20:04 +0000)]
Auto merge of #4763 - michaelfairley:master, r=alexcrichton
Allow metadata hash to be computed when checking dylibs
Currently, `cargo check` on a dylib crate will use the same fingerprint files as `build`, resulting in `build`s often having to re-do unnecessary work as previous `build`s fingerprints have been clobbered (specifically, the `profile` hash in the fingerprint will be wrong since `check` runs with a different profile than `build`).
bors [Wed, 29 Nov 2017 03:05:30 +0000 (03:05 +0000)]
Auto merge of #4736 - federicomenaquintero:clarify-patch-from-alternate-sources, r=alexcrichton
Clarify that [patch] can also use sources that are not crates.io
This includes an example of how to use the `[patch.'https://blahblah']` syntax. I couldn't figure out how to make this work until I saw a crate that actually did this.
bors [Wed, 29 Nov 2017 02:17:26 +0000 (02:17 +0000)]
Auto merge of #4762 - alexcrichton:fix-tests, r=alexcrichton
Fix the lockfile-compat test
The newest version of `tar` tweaks the checksum here slightly as the tarball is
slightly different, so this just updates the test to pull the checksum from the
publication rather than hardcoding it.
Alex Crichton [Wed, 29 Nov 2017 01:44:25 +0000 (17:44 -0800)]
Fix the lockfile-compat test
The newest version of `tar` tweaks the checksum here slightly as the tarball is
slightly different, so this just updates the test to pull the checksum from the
publication rather than hardcoding it.
bors [Sat, 18 Nov 2017 00:03:28 +0000 (00:03 +0000)]
Auto merge of #4568 - Metaswitch:alt-registry-publish, r=withoutboats
Add support for publish to optionally take the index that can be used
This form part of alternative-registries RFC-2141, it allows crates to optionally specify which registries the crate can be be published to.
@carols10cents, one thing that I am unsure about is if there is a plan for publish to still provide index, or for registry to be provided instead. I thought that your general view was that we should move away from the index file. If we do need to map allowed registries to the index then there will be a small amount of extra work required once #4506 is merged.
@withoutboats, happy for this to be merged into your branch if you want, the main reason I did not base it on your branch was due to tests not working on there yet.
bors [Sun, 12 Nov 2017 19:13:19 +0000 (19:13 +0000)]
Auto merge of #4714 - Mark-Simulacrum:frozen-freezes, r=alexcrichton
Do not update semantically equivalent lockfiles with --frozen/--locked.
A previous patch in #4684 attempted to fix this, but didn't work for the
case where the [root] crate wasn't the first crate in the sorted package
array.
cc @matklad -- fixes a problem noted in https://github.com/rust-lang/cargo/pull/4684#discussion_r147824900 which appears to have gone unfixed
r? @alexcrichton
Beta backport will be posted as soon as this is reviewed. Merges cleanly.
Mark Simulacrum [Sun, 12 Nov 2017 17:57:05 +0000 (10:57 -0700)]
Do not update semantically equivalent lockfiles with --frozen/--locked.
A previous patch in #4684 attempted to fix this, but didn't work for the
case where the [root] crate wasn't the first crate in the sorted package
array.
bors [Thu, 9 Nov 2017 07:39:03 +0000 (07:39 +0000)]
Auto merge of #4705 - Metaswitch:fix-yank-help, r=matklad
Stop yank -h from panicking on nightly
Increase the gap between the registry option and the description so that the help is parsed correctly. I have also checked the code for the other binaries to ensure that they don't suffer from the same issue.
bors [Tue, 7 Nov 2017 18:12:25 +0000 (18:12 +0000)]
Auto merge of #4701 - mathstuf:update-lockfile-color-reflects-change, r=alexcrichton
cargo_generate_lockfile: use color to also indicate the change
In English, `Updating` and `Removing` are the same length and scanning
the list for changes is hard. Use color to help indicate the kind of
change that is occurring.
Ben Boeckel [Tue, 7 Nov 2017 16:56:38 +0000 (11:56 -0500)]
cargo_generate_lockfile: use color to also indicate the change
In English, `Updating` and `Removing` are the same length and scanning
the list for changes is hard. Use color to help indicate the kind of
change that is occurring.
bors [Mon, 6 Nov 2017 18:35:46 +0000 (18:35 +0000)]
Auto merge of #4646 - alexcrichton:progress, r=matklad
Add a number of progress indicators to Cargo
This commit is an attempt to stem the tide of "cargo is stuck updating the
registry" issues by giving a better indication as to what's happening in
long-running steps. The primary addition here is a `Progress` helper module
which prints and manages a progress bar for long-running operations like git
fetches, git checkouts, HTTP downloads, etc.
The second addition here is to print out when we've been stuck in resolve for
some time. We never really have a progress indicator for crate graph resolution
nor do we know when we're done updating sources. Instead we make a naive
assumption that when you've spent 0.5s in the resolution loop itself (not
updating deps) you're probably done updating dependencies and on to acutal
resolution. This will print out `Resolving crate graph...` and help inform that
Cargo is indeed not stuck looking at the registry, but rather it's churning away
in resolution.
Alex Crichton [Mon, 16 Oct 2017 14:57:38 +0000 (07:57 -0700)]
Add a number of progress indicators to Cargo
This commit is an attempt to stem the tide of "cargo is stuck updating the
registry" issues by giving a better indication as to what's happening in
long-running steps. The primary addition here is a `Progress` helper module
which prints and manages a progress bar for long-running operations like git
fetches, git checkouts, HTTP downloads, etc.
The second addition here is to print out when we've been stuck in resolve for
some time. We never really have a progress indicator for crate graph resolution
nor do we know when we're done updating sources. Instead we make a naive
assumption that when you've spent 0.5s in the resolution loop itself (not
updating deps) you're probably done updating dependencies and on to acutal
resolution. This will print out `Resolving crate graph...` and help inform that
Cargo is indeed not stuck looking at the registry, but rather it's churning away
in resolution.