]> git.proxmox.com Git - cargo.git/log
cargo.git
6 years agoAuto merge of #4781 - alexcrichton:beta-next, r=alexcrichton
bors [Tue, 5 Dec 2017 17:05:29 +0000 (17:05 +0000)]
Auto merge of #4781 - alexcrichton:beta-next, r=alexcrichton

[beta] Reconfigure curl handles after reset

This is a backport of https://github.com/rust-lang/cargo/pull/4780

6 years agoFix the lockfile-compat test
Alex Crichton [Wed, 29 Nov 2017 01:44:25 +0000 (17:44 -0800)]
Fix the lockfile-compat test

The newest version of `tar` tweaks the checksum here slightly as the tarball is
slightly different, so this just updates the test to pull the checksum from the
publication rather than hardcoding it.

6 years agoReconfigure curl handles after reset
Alex Crichton [Tue, 5 Dec 2017 15:27:04 +0000 (07:27 -0800)]
Reconfigure curl handles after reset

This'll ensure that all our proxy/speed data/etc will be preserved in the
libcurl configuration

Closes #4779

6 years agoAuto merge of #4568 - Metaswitch:alt-registry-publish, r=withoutboats
bors [Sat, 18 Nov 2017 00:03:28 +0000 (00:03 +0000)]
Auto merge of #4568 - Metaswitch:alt-registry-publish, r=withoutboats

Add support for publish to optionally take the index that can be used

This form part of alternative-registries RFC-2141, it allows crates to optionally specify which registries the crate can be be published to.

@carols10cents, one thing that I am unsure about is if there is a plan for publish to still provide index, or for registry to be provided instead. I thought that your general view was that we should move away from the index file. If we do need to map allowed registries to the index then there will be a small amount of extra work required once #4506 is merged.

@withoutboats, happy for this to be merged into your branch if you want, the main reason I did not base it on your branch was due to tests not working on there yet.

6 years agoAuto merge of #4714 - Mark-Simulacrum:frozen-freezes, r=alexcrichton
bors [Sun, 12 Nov 2017 19:13:19 +0000 (19:13 +0000)]
Auto merge of #4714 - Mark-Simulacrum:frozen-freezes, r=alexcrichton

Do not update semantically equivalent lockfiles with --frozen/--locked.

A previous patch in #4684 attempted to fix this, but didn't work for the
case where the [root] crate wasn't the first crate in the sorted package
array.

cc @matklad -- fixes a problem noted in https://github.com/rust-lang/cargo/pull/4684#discussion_r147824900 which appears to have gone unfixed

r? @alexcrichton

Beta backport will be posted as soon as this is reviewed. Merges cleanly.

6 years agoDo not update semantically equivalent lockfiles with --frozen/--locked.
Mark Simulacrum [Sun, 12 Nov 2017 17:57:05 +0000 (10:57 -0700)]
Do not update semantically equivalent lockfiles with --frozen/--locked.

A previous patch in #4684 attempted to fix this, but didn't work for the
case where the [root] crate wasn't the first crate in the sorted package
array.

6 years agoAuto merge of #4713 - alexcrichton:fix-bsd, r=matklad
bors [Sun, 12 Nov 2017 18:23:21 +0000 (18:23 +0000)]
Auto merge of #4713 - alexcrichton:fix-bsd, r=matklad

Fix compilation on more platforms

6 years agoAuto merge of #4711 - alexcrichton:fix-dep-info, r=matklad
bors [Sun, 12 Nov 2017 17:56:05 +0000 (17:56 +0000)]
Auto merge of #4711 - alexcrichton:fix-dep-info, r=matklad

Fix dep info showing up with a build script

Cargo would erroneously bail out early and accidentally forget to emit a
dep info file if any dependency used a build script, so this fixes that!

6 years agoAuto merge of #4673 - pornel:bins, r=alexcrichton
bors [Sun, 12 Nov 2017 10:43:15 +0000 (10:43 +0000)]
Auto merge of #4673 - pornel:bins, r=alexcrichton

List available binary names

When a project has multiple executables `cargo run` fails, but offers an incomplete solution (suggests `--bin`, but not its arguments.)

This PR adds a list of available binary names to the error message.

6 years agoFix dep info showing up with a build script
Alex Crichton [Sat, 11 Nov 2017 15:10:42 +0000 (07:10 -0800)]
Fix dep info showing up with a build script

Cargo would erroneously bail out early and accidentally forget to emit a
dep info file if any dependency used a build script, so this fixes that!

6 years agoFix compilation on more platforms
Alex Crichton [Sun, 12 Nov 2017 10:25:06 +0000 (02:25 -0800)]
Fix compilation on more platforms

6 years agoAuto merge of #4710 - steveklabnik:fix-broken-links, r=Mark-Simulacrum
bors [Sat, 11 Nov 2017 03:02:03 +0000 (03:02 +0000)]
Auto merge of #4710 - steveklabnik:fix-broken-links, r=Mark-Simulacrum

