cargo.git
7 years agoRemove redundant recursion_limit
Tatsuyuki Ishi [Sat, 10 Mar 2018 02:06:06 +0000 (11:06 +0900)]
Remove redundant recursion_limit

Now that we have migrate from error-chain to failure, we no longer need to extend it.

7 years agoAuto merge of #5126 - gilescope:cycle-error-message, r=alexcrichton
bors [Fri, 9 Mar 2018 19:40:03 +0000 (19:40 +0000)]
Auto merge of #5126 - gilescope:cycle-error-message, r=alexcrichton

Error message for package "depends on itself" lists the packages in the cycle.

I got a cycle while trying to build someone else's code and cargo's error message didn't point me in the right direction, just mentioned there was a cycle. I thought we could be a bit more helpful.

Don't know what you think of {:#?} as the display but it seemed minimal code so I thought I'd start with that. I could compress the output to one package per line if preferred.

7 years agoClippy complains about unused in derived code.
Giles Cope [Fri, 9 Mar 2018 18:32:28 +0000 (18:32 +0000)]
Clippy complains about unused in derived code.

7 years agoAuto merge of #5157 - Eh2406:more_interning, r=alexcrichton
bors [Fri, 9 Mar 2018 17:56:35 +0000 (17:56 +0000)]
Auto merge of #5157 - Eh2406:more_interning, r=alexcrichton

More interning

This is a forward approach to interning. Specifically `Dependency` and `PackageId` store their names as `InternedString`s and leave that value interned as long as possible. The alternative is to make a new `interned_name` function. The advantage of this approach is that a number of places in the code are doing `deb.name() == pid.name()` and are now using the fast pointer compare instead of the string compare, without the code needing to change. The disadvantage is that lots of places need to call `deref` with `&*` to convert to an `&str` and sum need to use `.to_inner()` to get a `&'static str`.

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 10000000 ticks in ~48 sec
After we got to 10000000 ticks in ~44 sec

7 years agodelay calls to `to_inner`
Eh2406 [Fri, 9 Mar 2018 16:47:10 +0000 (11:47 -0500)]
delay calls to `to_inner`

7 years agoDependency.name to InternedString
Eh2406 [Fri, 9 Mar 2018 15:07:59 +0000 (10:07 -0500)]
Dependency.name to InternedString

7 years agoPackageId.name to InternedString
Eh2406 [Thu, 8 Mar 2018 21:24:27 +0000 (16:24 -0500)]
PackageId.name to InternedString

7 years agoSwitch to exhaustive matches in tests.
Giles Cope [Thu, 8 Mar 2018 18:37:30 +0000 (18:37 +0000)]
Switch to exhaustive matches in tests.

7 years agoAuto merge of #5150 - Eh2406:more_interning, r=alexcrichton
bors [Thu, 8 Mar 2018 15:21:26 +0000 (15:21 +0000)]
Auto merge of #5150 - Eh2406:more_interning, r=alexcrichton

More interning

This is a small part of the unsuccessful last commit of #5121, this part removes `InternedString::new` from the innerest of loops.

This is mostly a resubmission of #5147, that I accidentally deleted while bors was testing. This one has new commits, so github will take the resubition.

7 years agointern links attribute
Eh2406 [Thu, 8 Mar 2018 04:20:17 +0000 (23:20 -0500)]
intern links attribute

7 years agoAuto merge of #5147 - Eh2406:restucture, r=alexcrichton
bors [Thu, 8 Mar 2018 04:02:02 +0000 (04:02 +0000)]
Auto merge of #5147 - Eh2406:restucture, r=alexcrichton

restructure `Activations` for better clone

This builds on the work in #5121 When we last met we had:
5000000 ticks in ~48 sec, 0r 104k ticks/sec
This small change brings us to:
5000000 ticks in ~21 sec, 0r 238k ticks/sec
Edit: sorry for the large diff only the last commit is new. The rest are from #5121

7 years agorestructure `Activations` for better clone
Eh2406 [Wed, 7 Mar 2018 17:57:48 +0000 (12:57 -0500)]
restructure `Activations` for better clone

7 years agoAs pointed out by Jacob, we can display the ordered cycle in the error message.
Giles Cope [Wed, 7 Mar 2018 22:56:47 +0000 (22:56 +0000)]
As pointed out by Jacob, we can display the ordered cycle in the error message.

