]> git.proxmox.com Git - cargo.git/log
cargo.git
6 years agomove the BinaryHeap/pop_most_constrained code out of the most complicated loop
Eh2406 [Wed, 26 Sep 2018 03:06:35 +0000 (23:06 -0400)]
move the BinaryHeap/pop_most_constrained code out of the most complicated loop

6 years agomove the visual indicator code out of the most complicated loop
Eh2406 [Tue, 25 Sep 2018 02:23:00 +0000 (22:23 -0400)]
move the visual indicator code out of the most complicated loop

6 years agoAuto merge of #5921 - Eh2406:proptest, r=alexcrichton
bors [Tue, 25 Sep 2018 00:59:33 +0000 (00:59 +0000)]
Auto merge of #5921 - Eh2406:proptest, r=alexcrichton

use proptest to fuzz the resolver

This has been a long time goal. This uses proptest to generate random registry indexes and throws them at the resolver.

It would be simple to generate a registry by,
1. make a list of name and version number each picked at random
2. for each pick a list of dependencies by making a list of name and version requirements at random.

Unfortunately, it would be extremely unlikely to generate any interesting cases, as the chance that the random name you depend on was also generated as the name of a crate is vanishingly small. So this implementation works very hard to ensure that it only generates valid dependency requirements.

This is still a WIP as it has many problems:
- [x] The current strategy is very convoluted. It is hard to see that it is correct, and harder to see how it can be expanded. Thanks to @centril for working with me on IRC to get this far. Do you have advice for improving it?
- [X] It is slow as molasses when run without release. I looked with a profilere and we seem to spend 2/3 of the time in `to_url`. Maybe we can special case `example.com` for test, like we do for `crates.io` or something? Edit: Done. `lazy_static` did its magic.
- [x] `proptest` does not yet work with `minimal-versions`, a taste of my own medicine.
- [x] I have not verified that, if I remove the fixes for other test that this regenerates them.

The current strategy does not:
- [x] generate interesting version numbers, it just dose 1.0.0, 2.0.0 ...
- [x] guarantee that the version requirements are possible to meet by the crate named.
- [ ] generate features.
- [ ] generate dev-dependencies.
- [x] build deep dependency trees, it seems to prefer to generate crates with 0 or 1 dependents so that on average the tree is 1 or 2 layers deep.

And last but not least, there are no interesting properties being tested. Like:
- [ ] If resolution was successful, then all the transitive requirements are met.
- [x] If resolution was successful, then unpublishing a version of a crate that was not selected should not change that.
- [x] If resolution was unsuccessful, then it should stay unsuccessful even if any version of a crate is unpublished.

