cargo.git
7 years agoSeperate licenses with a `/`
Christopher Durham [Sun, 25 Feb 2018 04:48:09 +0000 (23:48 -0500)]
Seperate licenses with a `/`

7 years agoAuto merge of #4978 - Eh2406:master, r=alexcrichton
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.

7 years agoAuto merge of #5061 - ehuss:git-error-auth, r=alexcrichton
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>

7 years agoAuto merge of #5067 - tecywiz121:noting-nothing, r=matklad
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)

7 years agoFix a small typo (nothing -> noting)
Sam Wilson [Fri, 23 Feb 2018 15:10:23 +0000 (10:10 -0500)]
Fix a small typo (nothing -> noting)

7 years agoAuto merge of #5064 - Eh2406:fix_test, r=matklad
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.

7 years agofix a missing test, this was missed in the rebase of #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

7 years agoFix appveyor failure, messages differ by platform.
Eric Huss [Wed, 21 Feb 2018 16:52:24 +0000 (08:52 -0800)]
Fix appveyor failure, messages differ by platform.

7 years agoExpose git errors during authentication.
Eric Huss [Wed, 21 Feb 2018 03:30:00 +0000 (19:30 -0800)]
Expose git errors during authentication.

7 years agoMerge remote-tracking branch 'origin/master' into links
Eh2406 [Wed, 21 Feb 2018 20:41:48 +0000 (15:41 -0500)]
Merge remote-tracking branch 'origin/master' into links

7 years agoAuto merge of #5063 - Eh2406:TestssuiteV3, r=matklad
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. :-)

7 years agofix winapi import
Eh2406 [Wed, 21 Feb 2018 19:26:29 +0000 (14:26 -0500)]
fix winapi import

7 years agoAdding cargo.rs file tests as cargo_command.rs.
André Rocha [Thu, 8 Feb 2018 16:30:58 +0000 (17:30 +0100)]
Adding cargo.rs file tests as cargo_command.rs.

7 years agoReorganize integration tests as one crate with many modules. Issue #4867.
André Rocha [Thu, 8 Feb 2018 00:13:17 +0000 (01:13 +0100)]
Reorganize integration tests as one crate with many modules. Issue #4867.

7 years agoAuto merge of #5058 - sfackler:patch-2, r=Mark-Simulacrum
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.

7 years agoUpdate default codegen-units
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.

7 years agoAuto merge of #5051 - cardoe:fix-doc-instructions, r=matklad
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.

7 years agoAuto merge of #5041 - pwoolcoc:display-path-to-custom-commands-when-verbose, r=matklad
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
    ...
```

7 years agoAuto merge of #4953 - alexcrichton:rename-via-as, r=matklad
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

7 years agoAuto merge of #5050 - cardoe:add-dependency-info, r=matklad
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.

7 years agoupdate contributing to show how to build the docs
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.

7 years agodoc: add explicit example with ^ and leading 0
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.

7 years agobetter error messages
Eh2406 [Thu, 15 Feb 2018 03:28:59 +0000 (22:28 -0500)]
better error messages

7 years agoWhen -v is passed with --list, display path to custom commands
Paul Woolcock [Wed, 14 Feb 2018 17:27:19 +0000 (12:27 -0500)]
When -v is passed with --list, display path to custom commands

7 years agoAuto merge of #5037 - Eh2406:conflict_tracking, r=alexcrichton
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?

7 years agoMerge branch 'conflict_tracking' into links
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

7 years agoDon't store conflicting_activations for backtracking.
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.

7 years agoAuto merge of #5040 - daboross:patch-1, r=alexcrichton
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.

7 years agoRemove cargo-only downloads from installation docs
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.

7 years agoAuto merge of #5039 - lawliet89:docopt-bounds, r=alexcrichton
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.

7 years agoAdd an explanation of links related conflicts to error messages
Eh2406 [Wed, 14 Feb 2018 04:11:48 +0000 (23:11 -0500)]
Add an explanation of links related conflicts to error messages

7 years agoFix DocOpt deserialization type bounds
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.

7 years agoFix a==b and links, and update backtracking
Eh2406 [Tue, 13 Feb 2018 22:56:04 +0000 (17:56 -0500)]
Fix a==b and links, and update backtracking

7 years agoMerge branch 'conflict_tracking' into links
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

7 years agoAuto merge of #5029 - matklad:new-defaults-to-bin, r=withoutboats
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

7 years agoUse the conflict tracking in the error messages to only show the versions that are...
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

7 years agoImplement renaming dependencies in the manifest
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!

7 years agoAuto merge of #5033 - alexcrichton:update-deps, r=matklad
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

7 years agoUpdate dependencies
Alex Crichton [Mon, 12 Feb 2018 20:42:31 +0000 (12:42 -0800)]
Update dependencies

Just a few major updates here and there

7 years agoAuto merge of #5032 - matklad:lazycell, r=alexcrichton
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.

7 years agoAuto merge of #5031 - matthiaskrgr:readme_docs, r=alexcrichton
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.

7 years agoreadme: add link to the cargo documentation on docs.rs
Matthias Krüger [Mon, 12 Feb 2018 18:27:45 +0000 (19:27 +0100)]
readme: add link to the cargo documentation on docs.rs

7 years agoSwitch `cargo new` default to `--bin`
Aleksey Kladov [Mon, 12 Feb 2018 17:00:59 +0000 (20:00 +0300)]
Switch `cargo new` default to `--bin`

7 years agoSwitch to lazycell from crate.io
Aleksey Kladov [Mon, 12 Feb 2018 18:33:31 +0000 (21:33 +0300)]
Switch to lazycell from crate.io

7 years agoAuto merge of #5030 - alexcrichton:better-poll, r=matklad
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.

7 years agoDon't spin on empty fds in `read2` on Unix
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.

7 years agoRefactor `NewOptions` to make it slightly more clear
Aleksey Kladov [Mon, 12 Feb 2018 16:57:31 +0000 (19:57 +0300)]
Refactor `NewOptions` to make it slightly more clear

7 years agoCleanup
Aleksey Kladov [Mon, 12 Feb 2018 16:31:48 +0000 (19:31 +0300)]
Cleanup

7 years agoMore directly track conflicts in backtracking, hopefully this will be easier to extend.
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.

7 years agoAuto merge of #5025 - Eh2406:error_mesges, r=alexcrichton
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?

7 years agobetter error messages
Eh2406 [Wed, 7 Feb 2018 16:51:40 +0000 (11:51 -0500)]
better error messages

7 years agoAuto merge of #5024 - debris:helpful_message, r=alexcrichton
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
```