7 years agoAuto merge of #5121 - Eh2406:string_interning, r=alexcrichton
bors [Wed, 7 Mar 2018 22:54:54 +0000 (22:54 +0000)]
Auto merge of #5121 - Eh2406:string_interning, r=alexcrichton

String interning

This builds on the work from #5118. This interns the strings in the part of resolver that gets cloned a lot.

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 1700000 ticks in ~(63 to 67) sec from #5118
After we got to 1700000 ticks in ~(42 to 45) sec

The interning code itself would be much better with a `leak` function that converts a `String` to a `&'static str`. Something like:
```rust
pub fn leek(s: String) -> &'static str {
    let ptr = s.as_ptr();
    let len = s.len();
    mem::forget(s);
    unsafe {
        let slice = slice::from_raw_parts(ptr, len);
        str::from_utf8(slice).unwrap()
    }
}
```
but "there is no unsafe in Cargo", and I am not the best at unsafe. So I just `to_string` and lived with the extra copy. Is there a better way to hand out references?

I assumed that `InternedString::new` world start appearing in profile result, and that we would want `PackageId`, and `Summary`, Et Al. to store the `InternedString`. That is why I put the interner in a shared folder. So far it is just used in the resolver. It may make sense for a lot more of the Strings to be interned, but with the extra copy... I have not explored it yet.

7 years agouse `Deref` instead of an explicit function
Eh2406 [Wed, 7 Mar 2018 22:19:53 +0000 (17:19 -0500)]
use `Deref` instead of an explicit function

7 years agouse `into_boxed_str` to shrink before we leek
Eh2406 [Wed, 7 Mar 2018 22:10:55 +0000 (17:10 -0500)]
use `into_boxed_str` to shrink before we leek

7 years agoAuto merge of #5012 - infinity0:pr4988, r=alexcrichton
bors [Wed, 7 Mar 2018 15:39:24 +0000 (15:39 +0000)]
Auto merge of #5012 - infinity0:pr4988, r=alexcrichton

Don't require dev-dependencies when not needed in certain cases

Specifically, when running `cargo install` and add a flag for this behaviour in `cargo build`.

This closes #4988.

7 years agoWork around #5134 for now
Ximin Luo [Wed, 7 Mar 2018 13:46:43 +0000 (14:46 +0100)]
Work around #5134 for now

7 years agoAuto merge of #5138 - alexcrichton:small-opt, r=matklad
bors [Wed, 7 Mar 2018 00:02:33 +0000 (00:02 +0000)]
Auto merge of #5138 - alexcrichton:small-opt, r=matklad

Some small optimizations

Found an easy hot spot or two when profiling `./x.py build` in rust-lang/rust, although certainly still lots remaining.

7 years agoRetain a vector instead of reallocating
Alex Crichton [Tue, 6 Mar 2018 23:09:53 +0000 (15:09 -0800)]
Retain a vector instead of reallocating

No need to create a new version!

7 years agoadd unsafe
Eh2406 [Tue, 6 Mar 2018 22:44:31 +0000 (17:44 -0500)]
add unsafe

7 years agoAuto merge of #5135 - matklad:drop-ignored-tests, r=alexcrichton
bors [Tue, 6 Mar 2018 22:34:32 +0000 (22:34 +0000)]
Auto merge of #5135 - matklad:drop-ignored-tests, r=alexcrichton

Drop ignored tests

r? @alexcrichton

These tests are ignored, so its better to remove them. `run` does not supports `--bins` argument, so I've left a single test that checks specifically for this.

cc https://github.com/rust-lang/cargo/pull/3901

7 years agoOptimize SourceId::crates_io
Alex Crichton [Tue, 6 Mar 2018 21:36:05 +0000 (13:36 -0800)]
Optimize SourceId::crates_io

Turns out this gets called a lot in large projects as almost all dependencies
come from crates.io and parsed manifests use this. Let's cache the result as
it's always the same!

7 years agoand links just to be throw
Eh2406 [Sun, 4 Mar 2018 04:08:13 +0000 (23:08 -0500)]
and links just to be throw

7 years agointern the features
Eh2406 [Sun, 4 Mar 2018 03:38:10 +0000 (22:38 -0500)]
intern the features

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 5000000 ticks in ~65 sec
After we got to 5000000 ticks in ~52 sec

7 years agomake a global string interner
Eh2406 [Sun, 4 Mar 2018 02:01:33 +0000 (21:01 -0500)]
make a global string interner

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 5000000 ticks in ~72 sec
After we got to 5000000 ticks in ~65 sec