Fix broken links in cargo book

Needed to address failures in https://github.com/rust-lang/rust/pull/45692

6 years agoFix broken links in cargo book
steveklabnik [Fri, 10 Nov 2017 16:14:05 +0000 (11:14 -0500)]
Fix broken links in cargo book

6 years agoAuto merge of #4705 - Metaswitch:fix-yank-help, r=matklad
bors [Thu, 9 Nov 2017 07:39:03 +0000 (07:39 +0000)]
Auto merge of #4705 - Metaswitch:fix-yank-help, r=matklad

Stop yank -h from panicking on nightly

Increase the gap between the registry option and the description so that the help is parsed correctly. I have also checked the code for the other binaries to ensure that they don't suffer from the same issue.

This fixes #4703.

6 years agoFix yank help.
Chris Swindle [Thu, 9 Nov 2017 06:00:28 +0000 (06:00 +0000)]
Fix yank help.

6 years agoCode review markups.
Chris Swindle [Wed, 8 Nov 2017 05:42:48 +0000 (05:42 +0000)]
Code review markups.

6 years agoAuto merge of #4702 - mathstuf:update-lockfile-switch-colors, r=alexcrichton
bors [Tue, 7 Nov 2017 20:46:45 +0000 (20:46 +0000)]
Auto merge of #4702 - mathstuf:update-lockfile-switch-colors, r=alexcrichton

cargo_generate_lockfile: flip Updating and Adding colors

Updating is green elsewhere and is more common as well.

---
Cc: @alexcrichton
6 years agocargo_generate_lockfile: flip Updating and Adding colors
Ben Boeckel [Tue, 7 Nov 2017 20:41:05 +0000 (15:41 -0500)]
cargo_generate_lockfile: flip Updating and Adding colors

Updating is green elsewhere and is more common as well.

6 years agoAuto merge of #4701 - mathstuf:update-lockfile-color-reflects-change, r=alexcrichton
bors [Tue, 7 Nov 2017 18:12:25 +0000 (18:12 +0000)]
Auto merge of #4701 - mathstuf:update-lockfile-color-reflects-change, r=alexcrichton

cargo_generate_lockfile: use color to also indicate the change

In English, `Updating` and `Removing` are the same length and scanning
the list for changes is hard. Use color to help indicate the kind of
change that is occurring.

6 years agocargo_generate_lockfile: use color to also indicate the change
Ben Boeckel [Tue, 7 Nov 2017 16:56:38 +0000 (11:56 -0500)]
cargo_generate_lockfile: use color to also indicate the change

In English, `Updating` and `Removing` are the same length and scanning
the list for changes is hard. Use color to help indicate the kind of
change that is occurring.

6 years agoSort out bug with updating registry on a clean build.
Chris Swindle [Mon, 6 Nov 2017 21:08:22 +0000 (21:08 +0000)]
Sort out bug with updating registry on a clean build.

6 years agoCode review markups.
Chris Swindle [Mon, 6 Nov 2017 20:37:40 +0000 (20:37 +0000)]
Code review markups.

6 years agoAuto merge of #4646 - alexcrichton:progress, r=matklad
bors [Mon, 6 Nov 2017 18:35:46 +0000 (18:35 +0000)]
Auto merge of #4646 - alexcrichton:progress, r=matklad

Add a number of progress indicators to Cargo

This commit is an attempt to stem the tide of "cargo is stuck updating the
registry" issues by giving a better indication as to what's happening in
long-running steps. The primary addition here is a `Progress` helper module
which prints and manages a progress bar for long-running operations like git
fetches, git checkouts, HTTP downloads, etc.

The second addition here is to print out when we've been stuck in resolve for
some time. We never really have a progress indicator for crate graph resolution
nor do we know when we're done updating sources. Instead we make a naive
assumption that when you've spent 0.5s in the resolution loop itself (not
updating deps) you're probably done updating dependencies and on to acutal
resolution. This will print out `Resolving crate graph...` and help inform that
Cargo is indeed not stuck looking at the registry, but rather it's churning away
in resolution.

**Downloading all Servo's dependencies**

