cargo.git
8 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

8 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

8 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

8 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

8 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

8 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!

8 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

8 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

8 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

8 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.

8 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

8 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.

8 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.

8 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.

8 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.

8 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

8 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

8 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.

8 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

8 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`

8 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

8 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

8 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.

8 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.

8 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

8 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

8 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

8 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.

8 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

8 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

8 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.

8 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

8 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

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

8 years agoClean up inferred* tests
rwakulszowa [Mon, 23 Oct 2017 09:18:12 +0000 (10:18 +0100)]
Clean up inferred* tests

8 years agoAdding test for alternate registry dependency, with alternate registry dependency.
Chris Swindle [Mon, 23 Oct 2017 05:54:25 +0000 (06:54 +0100)]
Adding test for alternate registry dependency, with alternate registry dependency.

8 years agoSwitch to use registry in the dependency so that it matches RFC2141.
Chris Swindle [Sun, 22 Oct 2017 07:44:11 +0000 (08:44 +0100)]
Switch to use registry in the dependency so that it matches RFC2141.

8 years agoSorting out file permissions.
Chris Swindle [Sun, 22 Oct 2017 06:47:32 +0000 (07:47 +0100)]
Sorting out file permissions.

8 years agoAdd support for other registries in dependencies.
Chris Swindle [Sun, 22 Oct 2017 06:46:50 +0000 (07:46 +0100)]
Add support for other registries in dependencies.

8 years agoAdding some extra tests.
Chris Swindle [Sat, 21 Oct 2017 19:10:25 +0000 (20:10 +0100)]
Adding some extra tests.

8 years agoDocument that cargo test --release uses profile.bench
main() [Sat, 21 Oct 2017 15:55:32 +0000 (17:55 +0200)]
Document that cargo test --release uses profile.bench

8 years agoAdd a newline before appended VCS ignore lines
Jonathan Giddy [Sat, 21 Oct 2017 15:15:52 +0000 (16:15 +0100)]
Add a newline before appended VCS ignore lines

8 years agoDon't change order of tests and benches for cleaner diff.
Eric Huss [Fri, 20 Oct 2017 23:59:32 +0000 (16:59 -0700)]
Don't change order of tests and benches for cleaner diff.

8 years agoFix broken bench test for new --benches behavior.
Eric Huss [Fri, 20 Oct 2017 22:45:51 +0000 (15:45 -0700)]
Fix broken bench test for new --benches behavior.

8 years agoRework handling of --tests and --benches with implied targets.
Eric Huss [Fri, 20 Oct 2017 21:34:21 +0000 (14:34 -0700)]
Rework handling of --tests and --benches with implied targets.

8 years agoComments!
Ashe Connor [Fri, 20 Oct 2017 00:51:23 +0000 (11:51 +1100)]
Comments!

8 years agoFix documentation for package.readme option.
Evgen Druzhynin [Thu, 19 Oct 2017 10:36:52 +0000 (13:36 +0300)]
Fix documentation for package.readme option.

8 years agoAuto merge of #4623 - alexcrichton:remove-lock, r=matklad
bors [Thu, 19 Oct 2017 07:58:19 +0000 (07:58 +0000)]
Auto merge of #4623 - alexcrichton:remove-lock, r=matklad

Delete Cargo.lock from this repo

There's now a lock file upstream in rust-lang/rust so the one here isn't
actually used, and otherwise this crate is used as a dependency so the lock file
isn't respected anyway!

8 years agoAuto merge of #4637 - kivikakk:vers-version, r=alexcrichton
bors [Thu, 19 Oct 2017 06:50:17 +0000 (06:50 +0000)]
Auto merge of #4637 - kivikakk:vers-version, r=alexcrichton

Allow cargo install --version as well (preferred)

Fixes https://github.com/rust-lang/cargo/issues/4590.

The usage looks pretty ugly with this extra line in it, but it's not really avoidable with our docopt use.

We fail if both are provided; accepting both feels like a path to demons.

8 years agoTry current_exe, then argv0 canonicalize, then PATH
Ashe Connor [Thu, 19 Oct 2017 05:15:16 +0000 (16:15 +1100)]
Try current_exe, then argv0 canonicalize, then PATH

8 years agoDelete Cargo.lock from this repo
Alex Crichton [Sun, 10 Sep 2017 16:38:29 +0000 (09:38 -0700)]
Delete Cargo.lock from this repo

There's now a lock file upstream in rust-lang/rust so the one here isn't
actually used, and otherwise this crate is used as a dependency so the lock file
isn't respected anyway!

8 years agoAuto merge of #4638 - efyang:docs-cc, r=alexcrichton
bors [Wed, 18 Oct 2017 14:04:33 +0000 (14:04 +0000)]
Auto merge of #4638 - efyang:docs-cc, r=alexcrichton

Update docs to use cc instead of gcc

Closes #4626.

8 years agoAuto merge of #4633 - kivikakk:readme-file, r=carols10cents
bors [Wed, 18 Oct 2017 12:50:42 +0000 (12:50 +0000)]
Auto merge of #4633 - kivikakk:readme-file, r=carols10cents

transmit: send README filename as well as content

This is required to solve https://github.com/rust-lang/crates.io/issues/995; we currently only send the README content, but not the name of the README itself, so it's not possible to determine how we should render it.

I've confirmed the existing crates.io server silently ignores the new field, so this should be safe to roll out whenever.

8 years agoUpdate docs to use cc instead of gcc
Edward Yang [Wed, 18 Oct 2017 06:39:49 +0000 (01:39 -0500)]
Update docs to use cc instead of gcc

8 years agoLet's not accept both, just to be safe
Ashe Connor [Wed, 18 Oct 2017 06:39:11 +0000 (17:39 +1100)]
Let's not accept both, just to be safe

8 years agoAllow --version as well (preferred)
Ashe Connor [Wed, 18 Oct 2017 06:18:42 +0000 (17:18 +1100)]
Allow --version as well (preferred)

8 years agoAuto merge of #4635 - dethoter:4430, r=alexcrichton
bors [Tue, 17 Oct 2017 17:32:27 +0000 (17:32 +0000)]
Auto merge of #4635 - dethoter:4430, r=alexcrichton

Fix a documentation for package.build option.

Fix for #4430.

8 years agoFix a documentation for package.build option.
Evgen Druzhynin [Tue, 17 Oct 2017 15:52:56 +0000 (18:52 +0300)]
Fix a documentation for package.build option.

8 years agoAuto merge of #4630 - ehuss:new-test-temp-dir, r=alexcrichton
bors [Tue, 17 Oct 2017 14:24:37 +0000 (14:24 +0000)]
Auto merge of #4630 - ehuss:new-test-temp-dir, r=alexcrichton

Fix `new` tests on Windows inadvertently picking up ~/.cargo/config.

Fixes #4601.  By relying on `__CARGO_TEST_ROOT`, using a temp directory is no
longer necessary.

8 years agotransmit: send README filename as well as content
Ashe Connor [Tue, 17 Oct 2017 05:04:33 +0000 (16:04 +1100)]
transmit: send README filename as well as content

8 years agoFix `new` tests on Windows inadvertently picking up ~/.cargo/config.
Eric Huss [Mon, 16 Oct 2017 23:41:11 +0000 (16:41 -0700)]
Fix `new` tests on Windows inadvertently picking up ~/.cargo/config.

Fixes #4601.  By relying on `__CARGO_TEST_ROOT`, using a temp directory is no
longer necessary.

8 years agoAuto merge of #4628 - pixelistik:patch-1, r=alexcrichton
bors [Mon, 16 Oct 2017 22:24:57 +0000 (22:24 +0000)]
Auto merge of #4628 - pixelistik:patch-1, r=alexcrichton

Fix typo in docs

8 years agoFix typo in docs
pixelistik [Mon, 16 Oct 2017 20:11:24 +0000 (22:11 +0200)]
Fix typo in docs

8 years agoAuto merge of #4619 - camjackson:patch-1, r=alexcrichton
bors [Sun, 15 Oct 2017 17:00:09 +0000 (17:00 +0000)]
Auto merge of #4619 - camjackson:patch-1, r=alexcrichton

Document how to make `build.rs` write to the terminal

Documenting the solution mentioned here: https://github.com/rust-lang/cargo/issues/985

8 years agoAuto merge of #4624 - alexcrichton:bump, r=alexcrichton
bors [Sun, 15 Oct 2017 15:30:51 +0000 (15:30 +0000)]
Auto merge of #4624 - alexcrichton:bump, r=alexcrichton

Bump to 0.24.0

It's that time of the year again!

8 years agoBump to 0.24.0
Alex Crichton [Sun, 15 Oct 2017 15:30:11 +0000 (08:30 -0700)]
Bump to 0.24.0

It's that time of the year again!

8 years agoDocument how to make `build.rs` write to the terminal
Cam Jackson [Sun, 15 Oct 2017 03:30:38 +0000 (11:30 +0800)]
Document how to make `build.rs` write to the terminal

8 years agoFix wrong profile selection for `cargo build` and `cargo rustc`.
Eric Huss [Sun, 8 Oct 2017 22:23:21 +0000 (15:23 -0700)]
Fix wrong profile selection for `cargo build` and `cargo rustc`.

8 years agoFix broken tests due to different profile selection.
Eric Huss [Sun, 8 Oct 2017 01:55:00 +0000 (18:55 -0700)]
Fix broken tests due to different profile selection.

8 years agoAdd unit test checking to `cargo check`
Eric Huss [Sat, 7 Oct 2017 16:28:34 +0000 (09:28 -0700)]
Add unit test checking to `cargo check`

- 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.
- Don't implicitly compile binaries when using just `--test` filters.
- Fix erroneously linking tests when run with `--test`.

Fixes #3431, #4003, #4059, #4330.

8 years agoAuto merge of #4616 - kennytm:fix-4490, r=alexcrichton
bors [Sat, 14 Oct 2017 14:54:15 +0000 (14:54 +0000)]
Auto merge of #4616 - kennytm:fix-4490, r=alexcrichton

Uplift *.dSYM

Fixed #4490.

The solution is based on #4570. Simply adding `.dSYM` into `add_target_specific_suffixes` will cause cargo trying to actually run that `.dSYM` folder, so I've upgraded the `linkable` boolean into a 3-value enum `TargetFileType`, to tell `cargo run` and `cargo test` to avoid these debug symbol files.

(I haven't checked if it can solve #4056, don't wanna mess with Spotlight 😝)

8 years agoAuto merge of #4618 - integer32llc:config-in-home, r=alexcrichton
bors [Sat, 14 Oct 2017 14:19:16 +0000 (14:19 +0000)]
Auto merge of #4618 - integer32llc:config-in-home, r=alexcrichton

Clarify that $HOME/.cargo is always checked

8 years agoClarify that $HOME/.cargo is always checked
Jake Goulding [Fri, 13 Oct 2017 23:50:04 +0000 (19:50 -0400)]
Clarify that $HOME/.cargo is always checked

8 years agoUplift *.dSYM. Fix #4490.
kennytm [Fri, 13 Oct 2017 19:13:32 +0000 (03:13 +0800)]
Uplift *.dSYM. Fix #4490.

8 years agoAuto merge of #4610 - hdhoang:patch-1, r=alexcrichton
bors [Thu, 12 Oct 2017 14:23:24 +0000 (14:23 +0000)]
Auto merge of #4610 - hdhoang:patch-1, r=alexcrichton

layout: fix typo, and improve pronoun

"it" is ambiguous between `new` and `at` (the most recent noun).

8 years agoAuto merge of #4314 - nodakai:phantom-type-in-projectbuilder, r=matklad
bors [Thu, 12 Oct 2017 08:52:44 +0000 (08:52 +0000)]
Auto merge of #4314 - nodakai:phantom-type-in-projectbuilder, r=matklad

cargotest/support: remove internal mutability in favor of switching types

`Cell<bool>` was removed from `ProjectBuilder`. Instead `PhantomData<T>` was added to it (and `RepoBuilder`) to manage state transition in the type level (`T` is either `Configuring` or `Done`.)
`ProjectBuilder::cargo_process()` was removed as its design heavily depended on the internal mutability.

Also added `#[must_use]` to `ProjectBuilder` and `RepoBuilder` to check for call sites of their `build()` method.