7 years agoDrop ignored tests
Aleksey Kladov [Tue, 6 Mar 2018 20:28:52 +0000 (23:28 +0300)]
Drop ignored tests

7 years agoRevert "Make the default behaviour of `cargo build` match the documentation"
Ximin Luo [Tue, 6 Mar 2018 19:49:20 +0000 (20:49 +0100)]
Revert "Make the default behaviour of `cargo build` match the documentation"

This reverts commit 3fc0715d33ccea567526242d2247576930db4a7c.

7 years agoAuto merge of #5132 - Eh2406:less_clones, r=alexcrichton
bors [Tue, 6 Mar 2018 19:16:55 +0000 (19:16 +0000)]
Auto merge of #5132 - Eh2406:less_clones, r=alexcrichton

don't clone a BacktrackFrame if we are not going to backtrack

I think this is a fix for #5130.

Currently the only recoverable `activate` error does not corrupt `cx`, so this is definitely ok. We should be careful as we add more recoverable `activate` errors that they don't corrupt `cx` to the point where the error messages are affected.

7 years agodon't clone a BacktrackFrame if we are not going to backtrack
Eh2406 [Tue, 6 Mar 2018 19:05:59 +0000 (14:05 -0500)]
don't clone a BacktrackFrame if we are not going to backtrack

7 years agoMerge remote-tracking branch 'upstream/master' into pr4988
Ximin Luo [Tue, 6 Mar 2018 18:56:35 +0000 (19:56 +0100)]
Merge remote-tracking branch 'upstream/master' into pr4988

7 years agoNeater error message. Tests now check the cycle is output.
Giles Cope [Tue, 6 Mar 2018 09:30:37 +0000 (09:30 +0000)]
Neater error message. Tests now check the cycle is output.

7 years agoAuto merge of #5127 - ehuss:incremental-doc, r=alexcrichton
bors [Tue, 6 Mar 2018 03:22:33 +0000 (03:22 +0000)]
Auto merge of #5127 - ehuss:incremental-doc, r=alexcrichton

Fix reference docs for "incremental" in the wrong place.

It is part of the [build] section, not a [target].

7 years agoFix reference docs for "incremental" in the wrong place.
Eric Huss [Tue, 6 Mar 2018 03:10:08 +0000 (19:10 -0800)]
Fix reference docs for "incremental" in the wrong place.

It is part of the [build] section, not a [target].

7 years agoAuto merge of #5122 - acmcarther:acm-emit-features-from-cargo-metadata, r=alexcrichton
bors [Tue, 6 Mar 2018 03:01:47 +0000 (03:01 +0000)]
Auto merge of #5122 - acmcarther:acm-emit-features-from-cargo-metadata, r=alexcrichton

Emit Resolve.features_sorted in "cargo metadata"

This PR adds `features` to `metadata.resolve.nodes[*]` using the Resolve object's known features. This is different from the `features` fields that already exist elsewhere within metadata as this one is the actual features that need to be used in order to build the code.

Context: I'm currently using Cargo's internals to synthesize BUILD files for the Bazel build tool. `cargo metadata` currently provides almost everything I need in order to avoid using Cargo's internals -- *except* for this.

cc https://github.com/google/cargo-raze/issues/7

7 years agoError message for package cycles lists the packages in the cycle.
Giles Cope [Tue, 6 Mar 2018 00:41:21 +0000 (00:41 +0000)]
Error message for package cycles lists the packages in the cycle.

7 years agoRepair the other metadata tests
Alex McArther [Mon, 5 Mar 2018 14:36:12 +0000 (06:36 -0800)]
Repair the other metadata tests

7 years agoEmit resolve.features in "cargo metadata"
Alex McArther [Mon, 5 Mar 2018 06:04:27 +0000 (22:04 -0800)]
Emit resolve.features in "cargo metadata"

7 years agoAuto merge of #5119 - alexcrichton:no-clone-index-in-tests, r=matklad
bors [Sun, 4 Mar 2018 21:16:16 +0000 (21:16 +0000)]
Auto merge of #5119 - alexcrichton:no-clone-index-in-tests, r=matklad

Update a test to not clone the real index

A local index should work ok!

7 years agoUpdate a test to not clone the real index
Alex Crichton [Sun, 4 Mar 2018 20:51:31 +0000 (12:51 -0800)]
Update a test to not clone the real index