7 years agoAdd helpful message when running cargo doc --open in the root of the workspace, fixes...
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

7 years agogeneralize the path_to_top from the links errors
Eh2406 [Wed, 7 Feb 2018 22:50:03 +0000 (17:50 -0500)]
generalize the path_to_top from the links errors

7 years agotest for the most common cargo resolver error
Eh2406 [Wed, 7 Feb 2018 22:45:02 +0000 (17:45 -0500)]
test for the most common cargo resolver error

7 years agoAuto merge of #5020 - stefanbirkner:linkfix, r=alexcrichton
bors [Wed, 7 Feb 2018 23:11:35 +0000 (23:11 +0000)]
Auto merge of #5020 - stefanbirkner:linkfix, r=alexcrichton

Fix link to documentation

7 years agoFix link to documentation
Stefan Birkner [Sat, 3 Feb 2018 21:48:24 +0000 (22:48 +0100)]
Fix link to documentation

7 years agoAuto merge of #5018 - brotzeit:clippy, r=alexcrichton
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
```

7 years agoapply clippy suggestions
brotzeit [Tue, 6 Feb 2018 21:49:50 +0000 (22:49 +0100)]
apply clippy suggestions

7 years agoAuto merge of #5011 - Manishearth:stealing-chickens-off-the-internet, r=alexcrichton
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

7 years agoepoch -> rust
Manish Goregaokar [Tue, 6 Feb 2018 17:33:30 +0000 (09:33 -0800)]
epoch -> rust

7 years agoAuto merge of #5017 - matthiaskrgr:manifest_cgu_lto, r=alexcrichton
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.

7 years agoAuto merge of #4834 - aidanhs:aphs-better-backtrack, r=alexcrichton
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...
```

7 years agomanifest reference: correct statement: codegen-units=x is not ignored if lto=true.
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.

7 years agoAuto merge of #5013 - withoutboats:no-rust-rename, r=matklad
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.

7 years agoAdd tests for epoch
Manish Goregaokar [Mon, 5 Feb 2018 21:42:42 +0000 (16:42 -0500)]
Add tests for epoch

7 years agoInclude the epoch in the fingerprint
Manish Goregaokar [Mon, 5 Feb 2018 21:21:40 +0000 (16:21 -0500)]
Include the epoch in the fingerprint

7 years agoPass -Zepoch flag when epoch feature exists
Manish Goregaokar [Mon, 5 Feb 2018 16:29:31 +0000 (11:29 -0500)]
Pass -Zepoch flag when epoch feature exists

7 years agoFeature gate epoches
Manish Goregaokar [Mon, 5 Feb 2018 15:28:17 +0000 (10:28 -0500)]
Feature gate epoches