8 years agolayout: fix typo, and improve pronoun
Hoàng Đức Hiếu [Thu, 12 Oct 2017 04:04:58 +0000 (13:04 +0900)]
layout: fix typo, and improve pronoun

"it" is ambiguous between `new` and `at` (the most recent noun).

8 years agoAuto merge of #4608 - vmx:patch-1, r=alexcrichton
bors [Thu, 12 Oct 2017 00:20:13 +0000 (00:20 +0000)]
Auto merge of #4608 - vmx:patch-1, r=alexcrichton

Remove wrong information about git repository

Dependencies cannot be a git repository when published to crates.io.

8 years agoRemove wrong information about git repository
Volker Mische [Wed, 11 Oct 2017 19:18:41 +0000 (21:18 +0200)]
Remove wrong information about git repository

Dependencies cannot be a git repository when published to crates.io.

8 years agoAuto merge of #4594 - behnam:workspace, r=alexcrichton
bors [Tue, 10 Oct 2017 19:20:43 +0000 (19:20 +0000)]
Auto merge of #4594 - behnam:workspace, r=alexcrichton

[core/workspace] Create WorkspaceRootConfig

Create `WorkspaceRootConfig`, which knows its `root_dir` and lists of
`members` and `excludes`, to answer queries on which paths are a member
and which are not.