[![asciicast](https://asciinema.org/a/JX9yQZtyFo5ED0Pwg45barBco.png)](https://asciinema.org/a/JX9yQZtyFo5ED0Pwg45barBco)

**Long running resolution**

[![asciicast](https://asciinema.org/a/p7xAkSVeMlkyvgcI6Gx7DZjAV.png)](https://asciinema.org/a/p7xAkSVeMlkyvgcI6Gx7DZjAV)

6 years agoAdd a number of progress indicators to Cargo
Alex Crichton [Mon, 16 Oct 2017 14:57:38 +0000 (07:57 -0700)]
Add a number of progress indicators to Cargo

This commit is an attempt to stem the tide of "cargo is stuck updating the
registry" issues by giving a better indication as to what's happening in
long-running steps. The primary addition here is a `Progress` helper module
which prints and manages a progress bar for long-running operations like git
fetches, git checkouts, HTTP downloads, etc.

The second addition here is to print out when we've been stuck in resolve for
some time. We never really have a progress indicator for crate graph resolution
nor do we know when we're done updating sources. Instead we make a naive
assumption that when you've spent 0.5s in the resolution loop itself (not
updating deps) you're probably done updating dependencies and on to acutal
resolution. This will print out `Resolving crate graph...` and help inform that
Cargo is indeed not stuck looking at the registry, but rather it's churning away
in resolution.

6 years agoAuto merge of #4695 - behnam:doc-book, r=alexcrichton
bors [Sat, 4 Nov 2017 14:47:48 +0000 (14:47 +0000)]
Auto merge of #4695 - behnam:doc-book, r=alexcrichton

[doc/book] Change title to The Cargo Book

Also add "community’s" to description of crates.io, as Cargo now
supports multiple registries.

6 years agoAuto merge of #4696 - paulkernfeld:master, r=matklad
bors [Fri, 3 Nov 2017 05:27:45 +0000 (05:27 +0000)]
Auto merge of #4696 - paulkernfeld:master, r=matklad

Note that token can be read from stdin

6 years agoNote that token can be read from stdin
Paul Kernfeld [Thu, 2 Nov 2017 21:52:00 +0000 (17:52 -0400)]
Note that token can be read from stdin

6 years ago[doc/book] Change title to The Cargo Book
Behnam Esfahbod [Thu, 2 Nov 2017 17:54:36 +0000 (10:54 -0700)]
[doc/book] Change title to The Cargo Book

Also add "community’s" to description of crates.io, as Cargo now
supports multiple registries.

6 years agoUse the correct interface for creating an alternative registry source id.
Chris Swindle [Wed, 1 Nov 2017 22:28:28 +0000 (22:28 +0000)]
Use the correct interface for creating an alternative registry source id.

6 years agoInclude registry in dependencies in the index.
Chris Swindle [Wed, 1 Nov 2017 22:14:33 +0000 (22:14 +0000)]
Include registry in dependencies in the index.

6 years agoMerge remote-tracking branch 'upstream/master' into alt-registry-publish-wip
Chris Swindle [Wed, 1 Nov 2017 19:55:47 +0000 (19:55 +0000)]
Merge remote-tracking branch 'upstream/master' into alt-registry-publish-wip

6 years agoAuto merge of #4680 - Metaswitch:registry-login, r=alexcrichton
bors [Wed, 1 Nov 2017 15:24:12 +0000 (15:24 +0000)]
Auto merge of #4680 - Metaswitch:registry-login, r=alexcrichton

Support login tokens for multiple registries

This pull request builds on #4206 to support login using the the registry from alternate registries (RFC 2141). This includes the following changes:

 - allow credentials to be stored based on the registry
 - allow passing the registry to run cargo commands against using --registry

Note that this does not include a feature gate on the use of --registry as the publish code blocks publish if we use any features. @alexcrichton, are you happy with this approach, or is there a way that you would recommend this should be relaxed for testing purposes?

6 years agoAuto merge of #4692 - nossralf:add-rustfmt-config, r=matklad
bors [Tue, 31 Oct 2017 22:13:57 +0000 (22:13 +0000)]
Auto merge of #4692 - nossralf:add-rustfmt-config, r=matklad

Add rustfmt.toml with formatting disabled

Currently, Cargo does not use rustfmt for its source code. By adding a rustfmt.toml that simply disables all formatting rules, editors which use rustfmt by default for all Rust code will do the right thing and leave the source code unchanged,.

This makes life a little bit easier for developers who no longer need to explicitly disable automatic rustfmt formatting when working on Cargo to avoid code unrelated to a change being reformatted.

6 years agoAdd verification that an crate has been published to the correct location.
Chris Swindle [Tue, 31 Oct 2017 22:11:02 +0000 (22:11 +0000)]
Add verification that an crate has been published to the correct location.

6 years agoAuto merge of #4691 - nbianca:patch-1, r=alexcrichton
bors [Tue, 31 Oct 2017 21:45:57 +0000 (21:45 +0000)]
Auto merge of #4691 - nbianca:patch-1, r=alexcrichton

Improved README.

Made some miscellaneous improvements.

6 years agoAdd rustfmt.toml with formatting disabled
Fredrik Larsson [Tue, 31 Oct 2017 21:31:02 +0000 (22:31 +0100)]
Add rustfmt.toml with formatting disabled

Currently, Cargo does not use rustfmt for its source code. By adding a
rustfmt.toml that simply disables all formatting rules, editors which
use rustfmt by default for all Rust code will do the right thing and
leave the source code unchanged.

6 years agoImproved README.
Bianca Nenciu [Tue, 31 Oct 2017 20:37:45 +0000 (22:37 +0200)]
Improved README.

6 years agoAlternative list display
Kornel [Tue, 31 Oct 2017 17:45:57 +0000 (17:45 +0000)]
Alternative list display

6 years agoList available binary names
Kornel [Sat, 28 Oct 2017 22:03:15 +0000 (23:03 +0100)]
List available binary names

6 years agoAuto merge of #4683 - djc:requirements, r=alexcrichton
bors [Tue, 31 Oct 2017 16:49:55 +0000 (16:49 +0000)]
Auto merge of #4683 - djc:requirements, r=alexcrichton

Introduce Requirements struct to clarify code

`cargo::core::resolver::build_requirements()` previously, in this order:

* Defined local variables to track state
* Called a function to mutate the local variables
* Defined the aforementioned function
* Returned two out of three local variables as a tuple

This PR changes the code so that this is a recast as a struct (appropriately called `Requirements`), which is mutated in a more fine-grained way by its methods and acts as the return type for `build_requirements()`. To me, this seems a lot easier to understand.

This work was done in the context of #1286, but I figured it was easier to start landing some of the refactoring to avoid bitrot and get early (well, earlier) feedback.

6 years agoSort out remaining file permissions.
Chris Swindle [Tue, 31 Oct 2017 16:39:56 +0000 (16:39 +0000)]
Sort out remaining file permissions.

6 years agoUpdated tests based on review comments.
Chris Swindle [Tue, 31 Oct 2017 16:00:21 +0000 (16:00 +0000)]
Updated tests based on review comments.

6 years agoAuto merge of #4684 - matklad:lazy-update, r=alexcrichton
bors [Tue, 31 Oct 2017 14:14:46 +0000 (14:14 +0000)]
Auto merge of #4684 - matklad:lazy-update, r=alexcrichton

Don't update lockfiles from previous Cargo versions if `--locked` is passed

Recently, we've stopped outputting `[root]` section to Cargo.lock files. The problem with this is that somebody might want to have a Cargo.lock file with a `[root]` section for compatibility with older Cargos, but at the same time use newer Cargo to build the crate. In this case, newer Cargo would remove `[root]` from the lockfile. Such updating of the lockfiles to the latest versions is a reasonable behavior, but it might be useful to be able to override it with `--locked` flag.

Context: https://github.com/rust-lang/cargo/issues/4563#issuecomment-340238773

r? @alexcrichton

6 years agoAdd feature gate on publish field changes.
Chris Swindle [Tue, 31 Oct 2017 09:51:37 +0000 (09:51 +0000)]
Add feature gate on publish field changes.

6 years agoDon't update lockfiles from previous Cargo versions if `--locked` is passed
Aleksey Kladov [Mon, 30 Oct 2017 19:56:46 +0000 (22:56 +0300)]
Don't update lockfiles from previous Cargo versions if `--locked` is passed

6 years agoSwitch over to use --registry for publish list.
Chris Swindle [Tue, 31 Oct 2017 06:28:09 +0000 (06:28 +0000)]
Switch over to use --registry for publish list.

6 years agoMerge branch 'registry-login' into alt-registry-publish-wip
Chris Swindle [Tue, 31 Oct 2017 05:26:42 +0000 (05:26 +0000)]
Merge branch 'registry-login' into alt-registry-publish-wip

6 years agoSwitching over to get-string for registry credentials.
Chris Swindle [Tue, 31 Oct 2017 05:20:41 +0000 (05:20 +0000)]
Switching over to get-string for registry credentials.

6 years agoAuto merge of #4676 - mgeisler:ci-caching, r=alexcrichton
bors [Tue, 31 Oct 2017 00:48:46 +0000 (00:48 +0000)]
Auto merge of #4676 - mgeisler:ci-caching, r=alexcrichton

Explain why caching is only done on $HOME/.cargo/bin/ in Travis

After having experimented with the Travis and AppVeyor caches, I concluded that they don't really help here: they're large and take a very long time to both download when the build starts and upload after it is finished.

6 years agoExplain why we are not using 'cache: cargo' with Travis
Martin Geisler [Mon, 30 Oct 2017 22:29:28 +0000 (23:29 +0100)]
Explain why we are not using 'cache: cargo' with Travis

6 years agoAuto merge of #4685 - ehuss:all-targets-no-lib, r=alexcrichton
bors [Mon, 30 Oct 2017 21:48:18 +0000 (21:48 +0000)]
Auto merge of #4685 - ehuss:all-targets-no-lib, r=alexcrichton

Fix --all-targets in a crate without a lib.

Fixes #4615.

6 years agoFix --all-targets in a crate without a lib.
Eric Huss [Mon, 30 Oct 2017 21:42:47 +0000 (14:42 -0700)]
Fix --all-targets in a crate without a lib.

Fixes #4615.

6 years agoUpdating based on review comments.
Chris Swindle [Mon, 30 Oct 2017 21:25:24 +0000 (21:25 +0000)]
Updating based on review comments.

6 years agoAdding unstable-options flag to feature gate the use of --registry option.
Chris Swindle [Mon, 30 Oct 2017 20:56:23 +0000 (20:56 +0000)]
Adding unstable-options flag to feature gate the use of --registry option.

6 years agoAuto merge of #4561 - nossralf:uninstall-many, r=matklad
bors [Mon, 30 Oct 2017 19:58:01 +0000 (19:58 +0000)]
Auto merge of #4561 - nossralf:uninstall-many, r=matklad

Support uninstallation of multiple packages

This is a WIP pull request with support for uninstalling multiple packages. It mirrors the logic used for `cargo install`.

Fixes #4560

6 years agoUse specific methods to add requirements
Dirkjan Ochtman [Wed, 4 Oct 2017 18:26:30 +0000 (20:26 +0200)]
Use specific methods to add requirements

6 years agoMove logic for walking over dependent features around
Dirkjan Ochtman [Wed, 4 Oct 2017 18:24:51 +0000 (20:24 +0200)]
Move logic for walking over dependent features around

6 years agoMove shared logic into separated methods
Dirkjan Ochtman [Mon, 2 Oct 2017 16:06:32 +0000 (18:06 +0200)]
Move shared logic into separated methods

6 years agoExtract method for handling feature requirements
Dirkjan Ochtman [Mon, 2 Oct 2017 16:04:28 +0000 (18:04 +0200)]
Extract method for handling feature requirements

6 years agoExtract method for recording a requested dependency
Dirkjan Ochtman [Mon, 2 Oct 2017 15:59:41 +0000 (17:59 +0200)]
Extract method for recording a requested dependency

6 years agoExtract function to record if a feature was seen before
Dirkjan Ochtman [Mon, 2 Oct 2017 15:57:24 +0000 (17:57 +0200)]
Extract function to record if a feature was seen before

6 years agoExtract method for requiring crate features
Dirkjan Ochtman [Mon, 2 Oct 2017 15:54:35 +0000 (17:54 +0200)]
Extract method for requiring crate features

6 years agoMove resolution requirement state into a separate struct
Dirkjan Ochtman [Mon, 2 Oct 2017 15:16:13 +0000 (17:16 +0200)]
Move resolution requirement state into a separate struct

6 years agoAuto merge of #4607 - sunjay:patcherror, r=alexcrichton
bors [Mon, 30 Oct 2017 18:09:49 +0000 (18:09 +0000)]
Auto merge of #4607 - sunjay:patcherror, r=alexcrichton

Improving the error message for when a patched dependency does not resolve to anything

Hi,
I just spent a long time debugging what this error message means and so I thought I would try to help improve it. Could someone who knows the codebase well look at this and see if this error message even makes sense here. I know this is the information I would have needed, but the error may occur in other cases where this message doesn't make sense. I'm open to any suggestions that would help make it more clear and maybe point people to where they should look for more information.

The specific problem that I ran into occurred when I was trying to upgrade the `rustfmt` submodule in the rust codebase. The `rustfmt-nightly` dependency changed version numbers and this conflicted with what was in the `Cargo.lock` file. After some detective work I was able to find the [documentation on `[patch]`](http://doc.crates.io/manifest.html#the-patch-section) which I had never read before and the following relevant paragraphs from [some other documentation](http://doc.crates.io/specifying-dependencies.html#testing-a-bugfix):

> Next up we need to ensure that our lock file is updated to use this new version of uuid so our project uses the locally checked out copy instead of one from crates.io. The way [patch] works is that it'll load the dependency at ../path/to/uuid and then whenever crates.io is queried for versions of uuid it'll also return the local version.
>
> This means that the version number of the local checkout is significant and will affect whether the patch is used. Our manifest declared uuid = "1.0" which means we'll only resolve to >= 1.0.0, < 2.0.0, and Cargo's greedy resolution algorithm also means that we'll resolve to the maximum version within that range. Typically this doesn't matter as the version of the git repository will already be greater or match the maximum version published on crates.io, but it's important to keep this in mind!

If it was not for the person who wrote those docs, I would not have known what to do here!

6 years agoNew error message with issue link
Sunjay Varma [Mon, 30 Oct 2017 17:18:55 +0000 (13:18 -0400)]
New error message with issue link

6 years agoImproving the error message for when a patched dependency does not resolve to anything
Sunjay Varma [Tue, 10 Oct 2017 19:51:59 +0000 (15:51 -0400)]
Improving the error message for when a patched dependency does not resolve to anything

6 years agoAuto merge of #4592 - ehuss:check_test, r=alexcrichton
bors [Mon, 30 Oct 2017 16:50:15 +0000 (16:50 +0000)]
Auto merge of #4592 - ehuss:check_test, r=alexcrichton

Add unit test checking to `cargo check`

This is an extension of PR #4039, fixing #3431, #4003, #4059, #4330.  The fixes for #4059 can potentially be separated into a separate PR, though there may be some overlap.

The general gist of the changes:

- Add `--profile test` flag to `cargo check` that will enable checking of unit tests.
- `--tests` will implicitly enable checking of unit tests within the lib (checks the same targets as `cargo test`).  This affects the `check`, `test`, and `build` commands.
- `--benches` behaves similarly by using the same targets as `cargo bench`.
- Fix erroneously linking tests when run with `--test`.

There is one thing I did not do because I wanted more feedback on what others think the expected behavior should be.  What should the behavior of `--all-targets` be?  This patch does not (yet) make any changes to its behavior.  My initial thinking is that it should *add* a target of `--lib --bins --profile test`, but that essentially means the lib and bin targets will be checked twice (and thus any errors/warnings outside of `#[cfg(test)]` will appear twice, which may be confusing, and generally take twice as long to run).  I can add that, but I think it would require adding a new `All` variant to `CompileFilter` so that the code in `generate_targets` can detect this scenario.  I wanted feedback before making a more extensive change like that.  The downside of not adding it is that `--all-targets` will ignore unit tests (if you don't specify `--profile test`).

Summary of the profiles used with this patch:

Command                         | Lib               | Bin foo     | Test t1 | Example e1 | Bench b1 |
-------                         | ---               | -------     | ------- | ---------- | -------- |
`check`                         | check             | check       | -       | -          | -        |
`check --profile test`          | check_test†       | check_test† | -       | -          | -        |
`check --lib`                   | check             | -           | -       | -          | -        |
`check --lib --profile test`    | check_test†       | -           | -       | -          | -        |
`check --bin foo`               | check             | check       | -       | -          | -        |
`check -–bin foo –profile test` | check_test†       | check_test† | -       | -          | -        |
`check --bins`                  | check             | check       | -       | -          | -        |
`check --test t1`               | check             | check       | check_test   | -          | -        |
`check --tests`                 | check, check_test†  | check, check_test† | check_test | check†, check_test†  | -    |
`check --all-targets`           | check, check_test†  | check, check_test†  | check_test   | check, check_test† | check_test    |

† = different behavior from today

6 years agoAuto merge of #4675 - mgeisler:align-cmdline-examples, r=alexcrichton
bors [Mon, 30 Oct 2017 15:51:43 +0000 (15:51 +0000)]
Auto merge of #4675 - mgeisler:align-cmdline-examples, r=alexcrichton

Align command line examples in "cargo help test"

The initial example used an indentation of four spaces, the other
examples used only two spaces. They now all use four spaces.

I checked all other Cargo commands and found no other such problems.

6 years agoAuto merge of #4677 - integer32llc:unpin-nightly, r=alexcrichton
bors [Mon, 30 Oct 2017 15:15:33 +0000 (15:15 +0000)]
Auto merge of #4677 - integer32llc:unpin-nightly, r=alexcrichton

Revert "Auto merge of #4659 - integer32llc:pin-nightly, r=alexcrichton"

This reverts commit 55442e8922ae7ad51545576a4f1326ab131a333a, reversing
changes made to 92a3a4efa27900e97a8ccb3c5c9b45f06f439454.

Testing to see if there is a fix on the latest nightly as rumored here: https://github.com/rust-lang/rust/issues/45500#issuecomment-340431032

6 years agoRevert "Auto merge of #4659 - integer32llc:pin-nightly, r=alexcrichton"
Carol (Nichols || Goulding) [Mon, 30 Oct 2017 15:10:29 +0000 (11:10 -0400)]
Revert "Auto merge of #4659 - integer32llc:pin-nightly, r=alexcrichton"

This reverts commit 55442e8922ae7ad51545576a4f1326ab131a333a, reversing
changes made to 92a3a4efa27900e97a8ccb3c5c9b45f06f439454.

6 years agoAdding support to provide login credentials for an alternate registry.
Chris Swindle [Mon, 30 Oct 2017 14:29:37 +0000 (14:29 +0000)]
Adding support to provide login credentials for an alternate registry.

6 years agoAuto merge of #4672 - kennytm:fix-4671, r=alexcrichton
bors [Sun, 29 Oct 2017 16:39:30 +0000 (16:39 +0000)]
Auto merge of #4672 - kennytm:fix-4671, r=alexcrichton

When uplifting directories, symlink them instead of hard-link them.

Fixes #4671.

6 years agoAlign command line examples in "cargo help test"
Martin Geisler [Sun, 29 Oct 2017 12:21:53 +0000 (13:21 +0100)]
Align command line examples in "cargo help test"

The initial example used an indentation of four spaces, the other
examples used only two spaces. They now all use four spaces.

I checked all other Cargo commands and found no other such problems.

6 years agoWhen uplifting directories, symlink them instead of hard-link them.
kennytm [Sat, 28 Oct 2017 19:47:29 +0000 (03:47 +0800)]
When uplifting directories, symlink them instead of hard-link them.

Fixes #4671.

6 years agoTest partially successful uninstallation
Fredrik Larsson [Sat, 28 Oct 2017 14:36:49 +0000 (16:36 +0200)]
Test partially successful uninstallation

6 years agoTest bailout when specifying --bin during uninstall of multiple packages
Fredrik Larsson [Wed, 11 Oct 2017 19:35:30 +0000 (21:35 +0200)]
Test bailout when specifying --bin during uninstall of multiple packages

6 years agoUse multiple install command in the corresponding test
Fredrik Larsson [Wed, 11 Oct 2017 19:34:44 +0000 (21:34 +0200)]
Use multiple install command in the corresponding test

6 years agoBailout if --bin is specified when uninstalling multiple packages
Fredrik Larsson [Wed, 11 Oct 2017 18:43:29 +0000 (20:43 +0200)]
Bailout if --bin is specified when uninstalling multiple packages

6 years agoMake it possible to uninstall multiple packages
Fredrik Larsson [Sun, 10 Sep 2017 18:41:12 +0000 (20:41 +0200)]
Make it possible to uninstall multiple packages

6 years agoAuto merge of #4665 - lukaslueg:issue4327, r=matklad
bors [Fri, 27 Oct 2017 14:02:41 +0000 (14:02 +0000)]
Auto merge of #4665 - lukaslueg:issue4327, r=matklad

Discover vcs in new-cmd only if --vcs not set

If a commandline-argument is given, it takes precedence
over the config and existing vcs. Avoid trying to discover
existing repositories in that case, saving use from
shelling out to `hg`. Fixes #4327

6 years agoDiscover vcs in new-cmd only if --vcs not set
Lukas Lueg [Fri, 27 Oct 2017 13:00:23 +0000 (15:00 +0200)]
Discover vcs in new-cmd only if --vcs not set

If a commandline-argument is given, it takes precedence
over the config and existing vcs. Avoid trying to discover
existing repositories in that case, saving use from
shelling out to `hg`. Fixes #4327

6 years agoMerge branch 'credentials-hosts' of github.com:dethoter/cargo into registry-login
Chris Swindle [Thu, 26 Oct 2017 13:54:13 +0000 (14:54 +0100)]
Merge branch 'credentials-hosts' of github.com:dethoter/cargo into registry-login

Conflicts:
src/bin/login.rs
src/cargo/ops/registry.rs
tests/login.rs
tests/publish.rs

6 years agoAuto merge of #4650 - main--:patch-1, r=matklad
bors [Thu, 26 Oct 2017 10:44:49 +0000 (10:44 +0000)]
Auto merge of #4650 - main--:patch-1, r=matklad

Document that cargo test --release uses profile.bench

It certainly makes sense but it's still surprising behavior when the docs clearly state `cargo bench` = `profile.bench`, `cargo test` = `profile.test`. Had to dive into the code to figure this out.

6 years agoDocument that cargo test --release uses profile.bench
main() [Thu, 26 Oct 2017 10:19:31 +0000 (12:19 +0200)]
Document that cargo test --release uses profile.bench

6 years agoAuto merge of #4634 - kivikakk:cargo-env-prevails, r=matklad
bors [Thu, 26 Oct 2017 07:35:44 +0000 (07:35 +0000)]
Auto merge of #4634 - kivikakk:cargo-env-prevails, r=matklad

Use argv[0] for cargo_exe so we don't rely on /proc on Linux

This is a proposed solution to #4450. I'm not at all wedded to the idea or the code, though, so feel free to shoot it down with abandon if this isn't something that'd work out or that you like.

In short, we use the existing `CARGO_ENV` (`"CARGO"`) if present, and only if not do we attempt to perform a lookup with `env::current_exe()` ourselves. This means users without access to `current_exe` (such as Linux without `procfs` mounted) can supply the `CARGO` env var themselves for external commands to use.

My concern here is: what if maybe we intentionally switch cargo binaries and didn't intend for this to happen? Could this ever happen outside a test environment? This kind-of-sorta-happened by accident in the test suite, necessitating the explicit removal of `CARGO_ENV` from the subprocess environment, because the actual cargo executing the test suite propagated its own path into the test subprocess!

/cc @alexcrichton as the originator of the idea of `CARGO_ENV`

6 years agoTry to replicate shell behavior more accurately
Ashe Connor [Thu, 26 Oct 2017 07:30:50 +0000 (18:30 +1100)]
Try to replicate shell behavior more accurately

6 years agoMerge remote-tracking branch 'upstream/master' into cargo-env-prevails
Ashe Connor [Thu, 26 Oct 2017 07:18:39 +0000 (18:18 +1100)]
Merge remote-tracking branch 'upstream/master' into cargo-env-prevails

6 years agoAuto merge of #4644 - dethoter:4620, r=matklad
bors [Thu, 26 Oct 2017 05:17:36 +0000 (05:17 +0000)]
Auto merge of #4644 - dethoter:4620, r=matklad

Fix documentation for package.readme option.

Fix for #4620.

6 years agoMerge remote-tracking branch 'upstream/master' into alt-registry-publish
Chris Swindle [Wed, 25 Oct 2017 20:21:24 +0000 (21:21 +0100)]
Merge remote-tracking branch 'upstream/master' into alt-registry-publish

Conflicts:
src/cargo/util/toml/mod.rs

6 years agoAuto merge of #4506 - withoutboats:alt-registries, r=alexcrichton
bors [Wed, 25 Oct 2017 17:09:02 +0000 (17:09 +0000)]
Auto merge of #4506 - withoutboats:alt-registries, r=alexcrichton

Alternative registries

An implementation of alt registries. Still needs to get tested more thoroughly but seems to work.

6 years agoAuto merge of #4627 - integer32llc:document-libs-and-bins, r=matklad
bors [Wed, 25 Oct 2017 14:29:13 +0000 (14:29 +0000)]
Auto merge of #4627 - integer32llc:document-libs-and-bins, r=matklad

Document the lib if a lib and bin have the same name

Fixes #4341, as discussed in that issue.

- Removes the check that bailed if there was a  bin and lib with the
  same name
- Exclude bins with the same name as libs from the proposed targets to
  build when compiling docs
- Adjust tests to expect this behavior

6 years agoAdd more tests about documenting lib vs bins with the same name
Carol (Nichols || Goulding) [Mon, 16 Oct 2017 20:05:47 +0000 (16:05 -0400)]
Add more tests about documenting lib vs bins with the same name

6 years agoDocument the lib if a lib and bin have the same name
Carol (Nichols || Goulding) [Mon, 16 Oct 2017 16:30:57 +0000 (12:30 -0400)]
Document the lib if a lib and bin have the same name

Fixes #4341.

- Removes the check that bailed if there was a  bin and lib with the
  same name
- Exclude bins with the same name as libs from the proposed targets to
  build when compiling docs
- Adjust tests to expect this behavior

6 years agoAuto merge of #4649 - jongiddy:gitignore-newline, r=alexcrichton
bors [Wed, 25 Oct 2017 06:42:27 +0000 (06:42 +0000)]
Auto merge of #4649 - jongiddy:gitignore-newline, r=alexcrichton

Add a newline before appended VCS ignore lines

The `cargo init` command appends to `.gitignore` or `.hgignore` without checking if the last line of the existing file ends with a newline.

This change will insert a newline before the appended lines. If the last line has no newline, this will ensure the lines are kept separated. If the newline is present, this will insert a blank line. Both Git and Mercurial ignore blank lines in these files.

6 years agoAuto merge of #4654 - rwakulszowa:inferred_test_cleanup, r=matklad
bors [Wed, 25 Oct 2017 05:29:49 +0000 (05:29 +0000)]
Auto merge of #4654 - rwakulszowa:inferred_test_cleanup, r=matklad

Clean up inferred* tests

Deduplicate, simplify and rename interred_* tests.
Follow up to #4496
@matklad

6 years agoAuto merge of #4659 - integer32llc:pin-nightly, r=alexcrichton
bors [Wed, 25 Oct 2017 00:11:50 +0000 (00:11 +0000)]
Auto merge of #4659 - integer32llc:pin-nightly, r=alexcrichton

try pinning to a nightly of two weeks ago

This passed CI [over here](https://github.com/rust-lang/cargo/pull/4658) and should get the 32-bit windows cross compiling tests passing until someone figures out why rustc is broken for that purpose

r? @alexcrichton

cc https://github.com/rust-lang/rust/issues/45500

6 years agoUpdate alt-registry tests to the use the new interface.
Chris Swindle [Tue, 24 Oct 2017 20:24:12 +0000 (21:24 +0100)]
Update alt-registry tests to the use the new interface.

6 years agoMerge branch 'master' of github.com:rust-lang/cargo into alt-registries
Chris Swindle [Tue, 24 Oct 2017 19:54:59 +0000 (20:54 +0100)]
Merge branch 'master' of github.com:rust-lang/cargo into alt-registries

6 years agotry pinning to a nightly of two weeks ago
Carol (Nichols || Goulding) [Tue, 24 Oct 2017 17:17:27 +0000 (13:17 -0400)]
try pinning to a nightly of two weeks ago

6 years agoAdd tests of transitive dependencies.
Without Boats [Fri, 6 Oct 2017 22:34:00 +0000 (15:34 -0700)]
Add tests of transitive dependencies.