- [ ] @maurer suggested testing for consistency. Same registry, same cargo version, same lockfile, every time.
- [ ] @maurer suggested a pareto optimality property (if all else stays the same, but new package versions are released, we don't get a new lockfile where every version is <= the old one, and at least one is < the old one)

6 years agoAuto merge of #6086 - alexcrichton:build-plan-dev-deps, r=ehuss
bors [Mon, 24 Sep 2018 22:43:47 +0000 (22:43 +0000)]
Auto merge of #6086 - alexcrichton:build-plan-dev-deps, r=ehuss

Fix `--build-plan` with dev-dependencies

Regressed in #6005 it looks like the build plan requires all packages to
be downloaded rather than just those coming out of `unit_dependenices`,
so let's make sure to download everything!

Closes #6082

6 years agoIn theory shrinkage should be 2, but in practice we get better trees with a larger...
Eh2406 [Mon, 24 Sep 2018 22:00:56 +0000 (18:00 -0400)]
In theory shrinkage should be 2, but in practice we get better trees with a larger value.

6 years agoAuto merge of #6085 - alexcrichton:progress, r=ehuss
bors [Mon, 24 Sep 2018 18:04:57 +0000 (18:04 +0000)]
Auto merge of #6085 - alexcrichton:progress, r=ehuss

Print a line per downloaded crate

This commit brings back the old one-line-per-crate output that Cargo's
had since the beginning of time but was removed in #6005. This was
requested on our [users forum][1]

[1]: https://internals.rust-lang.org/t/testing-cargos-parallel-downloads/8466/2

6 years agoFix `--build-plan` with dev-dependencies
Alex Crichton [Mon, 24 Sep 2018 16:24:20 +0000 (09:24 -0700)]
Fix `--build-plan` with dev-dependencies

Regressed in #6005 it looks like the build plan requires all packages to
be downloaded rather than just those coming out of `unit_dependenices`,
so let's make sure to download everything!

Closes #6082

6 years agoAuto merge of #6081 - dtolnay:raw, r=alexcrichton
bors [Mon, 24 Sep 2018 16:34:11 +0000 (16:34 +0000)]
Auto merge of #6081 - dtolnay:raw, r=alexcrichton

Fix missing messages when --message-format=json is deeply nested

This commit switches from `serde_json::Value` to [`RawValue`](https://docs.rs/serde_json/1.0/serde_json/value/struct.RawValue.html), which can process arbitrarily deeply nested JSON content without recursion.

Fixes #5992. @ehuss

6 years agoproptest 0.8.7 has a better `ci_no_shrink`
Eh2406 [Mon, 24 Sep 2018 16:17:16 +0000 (12:17 -0400)]
proptest 0.8.7 has a better `ci_no_shrink`

6 years agoPrint a line per downloaded crate
Alex Crichton [Mon, 24 Sep 2018 15:59:25 +0000 (08:59 -0700)]
Print a line per downloaded crate

This commit brings back the old one-line-per-crate output that Cargo's
had since the beginning of time but was removed in #6005. This was
requested on our [users forum][1]

[1]: https://internals.rust-lang.org/t/testing-cargos-parallel-downloads/8466/2

6 years agoAuto merge of #6080 - matthiaskrgr:jq_comment, r=dwijnand
bors [Sun, 23 Sep 2018 21:54:18 +0000 (21:54 +0000)]
Auto merge of #6080 - matthiaskrgr:jq_comment, r=dwijnand

job queue: remove outdated comment about reenabling compile-progress once #5695 is fixed

The issue has been resolved and the compile-progress has been reenabled already.

6 years agoFix missing messages when --message-format=json is deeply nested
David Tolnay [Sun, 23 Sep 2018 21:11:25 +0000 (14:11 -0700)]
Fix missing messages when --message-format=json is deeply nested

This commit switches from serde_json::Value to RawValue, which can
process arbitrarily deeply nested JSON content without recursion.

6 years agoAuto merge of #6078 - jdxcode:login-url, r=alexcrichton
bors [Sun, 23 Sep 2018 21:05:14 +0000 (21:05 +0000)]
Auto merge of #6078 - jdxcode:login-url, r=alexcrichton

fix: login url

Current output:

```sh-session
$ cargo login
    Updating registry `https://github.com/rust-lang/crates.io-index`
please visit https://crates.iome and paste the API Token below
```

6 years agoAuto merge of #6076 - matthiaskrgr:version_verbose, r=dwijnand
bors [Sun, 23 Sep 2018 20:24:15 +0000 (20:24 +0000)]
Auto merge of #6076 - matthiaskrgr:version_verbose, r=dwijnand

cargo version: support --verbose

make obtaining of the version output an own function and use it in the "version" subcommand

makes "cargo version -v" work equivalent to "cargo -Vv"

6 years agojob queue: remove outdated comment about reenabling compile-progress once #5695 is...
Matthias Krüger [Sun, 23 Sep 2018 08:54:58 +0000 (10:54 +0200)]
job queue: remove outdated comment about reenabling compile-progress once #5695 is fixed

The issue has been resolved and the compile-progress has been reenabled already.

6 years agofix: login url
Jeff Dickey [Sat, 22 Sep 2018 21:49:40 +0000 (14:49 -0700)]
fix: login url

6 years agocargo version: support --verbose
Matthias Krüger [Sat, 22 Sep 2018 09:56:31 +0000 (11:56 +0200)]
cargo version: support --verbose

make obtaining of the version output an own function and use it in the "version" subcommand

makes "cargo version -v" work equivalent to "cargo -Vv"

6 years agoAuto merge of #6066 - zachlute:project-to-package-docs, r=alexcrichton
bors [Sat, 22 Sep 2018 05:05:53 +0000 (05:05 +0000)]
Auto merge of #6066 - zachlute:project-to-package-docs, r=alexcrichton

Replaced 'project' with 'package' in Cargo documentation.

Partial fix for #6056.

I tried to make a distinction between places that were talking about Cargo 'projects' vs. a generic concept of a 'project' or a github 'project'. It's entirely possible I was overzealous, so please tell me if some of these changes look dumb.

6 years agoRevert any project->package changes that would change URLs or anchors for now.
Zach Lute [Sat, 22 Sep 2018 01:16:53 +0000 (18:16 -0700)]
Revert any project->package changes that would change URLs or anchors for now.

6 years agoAuto merge of #6071 - orium:fix-links, r=alexcrichton
bors [Sat, 22 Sep 2018 00:17:48 +0000 (00:17 +0000)]
Auto merge of #6071 - orium:fix-links, r=alexcrichton

Fix urls for the edition guide.

6 years agoAuto merge of #6065 - zachlute:change-project-to-package, r=dwijnand
bors [Fri, 21 Sep 2018 23:34:08 +0000 (23:34 +0000)]
Auto merge of #6065 - zachlute:change-project-to-package, r=dwijnand

Replace 'project' with 'package' in many strings and comments.

Partial fix for #6056.

Shouldn't be anything too interesting or surprising in here.

Still need to do documentation, but will do that as a different PR.

6 years agoAuto merge of #6026 - alexcrichton:install-config, r=ehuss
bors [Fri, 21 Sep 2018 22:52:10 +0000 (22:52 +0000)]
Auto merge of #6026 - alexcrichton:install-config, r=ehuss

Only load `~/.cargo/config` for `cargo install`

This commit tweaks how configuration is loaded for `cargo install`, ensuring
that we only load configuration from `$HOME` instead of the current working
directory. This should make installations a little more consistent in that they
probably shouldn't cover project-local configuration but should respect global
configuration!

Closes #6025

6 years agopretty print the registry made by proptest
Eh2406 [Fri, 21 Sep 2018 20:21:38 +0000 (16:21 -0400)]
pretty print the registry made by proptest

6 years agoOnly load `~/.cargo/config` for `cargo install`
Alex Crichton [Fri, 14 Sep 2018 17:42:27 +0000 (10:42 -0700)]
Only load `~/.cargo/config` for `cargo install`

This commit tweaks how configuration is loaded for `cargo install`, ensuring
that we only load configuration from `$HOME` instead of the current working
directory. This should make installations a little more consistent in that they
probably shouldn't cover project-local configuration but should respect global
configuration!

Closes #6025

6 years agoAuto merge of #6068 - eddyb:oopsie-daisy-stabilize, r=alexcrichton
bors [Fri, 21 Sep 2018 19:39:41 +0000 (19:39 +0000)]
Auto merge of #6068 - eddyb:oopsie-daisy-stabilize, r=alexcrichton

Remove `fix::local_paths_no_fix`, as `crate_in_paths` is getting stabilized.

Needed for rust-lang/rust#54403 (blocking RC1).
Ideally we'd also clean up the tests, e.g. removing `#![feature(rust_2018_preview)]` and `is_nightly` checks, but it's easier to just remove the only failing test (because it tests the feature gate is needed).

6 years agoFix urls for the edition guide.
Diogo Sousa [Fri, 21 Sep 2018 16:34:34 +0000 (17:34 +0100)]
Fix urls for the edition guide.

6 years agoRemove `fix::local_paths_no_fix`, as `crate_in_paths` is getting stabilized.
Eduard-Mihai Burtescu [Fri, 21 Sep 2018 15:18:37 +0000 (18:18 +0300)]
Remove `fix::local_paths_no_fix`, as `crate_in_paths` is getting stabilized.

6 years agoFix init::no_filename
Dale Wijnand [Fri, 21 Sep 2018 08:15:51 +0000 (09:15 +0100)]
Fix init::no_filename

6 years agoReplaced 'project' with 'package' in Cargo documentation.
Zach Lute [Fri, 21 Sep 2018 07:09:45 +0000 (00:09 -0700)]
Replaced 'project' with 'package' in Cargo documentation.

I tried to make a distinction between places that were talking about Cargo 'projects' vs. a generic concept of a 'project' or a github 'project'.

6 years agoReplace 'project' with 'package' in many strings and comments.
Zach Lute [Fri, 21 Sep 2018 06:47:09 +0000 (23:47 -0700)]
Replace 'project' with 'package' in many strings and comments.

6 years agoAuto merge of #6063 - joelgallant:rustdoc-edition-master, r=alexcrichton
bors [Thu, 20 Sep 2018 23:53:22 +0000 (23:53 +0000)]
Auto merge of #6063 - joelgallant:rustdoc-edition-master, r=alexcrichton

Removes -Zunstable-options for rustdoc testing

See #6062 - this is for master

6 years agoFixes doc::doc_edition test output (too many spaces)
Joel Gallant [Thu, 20 Sep 2018 22:09:55 +0000 (16:09 -0600)]
Fixes doc::doc_edition test output (too many spaces)

6 years agoFixes verbose output tests
Joel Gallant [Thu, 20 Sep 2018 20:55:09 +0000 (14:55 -0600)]
Fixes verbose output tests

6 years agoRemoves -Zunstable-options for rustdoc testing
Joel Gallant [Thu, 20 Sep 2018 20:04:19 +0000 (14:04 -0600)]
Removes -Zunstable-options for rustdoc testing

6 years agoAuto merge of #6061 - dwijnand:specify-lockfile-path-in---locked-error, r=alexcrichton
bors [Thu, 20 Sep 2018 17:53:49 +0000 (17:53 +0000)]
Auto merge of #6061 - dwijnand:specify-lockfile-path-in---locked-error, r=alexcrichton

Specify lockfile path in --locked error msg

Fixes #4603

6 years agoAuto merge of #6058 - dwijnand:tweak-stale-bot, r=alexcrichton
bors [Thu, 20 Sep 2018 17:11:59 +0000 (17:11 +0000)]
Auto merge of #6058 - dwijnand:tweak-stale-bot, r=alexcrichton

Tweak stale bot's configs

Refs #6035

r? @wycats

6 years agoAuto merge of #6060 - dwijnand:master, r=alexcrichton
bors [Thu, 20 Sep 2018 16:27:42 +0000 (16:27 +0000)]
Auto merge of #6060 - dwijnand:master, r=alexcrichton

If creating a new GitSource, updating it is required before querying it

Fixes #6059

6 years agoSpecify lockfile path in --locked error msg
Dale Wijnand [Thu, 20 Sep 2018 15:51:04 +0000 (16:51 +0100)]
Specify lockfile path in --locked error msg

6 years agoIf creating a new GitSource, updating it is required before querying it
Dale Wijnand [Thu, 20 Sep 2018 10:10:24 +0000 (11:10 +0100)]
If creating a new GitSource, updating it is required before querying it

6 years agoTweak stale bot's wording to emphasis summary giving over closing
Dale Wijnand [Thu, 20 Sep 2018 09:02:17 +0000 (10:02 +0100)]
Tweak stale bot's wording to emphasis summary giving over closing

6 years agoBump stale bot daysUntilStale to 3 yrs 2 months
Dale Wijnand [Thu, 20 Sep 2018 08:48:25 +0000 (09:48 +0100)]
Bump stale bot daysUntilStale to 3 yrs 2 months

Currently that translates to ~2015-07-20, of which there are 11 issues:

https://github.com/rust-lang/cargo/issues?q=is%3Aopen+sort%3Aupdated-asc+updated%3A%3C2015-07-20

6 years agoBump stale bot daysUntilClose from 7 to 30
Dale Wijnand [Thu, 20 Sep 2018 08:39:23 +0000 (09:39 +0100)]
Bump stale bot daysUntilClose from 7 to 30

6 years agoMerge remote-tracking branch 'origin/master' into proptest
Eh2406 [Thu, 20 Sep 2018 02:04:11 +0000 (22:04 -0400)]
Merge remote-tracking branch 'origin/master' into proptest

6 years agocheck each registry more thoroughly
Eh2406 [Tue, 18 Sep 2018 20:04:53 +0000 (16:04 -0400)]
check each registry more thoroughly

6 years agoadd a test to test the tester
Eh2406 [Wed, 19 Sep 2018 18:16:03 +0000 (14:16 -0400)]
add a test to test the tester

6 years ago`edge list` is a much cleaner approach
Eh2406 [Mon, 17 Sep 2018 21:06:28 +0000 (17:06 -0400)]
`edge list` is a much cleaner approach

6 years agoAuto merge of #6005 - alexcrichton:download-parallel, r=ehuss
bors [Tue, 18 Sep 2018 22:21:31 +0000 (22:21 +0000)]
Auto merge of #6005 - alexcrichton:download-parallel, r=ehuss

Download crates in parallel with HTTP/2

This PR revives some of the work of https://github.com/rust-lang/cargo/pull/5161 by refactoring Cargo to make it much easier to add parallel downloads, and then it does so with the `curl` crate's new `http2` feature to compile `nghttp2` has a backend.

The primary refactoring done here is to remove the concept of "download this one package" deep within a `Source`. Instead a `Source` still has a `download` method but it's considered to be largely non-blocking. If a crate needs to be downloaded it immediately returns information as to such. The `PackageSet` abstraction is now a central location for all parallel downloads, and all users of it have been refactored to be amenable to parallel downloads, when added.

Many more details are in the commits...

6 years agoDisable multiplexing by default for now
Alex Crichton [Tue, 18 Sep 2018 21:57:10 +0000 (14:57 -0700)]
Disable multiplexing by default for now

Let's hopefully weed out any configuration issues before turning it on by
default!

6 years agoAuto merge of #6053 - dwijnand:finish-removing-PreviewNotFound, r=alexcrichton
bors [Tue, 18 Sep 2018 21:06:34 +0000 (21:06 +0000)]
Auto merge of #6053 - dwijnand:finish-removing-PreviewNotFound, r=alexcrichton

Finish removing PreviewNotFound

None

6 years agoFinish removing PreviewNotFound
Dale Wijnand [Tue, 18 Sep 2018 21:05:04 +0000 (22:05 +0100)]
Finish removing PreviewNotFound

6 years agoAuto merge of #6052 - steveklabnik:gh6050, r=joshtriplett
bors [Tue, 18 Sep 2018 19:17:21 +0000 (19:17 +0000)]
Auto merge of #6052 - steveklabnik:gh6050, r=joshtriplett

No longer warn about #![feature(rust_2018_preview)]

This is no longer needed, and so the warning is outdated.

Fixes #6050

6 years agoNo longer warn about #![feature(rust_2018_preview)]
steveklabnik [Tue, 18 Sep 2018 19:04:55 +0000 (15:04 -0400)]
No longer warn about #![feature(rust_2018_preview)]

This is no longer needed, and so the warning is outdated.

Fixes #6050

6 years agoDon't enable HTTP1 pipelining as apparently it's flaky
Alex Crichton [Tue, 18 Sep 2018 18:37:55 +0000 (11:37 -0700)]
Don't enable HTTP1 pipelining as apparently it's flaky

It seems to fix some issues perhaps!

6 years agoAvoid a debug overflow from curl
Alex Crichton [Mon, 17 Sep 2018 18:59:37 +0000 (11:59 -0700)]
Avoid a debug overflow from curl

Curl doesn't guarantee that we'll get the total/current progress bars in a "as
we expect" fashion, so throw out weird data points (such as we've downloaded
more bytes than curl thinks we'll be downloading in total).

6 years agoDon't print a download summary if an error happens
Alex Crichton [Mon, 17 Sep 2018 18:59:10 +0000 (11:59 -0700)]
Don't print a download summary if an error happens

Otherwise it sort of just clutters things up!

6 years agoUse `Message::result_for` for better error messages
Alex Crichton [Mon, 17 Sep 2018 18:44:48 +0000 (11:44 -0700)]
Use `Message::result_for` for better error messages

Recently fixed in the `curl` crate, this'll allow getting the full and complete
error message for each transfer instead of just the error code.

6 years agoTweaks to retry logic
Alex Crichton [Mon, 17 Sep 2018 18:42:45 +0000 (11:42 -0700)]
Tweaks to retry logic

* Don't use `chain_err` internally inside `try` because then the spurious error
  printed internally is bland and doesn't contain the right error information.
  Instead place the `chain_err` on the outside so it propagates up to the user
  still but doesn't get printed for spurious errors.

* Handle `pending_ids` management in the case of an error on the connection.

6 years agoHandle callbacks invoked outside of `tls::set`
Alex Crichton [Mon, 17 Sep 2018 17:37:44 +0000 (10:37 -0700)]
Handle callbacks invoked outside of `tls::set`

This'll happen apparently when we drop items, and no need to keep tracking
information there!

6 years agoReview comments!
Alex Crichton [Fri, 14 Sep 2018 20:33:18 +0000 (13:33 -0700)]
Review comments!

6 years agoUpdate the progress bar for parallel downloads
Alex Crichton [Thu, 13 Sep 2018 03:57:01 +0000 (20:57 -0700)]
Update the progress bar for parallel downloads

This is actually a super tricky problem. We don't really have the capacity for
more than one line of update-able information in Cargo right now, so we need to
squeeze a lot of information into one line of output for Cargo. The main
constraints this tries to satisfy are:

* At all times it should be clear what's happening. Cargo shouldn't just hang
  with no output when downloading a crate for a long time, a counter ideally
  needs to be decreasing while the download progresses.

* If a progress bar is shown, it shouldn't jump around. This ends up just being
  a surprising user experience for most. Progress bars should only ever
  increase, but they may increase at different speeds.

* Cargo has, currently, at most one line of output (as mentioned above) to pack
  information into. We haven't delved into fancier terminal features that
  involve multiple lines of update-able output.

* When downloading crates as part of `cargo build` (the norm) we don't actually
  know ahead of time how many crates are being downloaded. We rely on the
  calculation of unit dependencies to naturally feed into downloading more
  crates.

* Furthermore, once we decide to download a crate, we don't actually know how
  big it is! We have to wait for the server to tell us how big it is.

There doesn't really seem to be a great solution that satisfies all of these
constraints unfortunately. As a result this commit implements a relatively
conservative solution which should hopefully get us most of the way there. There
isn't actually a progress bar but rather Cargo prints that it's got N crates
left to download, and if it takes awhile it prints out that there are M bytes
remaining.

Unfortunately the progress is pretty choppy and jerky, not providing a smooth
UI. This appears to largely be because Cargo will synchronously extract
tarballs, which for large crates can cause a noticeable pause. Cargo's not
really prepared internally to perform this work on helper threads, but ideally
if it could do so it would improve the output quite a bit! (making it much
smoother and also able to account for the time tarball extraction takes).

6 years agoComment about how we print downloads
Alex Crichton [Thu, 13 Sep 2018 02:31:12 +0000 (19:31 -0700)]
Comment about how we print downloads

6 years agoOnly enable downloads through an RAII structure
Alex Crichton [Thu, 13 Sep 2018 02:24:33 +0000 (19:24 -0700)]
Only enable downloads through an RAII structure

This should help us scope downloads to ensure that we only ever have one
download session at once and it's explicitly scoped so we can handle the
progress bar and everything.

6 years agoParallelize downloads with HTTP/2
Alex Crichton [Tue, 11 Sep 2018 00:28:18 +0000 (17:28 -0700)]
Parallelize downloads with HTTP/2

This commit implements parallel downloads using `libcurl` powered by
`libnghttp2` over HTTP/2. Using all of the previous refactorings this actually
implements usage of `Multi` to download crates in parallel. This achieves some
large wins locally, taking download times from 30s to 2s in the best case.

The standard output of Cargo is also changed as a result of this commit. It's
no longer useful for Cargo to print "Downloading ..." for each crate really as
they all start instantaneously. Instead Cargo now no longer prints `Downloading`
by default (unless attached to a pipe) and instead only has one progress bar for
all downloads. Currently this progress bar is discrete and based on the total
number of downloads, no longer specifying how much of one particular download
has happened. This provides a less granular view into what Cargo is doing but
it's hoped that it looks reasonable from an outside perspective as there's
still a progress bar indicating what's happening.

6 years agoRefactor `build_unit_dependencies` for parallel downloads
Alex Crichton [Mon, 10 Sep 2018 23:50:29 +0000 (16:50 -0700)]
Refactor `build_unit_dependencies` for parallel downloads

This commit refactors the `build_unit_dependencies` function for leveraging
parallel downloads. This function is the primary location that crates are
download as part of `cargo build`, which is one of the most critical locations
to take advantage of parallel downloads!

The problem here is somewhat unusal in that we don't want to download the entire
crate graph but rather only the precise slice that we're compiling. This means
that we're letting the calculation of unit dependencies entirely drive the
decision of what crates to download. While we're calculating dependencies,
though, we may need to download more crates!

The strategy implemented here is to attempt to build the unit dependency graph.
Any missing packages are skipped during this construction and enqueued for
download. If any package was enqueued, we throw away the entire graph, wait for
a download to finish, and then attempt to construct the unit graph again.

The hope here is that we'll be able to incrementally make progress and
incrementally add more and more crates to be downloaded in parallel. The worry
is that this is a relatively inefficient strategy as we could reconstruct the
unit dependency graph N times (where you have N total transitive dependencies).
To help alleviate this concern wait for only a small handful of crates to
actively be downloading before we continue to try to recreate the dependency
graph. It's hoped that this will strike a good balance between ensuring we
always have a full pipeline of downloads without re-downloading too much.

6 years agoRename PackageSet::get to `get_one`
Alex Crichton [Mon, 10 Sep 2018 20:44:11 +0000 (13:44 -0700)]
Rename PackageSet::get to `get_one`

This commit removes the old `PackageSet::get` method (used for downloading
crates) to `PackageSet::get_one`. The new method explicitly indicates that only
one package is being fetched. Additionally this commit also adds support for an
API that allows supporting downloading multiple packages in parallel. Existing
callers are all updated to use the parallel API where appropriate except for
`BuildContext`, which will be updated in the next commit.

Also note that no parallel downloads are done yet, they're still synchronously
performed one at a time. A later commit will add support for truly downloading
in parallel.

6 years agoMove downloading crates higher up in Cargo
Alex Crichton [Fri, 7 Sep 2018 22:13:57 +0000 (15:13 -0700)]
Move downloading crates higher up in Cargo

This commit is intended to lay the groundwork for downloading crates in parallel
from crates.io. It starts out by lifting up the download operation from deep
within the `Source` trait to the `PackageSet`. This should allow us to maintain
a queue of downloads specifically in a `PackageSet` and arbitrate access through
that one type, making it easier for us to implement parallel downloads.

The `Source` trait's `download` method may now fail saying "go download this
data", and then the data is fed back into the trait object once it's complete to
actually get the `Package` out.

6 years agoAuto merge of #6048 - ehuss:no-master-ci, r=alexcrichton
bors [Tue, 18 Sep 2018 16:19:38 +0000 (16:19 +0000)]
Auto merge of #6048 - ehuss:no-master-ci, r=alexcrichton

Disable master in CI.

There's no need to build and test the exact same commit twice between
bors's auto branch and master. Hopefully this will help reduce the
bors timeouts due to waiting on appveyor.

6 years agoDisable master in CI.
Eric Huss [Tue, 18 Sep 2018 13:09:27 +0000 (06:09 -0700)]
Disable master in CI.

There's no need to build and test the exact same commit twice between
bors's auto branch and master. Hopefully this will help reduce the
bors timeouts due to waiting on appveyor.

6 years agoAuto merge of #6047 - alexcrichton:bump, r=Mark-Simulacrum
bors [Tue, 18 Sep 2018 06:16:27 +0000 (06:16 +0000)]
Auto merge of #6047 - alexcrichton:bump, r=Mark-Simulacrum

Bump cargo to 0.32.0

It's that time of every-6-weeks!

6 years agoAuto merge of #6046 - soenkehahn:sh/semver-doc-tweak, r=alexcrichton
bors [Tue, 18 Sep 2018 05:28:32 +0000 (05:28 +0000)]
Auto merge of #6046 - soenkehahn:sh/semver-doc-tweak, r=alexcrichton

use more common semver terminology for clarity in docs

`tiny` made me wonder whether that means `patch-level`, `minor` or both. I think `patch-level` is more common semver terminology.

6 years agoAuto merge of #6033 - dwijnand:run-cross-compile-disable-check-asap, r=alexcrichton
bors [Tue, 18 Sep 2018 04:51:12 +0000 (04:51 +0000)]
Auto merge of #6033 - dwijnand:run-cross-compile-disable-check-asap, r=alexcrichton

Run the cross-compile disable check ASAP

Fixes #5141

6 years agoBump cargo to 0.32.0
Alex Crichton [Tue, 18 Sep 2018 01:42:51 +0000 (18:42 -0700)]
Bump cargo to 0.32.0

It's that time of every-6-weeks!

6 years agoAuto merge of #5993 - alexcrichton:publish-renames, r=ehuss
bors [Tue, 18 Sep 2018 01:00:53 +0000 (01:00 +0000)]
Auto merge of #5993 - alexcrichton:publish-renames, r=ehuss

Fix publishing renamed dependencies to crates.io

This commit fixes publishing crates which contain locally renamed dependencies
to crates.io. Previously this lack of information meant that although we could
resolve the crate graph correctly it wouldn't work well with respect to optional
features and optional dependencies. The fix here is to persist this information
into the registry about the crate being renamed in `Cargo.toml`, allowing Cargo
to correctly deduce feature names as it does when it has `Cargo.toml` locally.

A dual side of this commit is to publish this information to crates.io. We'll
want to merge the associated PR (link to come soon) on crates.io first and make
sure that's deployed as well before we stabilize the crate renaming feature.

The index format is updated as well as part of this change. The `name` key for
dependencies is now unconditionally what was written in `Cargo.toml` as the
left-hand-side of the dependency specification. In other words this is the raw
crate name, but only for the local crate. A new key, `package`, is added to
dependencies (and it can be `None`). This key indicates the crates.io package is
being linked against, an represents the `package` key in `Cargo.toml`.

It's important to consider the interaction with older Cargo implementations
which don't support the `package` key in the index. In these situations older
Cargo binaries will likely fail to resolve entirely as the renamed name is
unlikely to exist on crates.io. For example the `futures` crate now has an
optional dependency with the name `futures01` which depends on an older version
of `futures` on crates.io. The string `futures01` will be listed in the index
under the `"name"` key, but no `futures01` crate exists on crates.io so older
Cargo will generate an error. If the crate does exist on crates.io, then even
weirder error messages will likely result.

Closes #5962

6 years agouse more common semver terminology for clarity in docs
Sönke Hahn [Tue, 18 Sep 2018 00:40:18 +0000 (20:40 -0400)]
use more common semver terminology for clarity in docs

6 years agoAuto merge of #6039 - ehuss:fix-all-targets, r=alexcrichton
bors [Tue, 18 Sep 2018 00:14:09 +0000 (00:14 +0000)]
Auto merge of #6039 - ehuss:fix-all-targets, r=alexcrichton

--all-targets fixes

- Fix: `cargo test --all-targets` was running lib tests three times.
- `--all-targets` help strings were wrong or misleading.
- Minor cleanup to add `Proposal` type to maybe make the code more readable.

Closes #5178.

6 years agoAuto merge of #5988 - Eh2406:explore_the_bug, r=alexcrichton
bors [Mon, 17 Sep 2018 22:01:12 +0000 (22:01 +0000)]
Auto merge of #5988 - Eh2406:explore_the_bug, r=alexcrichton

BUG fuzzing found a bug in the resolver, we need a complete set of conflicts to do backjumping

As mentioned in https://github.com/rust-lang/cargo/pull/5921#issuecomment-418890269, the new proptest found a live bug! This PR so far tracs my attempt to minimize the problematic input.

The problem turned out to be that we where backjumping on incomplete set of conflicts.

6 years agobump env_logger to a more minimal-versions compatible one
Eh2406 [Mon, 17 Sep 2018 21:58:38 +0000 (17:58 -0400)]
bump env_logger to a more minimal-versions compatible one

6 years agopull the has bad dep before `prop_flat_map`
Eh2406 [Mon, 17 Sep 2018 17:51:40 +0000 (13:51 -0400)]
pull the has bad dep before `prop_flat_map`

6 years ago--all-targets fixes
Eric Huss [Mon, 17 Sep 2018 02:41:57 +0000 (19:41 -0700)]
--all-targets fixes

- Fix: `cargo test --all-targets` was running lib tests three times.
- `--all-targets` help strings were wrong or misleading.
- Minor cleanup to add `Proposal` type to maybe make the code more readable.

6 years agogive intermediate steps names
Eh2406 [Mon, 17 Sep 2018 02:41:15 +0000 (22:41 -0400)]
give intermediate steps names

6 years agoAuto merge of #6037 - dwijnand:stop-test--doc-from-accepting-other-target-options...
bors [Mon, 17 Sep 2018 02:16:46 +0000 (02:16 +0000)]
Auto merge of #6037 - dwijnand:stop-test--doc-from-accepting-other-target-options, r=alexcrichton

Stop test --doc from silently ignoring other target selecting options

Fixes #5054

6 years agoAuto merge of #6038 - ehuss:bashcomp, r=alexcrichton
bors [Mon, 17 Sep 2018 01:38:13 +0000 (01:38 +0000)]
Auto merge of #6038 - ehuss:bashcomp, r=alexcrichton

Minor updates to bash completion

- Fix bash completion on mac.
- Support arbitrary toolchain names.

6 years agoBash completion: support arbitrary toolchain names.
Eric Huss [Sun, 16 Sep 2018 23:59:42 +0000 (16:59 -0700)]
Bash completion: support arbitrary toolchain names.

6 years agoFix bash completion on mac.
Eric Huss [Sun, 16 Sep 2018 23:50:19 +0000 (16:50 -0700)]
Fix bash completion on mac.

For some bizarro reason, mac's bash doesn't like negative indexes,
even though its version of bash should support it.

6 years agoStop test --doc from silently ignoring other target selecting options
Dale Wijnand [Sun, 16 Sep 2018 20:33:32 +0000 (21:33 +0100)]
Stop test --doc from silently ignoring other target selecting options

6 years agoAuto merge of #6036 - dwijnand:link-stale-bot-to-tracking-issue, r=alexcrichton
bors [Sun, 16 Sep 2018 20:15:56 +0000 (20:15 +0000)]
Auto merge of #6036 - dwijnand:link-stale-bot-to-tracking-issue, r=alexcrichton

Link stale bot to its tracking issue

Refs #6035

6 years agotypo
Dale Wijnand [Sun, 16 Sep 2018 20:04:15 +0000 (21:04 +0100)]
typo

6 years agoLink stale bot to its tracking issue
Dale Wijnand [Sun, 16 Sep 2018 19:44:44 +0000 (20:44 +0100)]
Link stale bot to its tracking issue

6 years agoRun the cross-compile disable check ASAP
Dale Wijnand [Sun, 16 Sep 2018 09:07:24 +0000 (10:07 +0100)]
Run the cross-compile disable check ASAP

6 years agoAuto merge of #6030 - dwijnand:tweak-stale-bot-message, r=alexcrichton
bors [Sat, 15 Sep 2018 18:32:35 +0000 (18:32 +0000)]
Auto merge of #6030 - dwijnand:tweak-stale-bot-message, r=alexcrichton

Add newline spacing to stale bot's message

So our first incantation produced:

https://github.com/rust-lang/cargo/issues/4866#issuecomment-421597598

Perhaps there's a better indicator to use, but for now let's just fix
this with more newlines.

r? @alexcrichton

6 years agoTwo newlines will do
Dale Wijnand [Sat, 15 Sep 2018 17:44:20 +0000 (18:44 +0100)]
Two newlines will do

6 years agoUse indentation, it's Super Effective!
Dale Wijnand [Sat, 15 Sep 2018 17:43:18 +0000 (18:43 +0100)]
Use indentation, it's Super Effective!

6 years agoI think "6 months" reads better than "180 days"
Dale Wijnand [Sat, 15 Sep 2018 17:28:34 +0000 (18:28 +0100)]
I think "6 months" reads better than "180 days"

6 years agoGrammar
Dale Wijnand [Sat, 15 Sep 2018 17:26:53 +0000 (18:26 +0100)]
Grammar

6 years agoAdd newline spacing to stale bot's message
Dale Wijnand [Sat, 15 Sep 2018 17:20:40 +0000 (18:20 +0100)]
Add newline spacing to stale bot's message

So our first incantation produced:

https://github.com/rust-lang/cargo/issues/4866#issuecomment-421597598

Perhaps there's a better indicator to use, but for now let's just fix
this with more newlines.

r? @alexcrichton

6 years agoAuto merge of #6004 - zachlute:fix-ctrlc-handling2, r=alexcrichton
bors [Sat, 15 Sep 2018 16:18:14 +0000 (16:18 +0000)]
Auto merge of #6004 - zachlute:fix-ctrlc-handling2, r=alexcrichton

Add empty ctrlc handler on Windows.

Fixes #6000.

This is a 'better' version of PR #6002 that accomplishes the same thing using only `winapi` calls without the dependency on the `ctrlc` crate or spawning an additional thread.

----

When exec_replacing the cargo process, we want the new process to get any signals. This already works fine on Unix.

On Windows, pressing ctrlc kills the cargo process and doesn't pass the signal on to the child process. By adding an empty handler, we allow the child process to handle the signal instead.

6 years agoAuto merge of #6027 - GuillaumeGomez:remove-error-code-check, r=alexcrichton
bors [Fri, 14 Sep 2018 23:32:07 +0000 (23:32 +0000)]
Auto merge of #6027 - GuillaumeGomez:remove-error-code-check, r=alexcrichton

Remove error code check in doc test

Needed by https://github.com/rust-lang/rust/pull/53933

cc @alexcrichton

6 years agoAuto merge of #6020 - dwijnand:stale-bot, r=alexcrichton
bors [Fri, 14 Sep 2018 22:15:50 +0000 (22:15 +0000)]
Auto merge of #6020 - dwijnand:stale-bot, r=alexcrichton

Setup Stale Probot

r?  @alexcrichton
/cc @Eh2406

6 years agocargo fmt
Eh2406 [Fri, 14 Sep 2018 21:39:05 +0000 (17:39 -0400)]
cargo fmt

6 years agoonly skip in the `backtrack_stack` if the `conflicting_activations` is complete
Eh2406 [Fri, 14 Sep 2018 21:23:46 +0000 (17:23 -0400)]
only skip in the `backtrack_stack` if the `conflicting_activations` is complete