----

This is the first step of the fix, that's only a codemod to put together the relevant parts : `workspace.members`, `workspace.excludes`, and the `root_dir` (where `members` and `excludes` are relative to). There's no logic change in this PR to keep review easier.

The added tests are commented out, because they fail with the current logic. The next step to get these steps to pass.

Tracker: <https://github.com/rust-lang/cargo/issues/4089>
Old PR: <https://github.com/rust-lang/cargo/pull/4297>

8 years agoAuto merge of #4581 - tamird:master, r=alexcrichton
bors [Tue, 10 Oct 2017 18:36:48 +0000 (18:36 +0000)]
Auto merge of #4581 - tamird:master, r=alexcrichton

cargo_rustc: remove workaround for fixed upstream issue

Fixed in https://github.com/rust-lang/rust/pull/25411. Also, the
removed code is implicated in test failures observed in
https://github.com/rust-lang/rust/pull/44515.

r? @alexcrichton

8 years agoAuto merge of #4602 - ehuss:fix-new-test-windows, r=alexcrichton
bors [Tue, 10 Oct 2017 17:58:30 +0000 (17:58 +0000)]
Auto merge of #4602 - ehuss:fix-new-test-windows, r=alexcrichton

Allow test to pass if user has ~/.gitconfig on Windows.