A local index should work ok!

7 years agoAuto merge of #5118 - Eh2406:more_rc, r=alexcrichton
bors [Sun, 4 Mar 2018 20:47:56 +0000 (20:47 +0000)]
Auto merge of #5118 - Eh2406:more_rc, r=alexcrichton

use more Rc in the part of resolver that gets cloned a lot

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 1700000 ticks in ~(82 to 97) sec
After we got to 1700000 ticks in ~(63 to 67) sec

7 years agouse more Rc in the part of resolver that gets cloned a lot
Eh2406 [Sun, 4 Mar 2018 02:33:23 +0000 (21:33 -0500)]
use more Rc in the part of resolver that gets cloned a lot

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 1700000 ticks in ~(82 to 97) sec
After we got to 1700000 ticks in ~(63 to 67) sec

7 years agoAuto merge of #5112 - Eh2406:cache_queries, r=alexcrichton
bors [Sat, 3 Mar 2018 21:32:24 +0000 (21:32 +0000)]
Auto merge of #5112 - Eh2406:cache_queries, r=alexcrichton

Cache the query result.

Small performance gain.

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 1700000 ticks in ~97 sec
After we got to 1700000 ticks in ~92 sec. I just reran and got ~82, so it seems to be unstable.
And query disappears from the flame graph

7 years agoUse `HashMap` insted of `BTreeMap`
Eh2406 [Sat, 3 Mar 2018 17:49:15 +0000 (12:49 -0500)]
Use `HashMap` insted of `BTreeMap`

7 years ago`Context` no longer needs replacements nor its lifetime
Eh2406 [Sat, 3 Mar 2018 16:17:05 +0000 (11:17 -0500)]
`Context` no longer needs replacements nor its lifetime

7 years agoMake a `RegistryQueryer` to own the cache
Eh2406 [Sat, 3 Mar 2018 15:56:57 +0000 (10:56 -0500)]
Make a `RegistryQueryer` to own the cache

7 years agoMerge remote-tracking branch 'upstream/master' into pr4988
Ximin Luo [Sat, 3 Mar 2018 11:56:08 +0000 (12:56 +0100)]
Merge remote-tracking branch 'upstream/master' into pr4988

7 years agoAuto merge of #5110 - alexcrichton:reset-harder, r=matklad
bors [Fri, 2 Mar 2018 23:37:29 +0000 (23:37 +0000)]
Auto merge of #5110 - alexcrichton:reset-harder, r=matklad

Try a lot harder to recover corrupt git repos

We've received a lot of intermittent bug reports historically about corrupt git
repositories. These inevitably happens as Cargo is ctrl-c'd or for whatever
other reason, and to provide a better user experience Cargo strives to
automatically handle these situations by blowing away the old checkout for a new
update.

This commit adds a new test which attempts to pathologically corrupt a git
database and checkout in an attempt to expose bugs in Cargo. Sure enough there
were some more locations that we needed to handle gracefully for corrupt git
checkouts. Notable inclusions were:

* The `fetch` operation in libgit2 would fail due to corrupt references. This
  starts by adding an explicit whitelist for classes of errors coming out of
  `fetch` to auto-retry by blowing away the repository. We need to be super
  careful here as network errors commonly come out of this function and we don't
  want to too aggressively re-clone.

* After a `fetch` succeeded a repository could fail to actual resolve a
  git reference to the actual revision we want. This indicated that we indeed
  needed to blow everything away and re-clone entirely again.

* When creating a checkout from a database the `reset` operation might fail due
  to a corrupt local database of the checkout itself. If this happens we needed
  to just blow it away and try again.

There's likely more lurking situations where we need to re-clone but I figure we
can discover those over time.

7 years agoTry a lot harder to recover corrupt git repos
Alex Crichton [Fri, 2 Mar 2018 17:44:47 +0000 (09:44 -0800)]
Try a lot harder to recover corrupt git repos

We've received a lot of intermittent bug reports historically about corrupt git
repositories. These inevitably happens as Cargo is ctrl-c'd or for whatever
other reason, and to provide a better user experience Cargo strives to
automatically handle these situations by blowing away the old checkout for a new
update.

This commit adds a new test which attempts to pathologically corrupt a git
database and checkout in an attempt to expose bugs in Cargo. Sure enough there
were some more locations that we needed to handle gracefully for corrupt git
checkouts. Notable inclusions were:

* The `fetch` operation in libgit2 would fail due to corrupt references. This
  starts by adding an explicit whitelist for classes of errors coming out of
  `fetch` to auto-retry by blowing away the repository. We need to be super
  careful here as network errors commonly come out of this function and we don't
  want to too aggressively re-clone.

* After a `fetch` succeeded a repository could fail to actual resolve a
  git reference to the actual revision we want. This indicated that we indeed
  needed to blow everything away and re-clone entirely again.

* When creating a checkout from a database the `reset` operation might fail due
  to a corrupt local database of the checkout itself. If this happens we needed
  to just blow it away and try again.

There's likely more lurking situations where we need to re-clone but I figure we
can discover those over time.

7 years agoCache the query result.
Eh2406 [Fri, 2 Mar 2018 22:56:36 +0000 (17:56 -0500)]
Cache the query result.

In a test on https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286
Before we got to 1700000 ticks in ~97 sec
After we got to 1700000 ticks in ~92 sec
And query disappears from the flame graph

7 years agoAuto merge of #5111 - ehuss:bashc-toolchains, r=alexcrichton
bors [Fri, 2 Mar 2018 20:42:25 +0000 (20:42 +0000)]
Auto merge of #5111 - ehuss:bashc-toolchains, r=alexcrichton

Support +toolchain rustup override in bash completions.

Fixes #5107

7 years agoSupport +toolchain rustup override in bash completions.
Eric Huss [Fri, 2 Mar 2018 19:45:16 +0000 (11:45 -0800)]
Support +toolchain rustup override in bash completions.

Fixes #5107

7 years agoAuto merge of #5095 - tdbgamer:master, r=matklad
bors [Fri, 2 Mar 2018 18:43:11 +0000 (18:43 +0000)]
Auto merge of #5095 - tdbgamer:master, r=matklad

Issue #5087

* remove Workspace::current_manifest
* remove incorrect logging
* move empty check to Packages::into_package_id_specs
* add test case mentioned in issue

7 years agoAuto merge of #5104 - Eh2406:bug_fix, r=alexcrichton
bors [Fri, 2 Mar 2018 15:06:13 +0000 (15:06 +0000)]
Auto merge of #5104 - Eh2406:bug_fix, r=alexcrichton

missed this important bug

In the PR #5000 I finished and we merged yesterday I missed a bug and left in an outdated comment.

@alexcrichton

7 years agoThis test should pass if we have tried to `update registry` evan if the command other...
Eh2406 [Fri, 2 Mar 2018 13:49:42 +0000 (08:49 -0500)]
This test should pass if we have tried to `update registry` evan if the command otherwise fails

7 years agoget ci green; don't clone more than we need
Eh2406 [Fri, 2 Mar 2018 02:44:02 +0000 (21:44 -0500)]
get ci green; don't clone more than we need

7 years agomissed this important bug
Eh2406 [Fri, 2 Mar 2018 02:05:22 +0000 (21:05 -0500)]
missed this important bug

7 years agoMerge remote-tracking branch 'upstream/master'
Timothy Bess [Thu, 1 Mar 2018 22:17:06 +0000 (17:17 -0500)]
Merge remote-tracking branch 'upstream/master'

7 years agoIssue #5087
Timothy Bess [Thu, 1 Mar 2018 22:14:57 +0000 (17:14 -0500)]
Issue #5087
* change match to if

7 years agoAuto merge of #5100 - alexcrichton:better-dep-ordering, r=matklad
bors [Thu, 1 Mar 2018 21:49:10 +0000 (21:49 +0000)]
Auto merge of #5100 - alexcrichton:better-dep-ordering, r=matklad

Improve Cargo's scheduling of builds

Historically Cargo has been pretty naive about scheduling builds, basically just
greedily scheduling as much work as possible. As pointed out in #5014, however,
this isn't guaranteed to always have the best results. If we've got a very deep
dependency tree that would otherwise fill up our CPUs Cargo should ideally
schedule these dependencies first. That way when we reach higher up in the
dependency tree we should have more work available to fill in the cracks if
there's spare cpus.

Closes #5014

7 years agoImprove Cargo's scheduling of builds
Alex Crichton [Thu, 1 Mar 2018 06:04:54 +0000 (22:04 -0800)]
Improve Cargo's scheduling of builds