7 years agoAdd epoch key to [package]
Manish Goregaokar [Mon, 5 Feb 2018 15:23:07 +0000 (10:23 -0500)]
Add epoch key to [package]

7 years agoAdd reference to clarifying comment
Aidan Hobson Sayers [Tue, 6 Feb 2018 02:15:17 +0000 (02:15 +0000)]
Add reference to clarifying comment

7 years agoRemove tests related to stripping names.
boats [Mon, 5 Feb 2018 23:49:49 +0000 (15:49 -0800)]
Remove tests related to stripping names.

7 years agoDo not rename packages on `cargo new`.
boats [Mon, 5 Feb 2018 23:04:17 +0000 (15:04 -0800)]
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.

7 years agoAuto merge of #4976 - mbrubeck:doc-check, r=alexcrichton
bors [Mon, 5 Feb 2018 21:22:16 +0000 (21:22 +0000)]
Auto merge of #4976 - mbrubeck:doc-check, r=alexcrichton

cargo doc: Generate rmeta files for dependencies instead of compiling rlibs

This makes `cargo doc` require only metadata (`.rmeta` files) instead of compiled libraries (`.rlib` files) for dependencies.  This makes `cargo doc` faster in cases where rlibs are not already built and/or metadata is already available.

Unfortunately, this is not a win for every workflow.  In the case where the user has already compiled but has not generated metadata, it makes `cargo doc` do extra work.  This is probably a common case, though tools like RLS and `cargo check` mean that many developers *will* have up-to-date metadata available.