The `new` test will fail on Windows if you have `~/.gitconfig` configured with a username/email.  This is because libgit2 searches quite a few environment variables hunting for a config file.  Rather than adjusting other environment variables (I think at a minimum it would be `%HOMEDRIVE%%HOMEPATH%` and `%USERPROFILE%`), this just adds an empty config file since libgit2 will stop at the first one it finds.

8 years agocargo_rustc: remove workaround for fixed upstream issue
Tamir Duberstein [Thu, 5 Oct 2017 06:54:43 +0000 (02:54 -0400)]
cargo_rustc: remove workaround for fixed upstream issue

Fixed in https://github.com/rust-lang/rust/pull/25411. Also, the
removed code is implicated in test failures observed in
https://github.com/rust-lang/rust/pull/44515.

8 years agocargotest/support: remove internal mutability in favor of switching types
NODA, Kai [Sat, 22 Jul 2017 03:12:21 +0000 (11:12 +0800)]
cargotest/support: remove internal mutability in favor of switching types

Remove is_build: Cell<bool> from ProjectBuilder and introduce a new type Project.

is_build==false <-> ProjectBuilder
is_build==true <-> Project

Also add #[must_use] to ProjectBuilder to confirm its instances are surely consumed by its build() method to produce Project.

The same goes for RepoBuilder.

