Timothy Bess [Wed, 28 Feb 2018 21:43:08 +0000 (16:43 -0500)]
Issue #5087
* targeted error message for virtual manifests
* assert correct error message
Timothy Bess [Wed, 28 Feb 2018 21:17:33 +0000 (16:17 -0500)]
Revert "Issue #5087 * fix broken test case"
This reverts commit
17572b8
Timothy Bess [Wed, 28 Feb 2018 21:12:34 +0000 (16:12 -0500)]
Issue #5087
* fix broken test case
Timothy Bess [Wed, 28 Feb 2018 02:34:04 +0000 (21:34 -0500)]
Issue #5087
* remove Workspace::current_manifest
* remove incorrect logging
* move empty check to Packages::into_package_id_specs
* add test case mentioned in issue
bors [Tue, 27 Feb 2018 14:24:37 +0000 (14:24 +0000)]
Auto merge of #5091 - alexcrichton:update-git2, r=matklad
Update git2 to 0.7.0
cc #5066
Alex Crichton [Tue, 27 Feb 2018 13:14:38 +0000 (05:14 -0800)]
Update git2 to 0.7.0
cc #5066
bors [Tue, 27 Feb 2018 04:44:41 +0000 (04:44 +0000)]
Auto merge of #5070 - Eh2406:clippy, r=alexcrichton
Some Clippy suggestions
This is just some suggestions from Clippy and intellij rust.
Clippy still has a lot to say, but this is some of the simple things.
bors [Tue, 27 Feb 2018 04:24:19 +0000 (04:24 +0000)]
Auto merge of #5059 - tobywhughes:master, r=alexcrichton
Clean with --verbose now prints path of what is being removed.
Added verbose output for the clean command. Simply takes whatever is passed into the rm_rf() function and outputs "Removing /whatever/the/path/to/remove/is"
[Issue this is being used for](https://github.com/rust-lang/cargo/issues/5056)
Eh2406 [Tue, 27 Feb 2018 02:46:59 +0000 (21:46 -0500)]
one more use of entry
Eh2406 [Tue, 27 Feb 2018 02:02:39 +0000 (21:02 -0500)]
some simple clippy things V2
bors [Mon, 26 Feb 2018 23:50:53 +0000 (23:50 +0000)]
Auto merge of #5081 - matklad:document-not-all-the-things, r=alexcrichton
Support --exclude option for `cargo doc`
I think this should have been implemented when the feature was added for
other commands. Probably just an oversight.
cc https://github.com/rust-lang/cargo/pull/4031
r? @alexcrichton
Toby Hughes [Mon, 26 Feb 2018 23:36:23 +0000 (15:36 -0800)]
Merge remote-tracking branch 'upstream/master'
Toby Hughes [Mon, 26 Feb 2018 23:33:23 +0000 (15:33 -0800)]
Added tests for clean with verbose output
Eh2406 [Sat, 24 Feb 2018 04:06:10 +0000 (23:06 -0500)]
use entry to not hash twice thanks clippy
(cherry picked from commit
de9a7b9)
Eh2406 [Fri, 23 Feb 2018 23:27:53 +0000 (18:27 -0500)]
intellij rust suggested fixes
(cherry picked from commit
24836e9)
bors [Mon, 26 Feb 2018 22:28:49 +0000 (22:28 +0000)]
Auto merge of #5083 - matklad:Cargo-the-tool-1.0, r=alexcrichton
Make cargo-the-binary version the same as the Rust version
Closes #4211 which seems stuck :-)
Soooo, this is the simplest possible fix to this problem:
```
~/projects/cargo Cargo-the-tool-1.0
λ rustc --version
rustc 1.24.0 (
4d90ac38c 2018-02-12)
~/projects/cargo Cargo-the-tool-1.0
λ cargo --version
cargo 0.25.0 (
8c93e0895 2018-02-01)
```
It makes `cargo --version` to print the corresponding Rust version (with possibly cargo-specific patch number), while keeping the library version the same as today.
On the one hand, this is horrible. On the other hand, it seems to do the job? In the long term, it would be cool skip one version bump for the library, so that `0.x` corresponds to `1.x`.
cc @rust-lang/cargo
I am not sure that this is good idea, the implementation certainly feels horrible :)
bors [Mon, 26 Feb 2018 19:59:27 +0000 (19:59 +0000)]
Auto merge of #5069 - matklad:win7-y-u-no-tls, r=alexcrichton
Warn Windows 7 users about old TLS
An eyepatch for https://github.com/rust-lang/cargo/issues/5066.
@retep998 what would the best way to check for windows 7 specifically? Currently I use just `#[cfg(windows)]`, which might give false positives on 8 and 10.
Aleksey Kladov [Mon, 26 Feb 2018 19:48:31 +0000 (22:48 +0300)]
Make cargo-the-binary version the same as the Rust version
Closes #4211
bors [Mon, 26 Feb 2018 19:10:55 +0000 (19:10 +0000)]
Auto merge of #5080 - matklad:hope-this-wont-be-re-reverted, r=alexcrichton
Revert "Seperate licenses with a `/`"
This reverts commit
1ddba76a0f5f83884d20be97f49452f9dd1897f1.
OR is the more modern form :rofl:
r? @alexcrichton
Aleksey Kladov [Mon, 26 Feb 2018 18:39:25 +0000 (21:39 +0300)]
Support --exclude option for `cargo doc`
I think this should have been implemented when the feature was added for
other commands. Probably just an oversight.
Aleksey Kladov [Mon, 26 Feb 2018 18:19:26 +0000 (21:19 +0300)]
Revert "Seperate licenses with a `/`"
This reverts commit
1ddba76a0f5f83884d20be97f49452f9dd1897f1.
OR is the more modern form
Aleksey Kladov [Mon, 26 Feb 2018 17:41:22 +0000 (20:41 +0300)]
Warn about TLS for github specifically
bors [Mon, 26 Feb 2018 15:55:05 +0000 (15:55 +0000)]
Auto merge of #5079 - alexcrichton:bump, r=alexcrichton
Bump to 0.27.0
Alex Crichton [Mon, 26 Feb 2018 15:35:03 +0000 (07:35 -0800)]
Bump to 0.27.0
bors [Mon, 26 Feb 2018 15:31:55 +0000 (15:31 +0000)]
Auto merge of #5075 - ehuss:report-test-ws, r=matklad
Fix test error hint in a workspace.
This adds "-p NAME" to the hint on how to re-run a test when it fails if it is
inside a workspace.
Fixes #5053
Eric Huss [Mon, 26 Feb 2018 00:51:48 +0000 (16:51 -0800)]
Fix test error hint in a workspace.
This adds "-p NAME" to the hint on how to re-run a test when it fails if it is
inside a workspace.
Fixes #5053
bors [Sun, 25 Feb 2018 12:22:31 +0000 (12:22 +0000)]
Auto merge of #5074 - CAD97:patch-1, r=alexcrichton
Separate licenses with a `/` instead of ` OR `
It's what we tell others to do.
https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata
> ```toml
> # This is a string description of the license for this package. Currently
> # crates.io will validate the license provided against a whitelist of known
> # license identifiers from http://spdx.org/licenses/. Multiple licenses can be
> # separated with a `/`.
> license = "..."
> ```
Noted [here](https://github.com/TeXitoi/structopt/pull/71#discussion_r170423582).
This should either use `/` or a note should be added that ` OR ` is allowed as a combination operator.
bors [Sun, 25 Feb 2018 12:00:24 +0000 (12:00 +0000)]
Auto merge of #5044 - Eh2406:PeekAtRemainingCandidates, r=alexcrichton
make RemainingCandidates::next peekable.
`candidates.next` always came with a `candidates.clone().next(prev_active).is_ok` so let's just make that part of `next`. no `clone` needed.
Aleksey Kladov [Fri, 23 Feb 2018 19:02:00 +0000 (22:02 +0300)]
Warn Windows 7 users about old TLS
An eyepatch for https://github.com/rust-lang/cargo/issues/5066.
Christopher Durham [Sun, 25 Feb 2018 04:48:09 +0000 (23:48 -0500)]
Seperate licenses with a `/`
Eh2406 [Sun, 25 Feb 2018 01:23:49 +0000 (20:23 -0500)]
Merge remote-tracking branch 'origin/master' into PeekAtRemainingCandidates
# Conflicts:
# src/cargo/core/resolver/mod.rs
Eh2406 [Sun, 25 Feb 2018 00:39:00 +0000 (19:39 -0500)]
only have one place we push to backtrack_stack
Eh2406 [Sat, 24 Feb 2018 21:26:47 +0000 (16:26 -0500)]
formatting
bors [Sat, 24 Feb 2018 20:46:55 +0000 (20:46 +0000)]
Auto merge of #4978 - Eh2406:master, r=alexcrichton
Only allow one of each links attribute in resolver
This is a start on fixing the `links` part of #4902. It needs code that adds the links attribute to the index. But, I wanted to get feedback.
bors [Sat, 24 Feb 2018 19:34:52 +0000 (19:34 +0000)]
Auto merge of #5061 - ehuss:git-error-auth, r=alexcrichton
Display git errors during authentication.
Certain git errors during authentication were being converted to internal errors which meant that they are only seen if you pass `--verbose`. This may not be obvious, and many of these messages are helpful for diagnosing git errors. This change makes these errors always be displayed.
Fixes #5035.
Note: Some of the git errors are currently unhelpful. Once Cargo has updated git2-rs to include alexcrichton/git2-rs#298, these errors will improve. (@alexcrichton, I can make a PR to update Cargo for the changes in git2 if you'd like).
I'm uncertain if this is a good solution, since the error messages in some cases are a little verbose (such as showing `class=...`). Here is a sample of what some of the messages look like:
<details><summary>Error Message Examples</summary>
<p>
Example of the git message shown below the "attempted yadda yadda" message.
Scenario | Message
---------|--------
No ssh-agent, multiple usernames | `error authenticating: ; class=Ssh (23)`
| | †`error authenticating: no auth sock variable; class=Ssh (23)`
No ssh-agent, one username | `an unknown git error occurred`
| | †`error authenticating: no auth sock variable; class=Ssh (23)`
Incorrect ssh-agent setup | `error authenticating: failed connecting with agent; class=Ssh (23)`
ssh-agent no keys, one username | `an unknown git error occurred`
| | †`failed to acquire username/password from local configuration`
ssh-agent no keys, multiple usernames | `error authenticating: ; class=Ssh (23)`
| | †`no authentication available`
auth success, bad path | `fatal: '/path/to/repo/' does not appear to be a git repository; class=Ssh (23); code=Eof (-20)`
| | ‡`ERROR: Repository not found.; class=Ssh (23); code=Eof (-20)`
bad username | `an unknown git error occurred`
| | †`failed to acquire username/password from local configuration`
| | ‡`error authenticating: Username/PublicKey combination invalid; class=Ssh (23)`
† - Messages once git2-rs is updated.
‡ - Github message
</p>
</details>
bors [Fri, 23 Feb 2018 19:25:53 +0000 (19:25 +0000)]
Auto merge of #5067 - tecywiz121:noting-nothing, r=matklad
Fix a small typo (nothing -> noting)
Sam Wilson [Fri, 23 Feb 2018 15:10:23 +0000 (10:10 -0500)]
Fix a small typo (nothing -> noting)
bors [Thu, 22 Feb 2018 21:49:08 +0000 (21:49 +0000)]
Auto merge of #5064 - Eh2406:fix_test, r=matklad
fix a missing test, this was missed in the rebase of #5063
3 test did not get moved. in #5063.
Eh2406 [Thu, 22 Feb 2018 16:37:51 +0000 (11:37 -0500)]
fix a missing test, this was missed in the rebase of #5063
Eric Huss [Wed, 21 Feb 2018 16:52:24 +0000 (08:52 -0800)]
Fix appveyor failure, messages differ by platform.
Eric Huss [Wed, 21 Feb 2018 03:30:00 +0000 (19:30 -0800)]
Expose git errors during authentication.
Eh2406 [Wed, 21 Feb 2018 20:41:48 +0000 (15:41 -0500)]
Merge remote-tracking branch 'origin/master' into links
Eh2406 [Thu, 15 Feb 2018 22:36:30 +0000 (17:36 -0500)]
make RemainingCandidates::next peekable.
`candidates.next` always came with a `candidates.clone().next(prev_active).is_ok` so lets just make that part of `next`. no `clone` needed.
bors [Wed, 21 Feb 2018 19:56:27 +0000 (19:56 +0000)]
Auto merge of #5063 - Eh2406:TestssuiteV3, r=matklad
Reorganize integration tests as one crate with many modules. Issue #4867. Rebased V3
This is an automatic rebase of @rochamatcomp's work in #5022, as requested in [#5038](https://github.com/rust-lang/cargo/pull/5038#issuecomment-
365200227).
I take no credit for the changes; I just wanted faster test for my work. :-)
Eh2406 [Wed, 21 Feb 2018 19:26:29 +0000 (14:26 -0500)]
fix winapi import
André Rocha [Thu, 8 Feb 2018 16:30:58 +0000 (17:30 +0100)]
Adding cargo.rs file tests as cargo_command.rs.
André Rocha [Thu, 8 Feb 2018 00:13:17 +0000 (01:13 +0100)]
Reorganize integration tests as one crate with many modules. Issue #4867.
Toby Hughes [Tue, 20 Feb 2018 01:18:38 +0000 (17:18 -0800)]
Clean with --verbose now prints path of what is being removed.
bors [Mon, 19 Feb 2018 22:31:29 +0000 (22:31 +0000)]
Auto merge of #5058 - sfackler:patch-2, r=Mark-Simulacrum
Update default codegen-units
It's been 16 since rustc 1.24.
Steven Fackler [Mon, 19 Feb 2018 22:29:48 +0000 (14:29 -0800)]
Update default codegen-units
It's been 16 since rustc 1.24.
bors [Mon, 19 Feb 2018 21:39:17 +0000 (21:39 +0000)]
Auto merge of #5051 - cardoe:fix-doc-instructions, r=matklad
update contributing to show how to build the docs
The contributing guide referenced a script that was deleted in
1271bb4de0c0 so it wasn't possible to follow the contributing guide
successfully prior to contributing doc improvements.
bors [Mon, 19 Feb 2018 21:09:48 +0000 (21:09 +0000)]
Auto merge of #5041 - pwoolcoc:display-path-to-custom-commands-when-verbose, r=matklad
When -v is passed with --list, display path to custom commands
With this change, output of `cargo --list` changes slightly when 1 or more `-v` flags are passed:
```
± ./target/debug/cargo --list -v
Installed Commands:
add /path/to/home/.cargo/bin/cargo-add
bench
build
canoe /path/to/home/.cargo/bin/cargo-canoe
check
clean
do /path/to/home/.cargo/bin/cargo-do
doc
fetch
fmt /path/to/home/.cargo/bin/cargo-fmt
...
```
bors [Mon, 19 Feb 2018 20:21:26 +0000 (20:21 +0000)]
Auto merge of #4953 - alexcrichton:rename-via-as, r=matklad
Implement renaming dependencies in the manifest
This commit implements a new unstable feature for manifests which allows
renaming a crate when depending on it. For example you can do:
```toml
cargo-features = ["dependencies-as"]
...
[dependencies]
foo = "0.1"
bar = { version = "0.1", registry = "custom", package = "foo" }
baz = { git = "https://github.com/foo/bar", package = "foo" }
```
Here three crates will be imported but they'll be made available to the Rust
source code via the names `foo` (crates.io), `bar` (the custom registry), and
`baz` (the git dependency). The *package* name, however, will be `foo` for all
of them. In other words the git repository here would be searched for a crate
called `foo`. For example:
```rust
extern crate foo; // crates.io
extern crate bar; // registry `custom`
extern crate baz; // git repository
```
The intention here is to enable a few use cases:
* Enable depending on the same named crate from different registries
* Allow depending on multiple versions of a crate from one registry
* Removing the need for `extern crate foo as bar` syntactically in Rust source
Currently I don't think we're ready to stabilize this so it's just a nightly
feature, but I'm hoping we can continue to iterate on it!
cc #1311
bors [Mon, 19 Feb 2018 19:51:32 +0000 (19:51 +0000)]
Auto merge of #5050 - cardoe:add-dependency-info, r=matklad
doc: add explicit example with ^ and leading 0
Since the leading 0 is treated a bit special, its worth it to have an
explicit example to match the above example of the major version being >
0.
Doug Goldstein [Sun, 18 Feb 2018 04:41:32 +0000 (22:41 -0600)]
update contributing to show how to build the docs
The contributing guide referenced a script that was deleted in
1271bb4de0c0 so it wasn't possible to follow the contributing guide
successfully prior to contributing doc improvements.
Doug Goldstein [Sun, 18 Feb 2018 04:23:27 +0000 (22:23 -0600)]
doc: add explicit example with ^ and leading 0
Since the leading 0 is treated a bit special, its worth it to have an
explicit example to match the above example of the major version being >
0.
Eh2406 [Thu, 15 Feb 2018 03:28:59 +0000 (22:28 -0500)]
better error messages
Paul Woolcock [Wed, 14 Feb 2018 17:27:19 +0000 (12:27 -0500)]
When -v is passed with --list, display path to custom commands
bors [Wed, 14 Feb 2018 16:52:47 +0000 (16:52 +0000)]
Auto merge of #5037 - Eh2406:conflict_tracking, r=alexcrichton
Conflict tracking
This is an alternative implementation of #4834. This is slower but hopefully more flexible and clearer. The idea is to keep a list of `PackageId`'s that have caused us to skip a `Candidate`. Then we can use the list when we are backtracking if any items in our list have not been activated then we will have new `Candidate`'s to try so we should stop backtracking. Or to say that another way; We can continue backtracking as long as all the items in our list is still activated.
Next this new framework was used to make the error messages more focused. We only need to list the versions that conflict, as opposed to all previously activated versions.
Why is this more flexible?
1. It is not limited to conflicts within the same package. If `RemainingCandidates.next` skips something because of a links attribute, that is easy to record, just add the `PackageId` to the set `conflicting_prev_active`.
2. Arbitrary things can add conflicts to the backtracking. If we fail to activate because some dependency needs a feature that does not exist, that is easy to record, just add the `PackageId` to the set `conflicting_activations`.
3. All things that could cause use to fail will be in the error messages, as the error messages loop over the set.
4. With a simple extension, replacing the `HashSet` with a `HashMap<_, Reason>`, we can customize the error messages to show the nature of the conflict.
@alexcrichton, @aidanhs, Does the logic look right? Does this seem clearer to you?
Eh2406 [Wed, 14 Feb 2018 16:27:48 +0000 (11:27 -0500)]
Merge branch 'conflict_tracking' into links
# Conflicts:
# src/cargo/core/resolver/mod.rs
Eh2406 [Wed, 14 Feb 2018 16:22:02 +0000 (11:22 -0500)]
Don't store conflicting_activations for backtracking.
If we need it later we can always add it back in.
bors [Wed, 14 Feb 2018 15:47:45 +0000 (15:47 +0000)]
Auto merge of #5040 - daboross:patch-1, r=alexcrichton
Remove cargo-only downloads from installation docs
This also copies extra instructions for installing rust from https://doc.rust-lang.org/book/first-edition/getting-started.html#installing-rust-1.
I wasn't able to test the changes locally, but they're fairly minimal, so I trust they will render alright.
Fixes #5027.
David Ross [Wed, 14 Feb 2018 06:17:15 +0000 (22:17 -0800)]
Remove cargo-only downloads from installation docs
This also copies extra instructions for installing rust from https://doc.rust-lang.org/book/first-edition/getting-started.html#installing-rust-1.
Fixes https://github.com/rust-lang/cargo/issues/5027.
bors [Wed, 14 Feb 2018 06:13:12 +0000 (06:13 +0000)]
Auto merge of #5039 - lawliet89:docopt-bounds, r=alexcrichton
Fix DocOpt deserialization type bounds
This is wrt https://github.com/docopt/docopt.rs/pull/222
DocOpt does not support deserializing borrowed types.
This change was reverted in
https://github.com/docopt/docopt.rs/commit/
7292a374e69afb192bb7aaa00f9d9f4afebc200d
because it broke crates like Cargo etc.
Eh2406 [Wed, 14 Feb 2018 04:11:48 +0000 (23:11 -0500)]
Add an explanation of links related conflicts to error messages
Yong Wen Chua [Wed, 14 Feb 2018 01:58:20 +0000 (09:58 +0800)]
Fix DocOpt deserialization type bounds
This is wrt https://github.com/docopt/docopt.rs/pull/222
DocOpt does not support deserializing borrowed types.
This change was reverted in
https://github.com/docopt/docopt.rs/commit/
7292a374e69afb192bb7aaa00f9d9f4afebc200d
because it broke crates like Cargo etc.
Eh2406 [Tue, 13 Feb 2018 22:56:04 +0000 (17:56 -0500)]
Fix a==b and links, and update backtracking
Eh2406 [Tue, 13 Feb 2018 22:16:06 +0000 (17:16 -0500)]
Merge branch 'conflict_tracking' into links
# Conflicts:
# src/cargo/core/resolver/mod.rs
# tests/resolve.rs
bors [Tue, 13 Feb 2018 11:03:57 +0000 (11:03 +0000)]
Auto merge of #5029 - matklad:new-defaults-to-bin, r=withoutboats
New defaults to bin
So this switches `cargo new` default from `--lib` to `--bin`, as discussed on IRC.
The first two commits are just refactorings, and the last one actually flips the switch. Surprisingly enough, no tests need to be modified it seems!
r? @withoutboats
Eh2406 [Tue, 13 Feb 2018 01:54:52 +0000 (20:54 -0500)]
Use the conflict tracking in the error messages to only show the versions that are in conflict
Alex Crichton [Wed, 17 Jan 2018 19:33:25 +0000 (11:33 -0800)]
Implement renaming dependencies in the manifest
This commit implements a new unstable feature for manifests which allows
renaming a crate when depending on it. For example you can do:
```toml
cargo-features = ["dependencies-as"]
...
[dependencies]
foo = "0.1"
bar = { version = "0.1", registry = "custom", package = "foo" }
baz = { git = "https://github.com/foo/bar", package = "foo" }
```
Here three crates will be imported but they'll be made available to the Rust
source code via the names `foo` (crates.io), `bar` (the custom registry), and
`baz` (the git dependency). The *package* name, however, will be `foo` for all
of them. In other words the git repository here would be searched for a crate
called `foo`. For example:
```rust
extern crate foo; // crates.io
extern crate bar; // registry `custom`
extern crate baz; // git repository
```
The intention here is to enable a few use cases:
* Enable depending on the same named crate from different registries
* Allow depending on multiple versions of a crate from one registry
* Removing the need for `extern crate foo as bar` syntactically in Rust source
Currently I don't think we're ready to stabilize this so it's just a nightly
feature, but I'm hoping we can continue to iterate on it!
bors [Mon, 12 Feb 2018 22:32:11 +0000 (22:32 +0000)]
Auto merge of #5033 - alexcrichton:update-deps, r=matklad
Update dependencies
Just a few major updates here and there
Alex Crichton [Mon, 12 Feb 2018 20:42:31 +0000 (12:42 -0800)]
Update dependencies
Just a few major updates here and there
bors [Mon, 12 Feb 2018 22:02:00 +0000 (22:02 +0000)]
Auto merge of #5032 - matklad:lazycell, r=alexcrichton
Switch to lazycell from crate.io
This switches from a home-grown implementation of `lazycell` to the one from crates.io.
There are no particularly large improvements here, but our own lazy cell is definitely unsafe in theory, because of potential reentrancy in `get_or_try_init`, and the one from crates.io does not have at least this hole :-)
Note that `rustc` already has `lazycell` in its Cargo.lock (because of clippy I guess?), albeit with a lower version, 0.5.
bors [Mon, 12 Feb 2018 20:53:27 +0000 (20:53 +0000)]
Auto merge of #5031 - matthiaskrgr:readme_docs, r=alexcrichton
readme: add link to the cargo documentation on docs.rs
[Rendered](https://github.com/matthiaskrgr/cargo/blob/readme_docs/README.md)
Background: I was searching for cargo source code doc a while back, found the cargo book and crates.io doc relatively quickly but not the actual source code doc which I only found (after way to much time had passed) when I looked up the cargo crate on crates.io and found the "Documentation" link :/
Hope this improves the situation a bit in the future.
Matthias Krüger [Mon, 12 Feb 2018 18:27:45 +0000 (19:27 +0100)]
readme: add link to the cargo documentation on docs.rs
Aleksey Kladov [Mon, 12 Feb 2018 17:00:59 +0000 (20:00 +0300)]
Switch `cargo new` default to `--bin`
Aleksey Kladov [Mon, 12 Feb 2018 18:33:31 +0000 (21:33 +0300)]
Switch to lazycell from crate.io
bors [Mon, 12 Feb 2018 17:53:00 +0000 (17:53 +0000)]
Auto merge of #5030 - alexcrichton:better-poll, r=matklad
Don't spin on empty fds in `read2` on Unix
This commit fixes what I think is some pathological behavior in Cargo where if
one stdio stream is closed before another then Cargo can accidentally spin in a
tight loop and not block appropriately. Previously, for example, if stderr
closed before stdout then Cargo would spin in a `poll` loop continuously getting
notified that stderr is closed.
The behavior is now changed so after a file descriptor is done we stop passing
it to `poll` and instead only pass the one remaining readable file descriptor.
Alex Crichton [Mon, 12 Feb 2018 17:27:11 +0000 (09:27 -0800)]
Don't spin on empty fds in `read2` on Unix
This commit fixes what I think is some pathological behavior in Cargo where if
one stdio stream is closed before another then Cargo can accidentally spin in a
tight loop and not block appropriately. Previously, for example, if stderr
closed before stdout then Cargo would spin in a `poll` loop continuously getting
notified that stderr is closed.
The behavior is now changed so after a file descriptor is done we stop passing
it to `poll` and instead only pass the one remaining readable file descriptor.
Aleksey Kladov [Mon, 12 Feb 2018 16:57:31 +0000 (19:57 +0300)]
Refactor `NewOptions` to make it slightly more clear
Aleksey Kladov [Mon, 12 Feb 2018 16:31:48 +0000 (19:31 +0300)]
Cleanup
Eh2406 [Sun, 11 Feb 2018 21:52:58 +0000 (16:52 -0500)]
More directly track conflicts in backtracking, hopefully this will be easier to extend.
bors [Fri, 9 Feb 2018 18:50:24 +0000 (18:50 +0000)]
Auto merge of #5025 - Eh2406:error_mesges, r=alexcrichton
better resolver error messages
This is a start on beter resolver error messages. This is mostly trying to copy the `links` messages. In the process I found that we wor not testing the common case of having found candidates and still not resolving.
Any advice?
Eh2406 [Wed, 7 Feb 2018 16:51:40 +0000 (11:51 -0500)]
better error messages
bors [Fri, 9 Feb 2018 00:22:00 +0000 (00:22 +0000)]
Auto merge of #5024 - debris:helpful_message, r=alexcrichton
Add helpful message when running cargo doc --open
Add helpful message when running cargo doc --open in the root of the workspace.
closes #4962
old output:
```
Documenting foo v0.1.0 (file:///Users/marek/projects/ethcore/tmp/dupa/foo)
Documenting bar v0.1.0 (file:///Users/marek/projects/ethcore/tmp/dupa/bar)
Finished dev [unoptimized + debuginfo] target(s) in 0.78 secs
error: Passing multiple packages and `open` is not supported
```
new output:
```
Documenting foo v0.1.0 (file:///Users/marek/projects/ethcore/tmp/dupa/foo)
Documenting bar v0.1.0 (file:///Users/marek/projects/ethcore/tmp/dupa/bar)
Finished dev [unoptimized + debuginfo] target(s) in 0.81 secs
error: Passing multiple packages and `open` is not supported.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
foo
bar
```
debris [Thu, 8 Feb 2018 21:50:35 +0000 (22:50 +0100)]
Add helpful message when running cargo doc --open in the root of the workspace, fixes #4962
Eh2406 [Wed, 7 Feb 2018 22:50:03 +0000 (17:50 -0500)]
generalize the path_to_top from the links errors
Eh2406 [Wed, 7 Feb 2018 22:45:02 +0000 (17:45 -0500)]
test for the most common cargo resolver error
bors [Wed, 7 Feb 2018 23:11:35 +0000 (23:11 +0000)]
Auto merge of #5020 - stefanbirkner:linkfix, r=alexcrichton
Fix link to documentation
Stefan Birkner [Sat, 3 Feb 2018 21:48:24 +0000 (22:48 +0100)]
Fix link to documentation
bors [Wed, 7 Feb 2018 02:06:13 +0000 (02:06 +0000)]
Auto merge of #5018 - brotzeit:clippy, r=alexcrichton
apply clippy suggestions
I want to try if this actually works =)
There are many other clippy suggestions. I wonder if I can take them for granted or if some of them would be refused.
For example:
```
warning: Constants have by default a `'static` lifetime
--> src/cargo/lib.rs:53:23
|
53 | pub const CARGO_ENV: &'static str = "CARGO";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= note: #[warn(const_static_lifetime)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.185/index.html#const_static_lifetime
```
brotzeit [Tue, 6 Feb 2018 21:49:50 +0000 (22:49 +0100)]
apply clippy suggestions
bors [Tue, 6 Feb 2018 18:27:28 +0000 (18:27 +0000)]
Auto merge of #5011 - Manishearth:stealing-chickens-off-the-internet, r=alexcrichton
Implement RFC 2052: Epoches
Todo:
- Make epoches affect the fingerprint
- Tests
cc https://github.com/rust-lang/rust/issues/44581
Rust PR: https://github.com/rust-lang/rust/pull/48014
r? @acrichto
Manish Goregaokar [Tue, 6 Feb 2018 17:33:30 +0000 (09:33 -0800)]
epoch -> rust
bors [Tue, 6 Feb 2018 17:33:20 +0000 (17:33 +0000)]
Auto merge of #5017 - matthiaskrgr:manifest_cgu_lto, r=alexcrichton
manifest reference: correct statement: codegen-units=x is not ignored if lto=true.
Also fix typo along the way.
bors [Tue, 6 Feb 2018 17:05:37 +0000 (17:05 +0000)]
Auto merge of #4834 - aidanhs:aphs-better-backtrack, r=alexcrichton
Make resolution backtracking smarter
There's no need to try every candidate for every dependency when backtracking - instead, only try candidates if they *could* change the eventual failure that caused backtracking in the first place, i.e.
1. if we've backtracked past the parent of the dep that failed
2. the number of activations for the dep has changed (activations are only ever added during resolution I believe)
The two new tests before:
```
$ /usr/bin/time cargo test --test resolve -- --test-threads 1 --nocapture resolving_with_constrained_sibling_
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running target/debug/deps/resolve-
19b2a13e5a19eed8
38.45user 2.16system 0:42.00elapsed 96%CPU (0avgtext+0avgdata 47672maxresident)k
0inputs+1664096outputs (0major+10921minor)pagefaults 0swaps
```
After:
```
$ /usr/bin/time cargo test --test resolve -- --test-threads 1 --nocapture resolving_with_constrained_sibling_
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running target/debug/deps/resolve-
19b2a13e5a19eed8
[...]
0.36user 0.01system 0:00.49elapsed 76%CPU (0avgtext+0avgdata 47464maxresident)k
0inputs+32outputs (0major+11602minor)pagefaults 0swaps
```
You observe the issue yourself with the following (it should fail, but hangs for a while instead - I didn't bother timing it and waiting for it to finish. With this PR it terminates almost instantly):
```
$ cargo new --bin x
Created binary (application) `x` project
$ /bin/echo -e 'serde = "=1.0.9"\nrust-s3 = "0.8"' >> x/Cargo.toml
$ cd x && cargo build
Updating registry `https://github.com/rust-lang/crates.io-index`
Resolving dependency graph...
```
Matthias Krüger [Tue, 6 Feb 2018 12:27:56 +0000 (13:27 +0100)]
manifest reference: correct statement: codegen-units=x is not ignored if lto=true.
Also fix typo along the way.
bors [Tue, 6 Feb 2018 06:08:23 +0000 (06:08 +0000)]
Auto merge of #5013 - withoutboats:no-rust-rename, r=matklad
Do not rename packages on `cargo new`.
Prior to this commit, packages beginning with `rust` or ending with
`rs` were renamed automatically when created, unless they were
binaries. The ostensible purpose of this code was to avoid people
uploading "redundant" names to crates.io, which is a repository of
Rust packages.
This behavior was overly opinionated. It is not cargo's
responsibility to discourage users from naming their packages any
particular way. Without a sound technical reasons why packages
cannot be named a certain way, cargo should not be intervening in
users' package naming decisions.
It also did this by automatically renaming the package for the
user, as opposed to erroring. Though it printed a message about
the behavior, it did not give the user a choice to abort the
process; to overrule cargo they had to delete the new project
and start again using the `--name` argument.
`cargo new` is many users' first entrypoint to the Rust ecosystem.
This behavior teaches a user that Rust is opinionated and magical,
both of which are divisive attributes for a tool, and attributes
which do not generally describe Rust's attitude toward things like
names and formatting.
If crates.io wishes to enforce that users not upload packages with
names like this, it should be enforced by crates.io at publish
time.
Manish Goregaokar [Mon, 5 Feb 2018 21:42:42 +0000 (16:42 -0500)]
Add tests for epoch