Historically Cargo has been pretty naive about scheduling builds, basically just
greedily scheduling as much work as possible. As pointed out in #5014, however,
this isn't guaranteed to always have the best results. If we've got a very deep
dependency tree that would otherwise fill up our CPUs Cargo should ideally
schedule these dependencies first. That way when we reach higher up in the
dependency tree we should have more work available to fill in the cracks if
there's spare cpus.

Closes #5014

7 years agoAuto merge of #5000 - Eh2406:i4347, r=alexcrichton
bors [Thu, 1 Mar 2018 21:27:17 +0000 (21:27 +0000)]
Auto merge of #5000 - Eh2406:i4347, r=alexcrichton

backtrack if can not activate

This is a fix for #4347
Unfortunately this too regressed error messages for the case that you specified a dependency feature that does not  exist.
@alexcrichton advice on improving the message?

7 years agoAuto merge of #5103 - alexcrichton:no-hamcrest, r=matklad
bors [Thu, 1 Mar 2018 19:48:18 +0000 (19:48 +0000)]
Auto merge of #5103 - alexcrichton:no-hamcrest, r=matklad

Drop outdated hamcrest dependency

This hasn't been updated in awhile and in general we've been barely using it.
This drops the outdated dependency and vendors a small amount of the
functionality that it provided. I think eventually we'll want to transition away
from this method of assertions but I wanted to get this piece in to avoid too
much churn in one commit.

7 years agoDrop outdated hamcrest dependency
Alex Crichton [Thu, 1 Mar 2018 18:14:17 +0000 (10:14 -0800)]
Drop outdated hamcrest dependency

This hasn't been updated in awhile and in general we've been barely using it.
This drops the outdated dependency and vendors a small amount of the
functionality that it provided. I think eventually we'll want to transition away
from this method of assertions but I wanted to get this piece in to avoid too
much churn in one commit.

7 years agofix cause and the error messages
Eh2406 [Thu, 1 Mar 2018 18:12:27 +0000 (13:12 -0500)]
fix cause and the error messages

7 years agoFold cargotest into testsuite
Alex Crichton [Thu, 1 Mar 2018 17:45:56 +0000 (09:45 -0800)]
Fold cargotest into testsuite

Now that there's only one crate with integration tests there's no need to have
this be a separate crate, yay!

7 years agoOne more todo to fix
Eh2406 [Thu, 1 Mar 2018 16:25:46 +0000 (11:25 -0500)]
One more todo to fix

7 years agofix the todo's
Eh2406 [Tue, 27 Feb 2018 21:42:39 +0000 (16:42 -0500)]
fix the todo's

needs a test where we have an activation_error the then try activate something that dose not work and backtrack to where we had the activation_error then:
- Hit fast backtracking that go past the crate with the missing features
- Or give a bad error message that does not mention the activation_error.
The test will pass, but there is code that is not yet justified by tests

7 years agoWIP: make it recurs if activation fails
Eh2406 [Tue, 27 Feb 2018 16:08:11 +0000 (11:08 -0500)]
WIP: make it recurs if activation fails

7 years agoadd a test for cargo/issues/4347
Eh2406 [Tue, 27 Feb 2018 15:08:19 +0000 (10:08 -0500)]
add a test for cargo/issues/4347

7 years agoAuto merge of #5093 - alexcrichton:include-cargo-lock, r=matklad
bors [Wed, 28 Feb 2018 22:07:53 +0000 (22:07 +0000)]
Auto merge of #5093 - alexcrichton:include-cargo-lock, r=matklad

Package lock files in published crates