It would become an unequivocal win if `cargo build` and `cargo check` re-used shared metadata (#3501). For now, starting from a clean working directory, the following sequences of commands will become:

* `cargo doc`: faster
* `cargo build; cargo doc`: slower
* `cargo check; cargo doc`: faster
* `cargo build --release; cargo doc`: faster
* `cargo check; cargo build; cargo doc`: no change

7 years agoClean up lib_or_check_profile code
Matt Brubeck [Mon, 5 Feb 2018 18:31:22 +0000 (10:31 -0800)]
Clean up lib_or_check_profile code

7 years agocargo doc: Generate metadata instead of compiling dependencies
Matt Brubeck [Wed, 24 Jan 2018 20:37:19 +0000 (12:37 -0800)]
cargo doc: Generate metadata instead of compiling dependencies

7 years agoAuto merge of #5008 - matthiaskrgr:codespell, r=alexcrichton
bors [Mon, 5 Feb 2018 05:11:39 +0000 (05:11 +0000)]
Auto merge of #5008 - matthiaskrgr:codespell, r=alexcrichton

fix a bunch of typos found by codespell

https://github.com/lucasdemarchi/codespell/

7 years agofix a bunch of typos found by codespell
Matthias Krüger [Sun, 4 Feb 2018 21:30:22 +0000 (22:30 +0100)]
fix a bunch of typos found by codespell

7 years agoAuto merge of #5004 - BurNiinTRee:pijul-config-key, r=matklad
bors [Sun, 4 Feb 2018 13:21:01 +0000 (13:21 +0000)]
Auto merge of #5004 - BurNiinTRee:pijul-config-key, r=matklad

Added "pijul" as a config key for cargo-new.vcs in .cargo/config

Currently Pijul can only be set as a version control from the command-line but not from the cargo-new.vcs key in .cargo/config

7 years agoAdded "pijul" as a config key for cargo-new.vcs in .cargo/config
Lars Mühmel [Sun, 4 Feb 2018 13:06:03 +0000 (14:06 +0100)]
Added "pijul" as a config key for cargo-new.vcs in .cargo/config

7 years agoElaborate on test configuration, add a new test
Aidan Hobson Sayers [Sat, 3 Feb 2018 21:49:42 +0000 (21:49 +0000)]
Elaborate on test configuration, add a new test

7 years agoClearer desired behaviour with an assertion
Aidan Hobson Sayers [Sat, 3 Feb 2018 21:24:22 +0000 (21:24 +0000)]
Clearer desired behaviour with an assertion

7 years agoMake resolution backtracking smarter
Aidan Hobson Sayers [Mon, 18 Dec 2017 17:06:45 +0000 (17:06 +0000)]
Make resolution backtracking smarter

There's no need to try every candidate for every dependency - instead,
only try alternative candidates if they *could* change the eventual
failure that caused backtracking in the first place.

7 years agoAuto merge of #4995 - alexcrichton:relative-env, r=matklad
bors [Thu, 1 Feb 2018 19:12:19 +0000 (19:12 +0000)]
Auto merge of #4995 - alexcrichton:relative-env, r=matklad

Fix `RUSTC=./relative-path` when building

This commit adjusts the compiler location logic to resolve `./relative-path`
before invoking rustc to ensure it's no longer cwd-relative. This is how many
other variables like `CARGO_HOME` work, so it's applying similar logic.

7 years agoFix `RUSTC=./relative-path` when building
Alex Crichton [Wed, 31 Jan 2018 18:30:01 +0000 (10:30 -0800)]
Fix `RUSTC=./relative-path` when building

This commit adjusts the compiler location logic to resolve `./relative-path`
before invoking rustc to ensure it's no longer cwd-relative. This is how many
other variables like `CARGO_HOME` work, so it's applying similar logic.

7 years agoAuto merge of #4990 - Eh2406:Zno-index-update, r=alexcrichton
bors [Wed, 31 Jan 2018 22:14:53 +0000 (22:14 +0000)]
Auto merge of #4990 - Eh2406:Zno-index-update, r=alexcrichton

add a -Z no-index-update for crater and benchmarking

This is a fix for #3479

7 years agoadd a test
Eh2406 [Wed, 31 Jan 2018 21:12:19 +0000 (16:12 -0500)]
add a test

7 years agoAuto merge of #4996 - alexcrichton:document-lto, r=matklad
bors [Wed, 31 Jan 2018 20:33:03 +0000 (20:33 +0000)]
Auto merge of #4996 - alexcrichton:document-lto, r=matklad

Document string values for LTO

7 years agoDocument string values for LTO
Alex Crichton [Wed, 31 Jan 2018 19:45:26 +0000 (11:45 -0800)]
Document string values for LTO

7 years agoAuto merge of #4984 - alexcrichton:configure-lto, r=matklad
bors [Wed, 31 Jan 2018 18:55:53 +0000 (18:55 +0000)]
Auto merge of #4984 - alexcrichton:configure-lto, r=matklad

Allow configuration of LTO in [profile]

This should help give access to ThinLTO when desired!

7 years agoAuto merge of #4991 - bennofs:master, r=matklad
bors [Wed, 31 Jan 2018 09:20:32 +0000 (09:20 +0000)]
Auto merge of #4991 - bennofs:master, r=matklad

Require at least version 0.1.9 of jobserver crate

There are some important fixes in jobserver >=0.1.8. With earlier
versions, it's possible for cargo to panic with a "failed to acquire
jobserver token" error, which can be very hard to track down.

Requiring the latest version of jobserver makes sure that no such error
can make it into downstream distributions.

7 years agoRequire at least version 0.1.9 of jobserver crate
Benno Fünfstück [Wed, 31 Jan 2018 09:16:01 +0000 (10:16 +0100)]
Require at least version 0.1.9 of jobserver crate

There are some important fixes in jobserver >=0.1.8. With earlier
versions, it's possible for cargo to panic with a "failed to acquire
jobserver token" error, which can be very hard to track down.

Requiring the latest version of jobserver makes sure that no such error
can make it into downstream distributions.

7 years agoadd a -Z no-index-update for crater and benchmarking
Eh2406 [Wed, 31 Jan 2018 04:09:13 +0000 (23:09 -0500)]
add a -Z no-index-update for crater and benchmarking

7 years agoAdd a test for issues/4902
Eh2406 [Tue, 30 Jan 2018 19:46:58 +0000 (14:46 -0500)]
Add a test for issues/4902

7 years agoSend the links attribute to the registry
Eh2406 [Sun, 28 Jan 2018 04:01:57 +0000 (23:01 -0500)]
Send the links attribute to the registry

7 years agoensure we are not using links more then once
Eh2406 [Sat, 27 Jan 2018 20:44:28 +0000 (15:44 -0500)]
ensure we are not using links more then once

7 years agoAllow configuration of LTO in [profile]
Alex Crichton [Fri, 26 Jan 2018 22:26:13 +0000 (14:26 -0800)]
Allow configuration of LTO in [profile]

This should help give access to ThinLTO when desired!

7 years agoKeep the list of links as part of Context
Eh2406 [Fri, 26 Jan 2018 20:19:49 +0000 (15:19 -0500)]
Keep the list of links as part of Context

7 years agoAuto merge of #4980 - Gilnaa:master, r=matklad
bors [Fri, 26 Jan 2018 16:45:42 +0000 (16:45 +0000)]
Auto merge of #4980 - Gilnaa:master, r=matklad

Fixed relaxed libtest tests

This fixes tests regarding the upcoming behaviour of libtest's benchmarks.
The previous PR was wrongly tested, this one fixes the problems.

7 years agoFixed relaxed libtest tests
Gilad Naaman [Fri, 26 Jan 2018 16:23:44 +0000 (18:23 +0200)]
Fixed relaxed libtest tests