ProjectBuilder::cargo_process() was removed as its design heavily depended on the internal mutability.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
8 years agoAllow test to pass if user has ~/.gitconfig on Windows.
Eric Huss [Tue, 10 Oct 2017 00:52:51 +0000 (17:52 -0700)]
Allow test to pass if user has ~/.gitconfig on Windows.

8 years agoAuto merge of #4570 - tatsuya6502:target-specific-artifacts, r=alexcrichton
bors [Mon, 9 Oct 2017 20:48:17 +0000 (20:48 +0000)]
Auto merge of #4570 - tatsuya6502:target-specific-artifacts, r=alexcrichton

Handle target specific outputs such as .wasm or .dll.lib

Fixes #4500, #4535

Until now, Cargo does not have any knowledge about target-specific output files. It relies solely on rustc for this sort of information (`rustc --print=file-names ...`).

As a result, Cargo does not place some build artifacts (files) to target/{debug,release} directory. These files include *.wasm for wasm32-unknown-emscripten target and *.dll.lib for *-pc-windows-msvc cdylib target.

This commit will add such knowledge to Cargo so that *.wasm and *.dll.lib will be placed in target/{debug,release} directory.

**EDIT**: I added [a summary of changes](https://github.com/rust-lang/cargo/pull/4570#issuecomment-334433635). Please read it for more details of changes.

**IMPORTANT**
Although I added test cases for both wasm32-unknown-emscripten and *-pc-windows-msvc cdylib targets, ~I did not do manual testing on wasm32-unknown-emscripten target as I do not have an environment with emscripten installed. It will be appreciated if anybody tests this change for wasm32-unknown-emscripten target.~  **EDIT**: Tested for both wasm32-unknown-emscripten and x86_64-pc-windows-msvc. Thanks @Herschel for the help.

8 years agoAuto merge of #4597 - andreevlex:fix-cargo-doc, r=alexcrichton
bors [Mon, 9 Oct 2017 17:53:25 +0000 (17:53 +0000)]
Auto merge of #4597 - andreevlex:fix-cargo-doc, r=alexcrichton

Fixed spelling error in manifest.md

8 years agoFixed spelling error in manifest.md
Andreev Alexander [Mon, 9 Oct 2017 13:38:06 +0000 (16:38 +0300)]
Fixed spelling error in manifest.md

8 years agoAuto merge of #4595 - treiff:update-appveyor-badge-documentation, r=alexcrichton
bors [Sun, 8 Oct 2017 02:32:33 +0000 (02:32 +0000)]
Auto merge of #4595 - treiff:update-appveyor-badge-documentation, r=alexcrichton

Update docs for appveyor badge.

Can now optionally specify the appveyor `project_name`.

Related PR: [rust-lang/crates.io#1111](https://github.com/rust-lang/crates.io/pull/1111)
Related Issue: [rust-lang/crates.io#587](https://github.com/rust-lang/crates.io/issues/587)

8 years agoUpdate docs for appveyor badge.
Trevor Reiff [Sun, 8 Oct 2017 00:59:39 +0000 (20:59 -0400)]
Update docs for appveyor badge.

8 years ago[workspace] Add some docs
Behnam Esfahbod [Sat, 7 Oct 2017 22:00:13 +0000 (15:00 -0700)]
[workspace] Add some docs

Plus some little codemod.

8 years ago[core/workspace] Create WorkspaceRootConfig
Behnam Esfahbod [Tue, 26 Sep 2017 05:55:02 +0000 (22:55 -0700)]
[core/workspace] Create WorkspaceRootConfig

Create `WorkspaceRootConfig`, which knows its `root_dir` and lists of
`members` and `excludes`, to answer queries on which paths are a member
and which are not.

8 years agoAuto merge of #4578 - derekdreery:refactor/cargo_util_config, r=alexcrichton
bors [Sat, 7 Oct 2017 15:09:06 +0000 (15:09 +0000)]
Auto merge of #4578 - derekdreery:refactor/cargo_util_config, r=alexcrichton

Remove some cells from Config

In most cases it makes sense to not use interior mutability in Config, so that mutability is more transparent. This PR removes Cells in these cases. It leaves those cases where parameters are only initialized on first access (LazyCell).

8 years agoUpdate docs (replace todos)
Richard Dodd [Sat, 7 Oct 2017 12:47:21 +0000 (13:47 +0100)]
Update docs (replace todos)

8 years agoClean up alt registries lookup.
Without Boats [Fri, 6 Oct 2017 20:29:37 +0000 (13:29 -0700)]
Clean up alt registries lookup.

8 years agoAuto merge of #4586 - lukaslueg:issue4534, r=alexcrichton
bors [Fri, 6 Oct 2017 17:54:30 +0000 (17:54 +0000)]
Auto merge of #4586 - lukaslueg:issue4534, r=alexcrichton

Report hint if single failure with --no-fail-fast

There are two things going on in #4534:

* The doctest-kind masks the unittest-kind if doctests are executed during `--no-fail-fast`, no doctests fail and tests errors have already piled up. This is bug, fixed.
* Cargo would previously not report any unittest-hints if running with `--no-fail-fast`. This behavior has been changed to report a specific hint iif exactly one error has bubbled up during `--no-fail-fast`. The hint in #4534 is now `...pass '--test integ'`.

8 years agoReport hint if single failure with --no-fail-fast
Lukas Lueg [Fri, 6 Oct 2017 16:14:23 +0000 (18:14 +0200)]
Report hint if single failure with --no-fail-fast

If a single unit-test fails, report a rerun-hint for it,
even with --no-fail-fast.

Fixes reporting a doctest-hint if doctest succeeds while
unittest fail with --no-fail-fast.

Fixes #4534

8 years agoGet features in virtual manifest.
boats [Thu, 5 Oct 2017 23:13:53 +0000 (23:13 +0000)]
Get features in virtual manifest.

8 years agoClean up
boats [Thu, 5 Oct 2017 23:11:40 +0000 (23:11 +0000)]
Clean up

8 years agoAuto merge of #4583 - alexcrichton:unstable, r=matklad
bors [Thu, 5 Oct 2017 22:54:59 +0000 (22:54 +0000)]
Auto merge of #4583 - alexcrichton:unstable, r=matklad

Fix [patch] causing updates with a virtual manifest

This commit fixes the [patch] implementation to avoid causing spurious updates
of the registry when specified inside of a virtual manifest via a path
dependency that was otherwise outside of the workspace.

Cargo previously attempted to learn about path dependencies through the
configuration of the workspace by looking at members, their path dependencies,
and their replace sections. The replace/patch sections, however, only matter at
the root of the workspace and those weren't looked at! This commit fixes this
problem by explicitly looking at the workspace's replace/patch sections and
avoiding looking at other manifest replace/patch which shouldn't matter.

Closes #4552