Previously we had logic to explicitly skip lock files but there's actually a
good case to read these from crates.io (#2263) so let's do so!

Closes #2263

7 years agoPackage lock files in published crates
Alex Crichton [Tue, 27 Feb 2018 15:56:04 +0000 (07:56 -0800)]
Package lock files in published crates

Previously we had logic to explicitly skip lock files but there's actually a
good case to read these from crates.io (#2263) so let's do so!

Closes #2263

7 years agoIssue #5087
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

7 years agoRevert "Issue #5087 * fix broken test case"
Timothy Bess [Wed, 28 Feb 2018 21:17:33 +0000 (16:17 -0500)]
Revert "Issue #5087 * fix broken test case"

This reverts commit 17572b8

7 years agoIssue #5087
Timothy Bess [Wed, 28 Feb 2018 21:12:34 +0000 (16:12 -0500)]
Issue #5087
* fix broken test case

7 years agoAuto merge of #5097 - matklad:end-of-tls-saga-hopefully, r=alexcrichton
bors [Wed, 28 Feb 2018 15:20:30 +0000 (15:20 +0000)]
Auto merge of #5097 - matklad:end-of-tls-saga-hopefully, r=alexcrichton

Revert "Warn Windows 7 users about old TLS"

We now have upgraded libgit2 version, so Cargo would use TLS 1.2
on windows unconditionally. Note that even *unpatched* windows 7
supports TLS 1.2.

@retep998, you've originally written that

>TLS 1.2 support for Windows 7 still requires a rather recent patch and so even if we do fix that, we should still keep this error message because some people use Windows 7 with automatic updates disabled.

However, it looks like Windows 7 **does** support TLS 1.2 out of the box, and the update is required to enable the use of TLS 1.2 by default:

https://github.com/libgit2/libgit2/issues/4546#issuecomment-368909158

My own testing on a random win 7 virtual box confirms this.

closes https://github.com/rust-lang/cargo/issues/5066

7 years agoRevert "Warn Windows 7 users about old TLS"
Aleksey Kladov [Wed, 28 Feb 2018 06:39:41 +0000 (09:39 +0300)]
Revert "Warn Windows 7 users about old TLS"

We now have upgraded libgit2 version, so Cargo would use TLS 1.2
on windows unconditionally. Note that even *unpatched* windows 7
supports TLS 1.2

7 years agoIssue #5087
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

7 years agoRespect lock files in crates.io crates
Alex Crichton [Tue, 27 Feb 2018 15:50:05 +0000 (07:50 -0800)]
Respect lock files in crates.io crates

Currently Cargo doesn't publish lock files in crates.io crates but we'll
eventually be doing so, so this changes Cargo to recognize `Cargo.lock` when
it's published to crates.io as use it as the basis for resolution during `cargo
install`.

cc #2263

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

7 years agoUpdate git2 to 0.7.0
Alex Crichton [Tue, 27 Feb 2018 13:14:38 +0000 (05:14 -0800)]
Update git2 to 0.7.0

cc #5066

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

7 years agoAuto merge of #5059 - tobywhughes:master, r=alexcrichton
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)

7 years agoone more use of entry
Eh2406 [Tue, 27 Feb 2018 02:46:59 +0000 (21:46 -0500)]
one more use of entry

7 years agosome simple clippy things V2
Eh2406 [Tue, 27 Feb 2018 02:02:39 +0000 (21:02 -0500)]
some simple clippy things V2

7 years agoAuto merge of #5081 - matklad:document-not-all-the-things, r=alexcrichton
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

7 years agoMerge remote-tracking branch 'upstream/master'
Toby Hughes [Mon, 26 Feb 2018 23:36:23 +0000 (15:36 -0800)]
Merge remote-tracking branch 'upstream/master'

7 years agoAdded tests for clean with verbose output
Toby Hughes [Mon, 26 Feb 2018 23:33:23 +0000 (15:33 -0800)]
Added tests for clean with verbose output

7 years agouse entry to not hash twice thanks clippy
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)

7 years agointellij rust suggested fixes
Eh2406 [Fri, 23 Feb 2018 23:27:53 +0000 (18:27 -0500)]
intellij rust suggested fixes

(cherry picked from commit 24836e9)

7 years agoAuto merge of #5083 - matklad:Cargo-the-tool-1.0, r=alexcrichton
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 :)

7 years agoAuto merge of #5069 - matklad:win7-y-u-no-tls, r=alexcrichton
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.

7 years agoMake cargo-the-binary version the same as the Rust version
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

7 years agoAuto merge of #5080 - matklad:hope-this-wont-be-re-reverted, r=alexcrichton
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

7 years agoSupport --exclude option for `cargo doc`
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.

7 years agoRevert "Seperate licenses with a `/`"
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

7 years agoWarn about TLS for github specifically
Aleksey Kladov [Mon, 26 Feb 2018 17:41:22 +0000 (20:41 +0300)]
Warn about TLS for github specifically

7 years agoAuto merge of #5079 - alexcrichton:bump, r=alexcrichton
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

7 years agoBump to 0.27.0
Alex Crichton [Mon, 26 Feb 2018 15:35:03 +0000 (07:35 -0800)]
Bump to 0.27.0

7 years agoAuto merge of #5075 - ehuss:report-test-ws, r=matklad
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