cargo.git
8 years ago[doc/book] Create dir for book sections
Behnam Esfahbod [Thu, 31 Aug 2017 20:17:19 +0000 (13:17 -0700)]
[doc/book] Create dir for book sections

8 years ago[doc/book] Improve page titles
Behnam Esfahbod [Thu, 31 Aug 2017 19:53:55 +0000 (12:53 -0700)]
[doc/book] Improve page titles

8 years ago[src/doc/book] Add introduction page
Behnam Esfahbod [Thu, 31 Aug 2017 08:04:54 +0000 (01:04 -0700)]
[src/doc/book] Add introduction page

8 years ago[doc/book] Expand installation.md
Behnam Esfahbod [Thu, 31 Aug 2017 19:22:24 +0000 (12:22 -0700)]
[doc/book] Expand installation.md

Import install text and links from <https://crates.io/install>, as we
want to drop that page and redirect it to here.

See <https://github.com/rust-lang/crates.io/issues/1029>

8 years agoAuto merge of #4453 - behnam:book, r=alexcrichton
bors [Thu, 31 Aug 2017 21:08:09 +0000 (21:08 +0000)]
Auto merge of #4453 - behnam:book, r=alexcrichton

Import mdBook-based docs and sync

Since we decided to keep the mdBook-based docs in-repo, I have imported the existing converted docs from <https://github.com/istankovic/cargo-book> under `/src/doc/book/` here, and have synced the current docs and the mdBook-based ones manually, file-by-file.

I have created a `MIGRATION_MAP` file, which shows the relationship between old docs and new ones. The first column is the old file, the second column is the canonical location in mdBook, and the rest of columns are globs of other files in mdBook containing content from the old file.

The first and second column of `MIGRATION_MAP` shall later be used to create redirect rules from `doc.crates.io/` to `doc.rust-lang.org/cargo/`.

I will also add a README file to remind everyone to keep these files in sync during the migration.

There are also two or three small wording fixes here, which I'll note inline.

This is a retry of <https://github.com/rust-lang/cargo/pull/4220>.

First step for <https://github.com/rust-lang/cargo/issues/4040>.

8 years agoAuto merge of #4447 - lucaskolstad:proc-macro-crates-host-deps-linkage, r=alexcrichton
bors [Thu, 31 Aug 2017 20:26:56 +0000 (20:26 +0000)]
Auto merge of #4447 - lucaskolstad:proc-macro-crates-host-deps-linkage, r=alexcrichton

Add host dependency path via -L for cargo_test.

Proc-macro crates' dependencies in the host dependency directory cannot
be found when running `cargo test` with the `--target {target}` flag
set as reported in #4224. This adds the host dependency directory to the
search path to find those missing dependencies with -L when building tests
and adds a test case that fails before and passes after this patch.

A new function `find_host_deps(..)` is added to accomplish this which can
determine the path of the host dependencies directory from within
`run_doc_tests(..)` where the missing library search path is needed.

Fixes #4224
Fixes #4254

Modeled after a similar patch: a298346d6e8862992be3fd93dd8a6c833cc72719

**Concerns**

The test case seems to require a non-local crate from crates.io to example the failure before this patch. Couldn't make it fail with simply another local subcrate, but if others think it's possible that'd be great. This means that during tests for the cargo project itself that this test case actually downloads and compiles a crate, which I don't think any other tests do and is obviously not ideal and is perhaps even unacceptable. I've used the base64 crate pretty arbitrarily, but which crate it is really doesn't matter to test the case's content. So if anyone knows a tiny or empty crate on crates.io to use instead that'd speed this up and if someone can figure out how to make it fail before this patch is applied without downloading an external crate that would help as well.

Also, I'm not 100% confident about the `find_host_deps(..)` style and whether it's the best way to find the host dependencies directory with just the `TestOptions` and `Compilation` structs available since I'm new to this project. Any comments are appreciated.

8 years agoTweak proc_macro test to correctly test case.
Lucas Kolstad [Thu, 31 Aug 2017 17:55:19 +0000 (10:55 -0700)]
Tweak proc_macro test to correctly test case.

Minor change causes the test to actually test the case instead of always
passing regardless of the fix that adds the host dependency directory to
the library search path.

8 years ago[src/doc/book] Use package registry for crates.io
Behnam Esfahbod [Thu, 31 Aug 2017 08:32:03 +0000 (01:32 -0700)]
[src/doc/book] Use package registry for crates.io

8 years ago[src/doc/book] Fix header casings
Behnam Esfahbod [Thu, 31 Aug 2017 08:30:58 +0000 (01:30 -0700)]
[src/doc/book] Fix header casings

8 years ago[src/doc/book] Move a paragraph to cargo-in-depth.md
Behnam Esfahbod [Thu, 31 Aug 2017 08:26:30 +0000 (01:26 -0700)]
[src/doc/book] Move a paragraph to cargo-in-depth.md

8 years ago[src/doc/book] Add all sub-chapters to cargo-in-depth.md
Behnam Esfahbod [Thu, 31 Aug 2017 08:07:35 +0000 (01:07 -0700)]
[src/doc/book] Add all sub-chapters to cargo-in-depth.md

8 years ago[src/doc/book] Drop unused images
Behnam Esfahbod [Thu, 31 Aug 2017 07:49:54 +0000 (00:49 -0700)]
[src/doc/book] Drop unused images

8 years ago[src/doc] Add README.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:33:22 +0000 (18:33 -0700)]
[src/doc] Add README.md

8 years ago[src/doc/book] Update SUMMARY.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:19:18 +0000 (18:19 -0700)]
[src/doc/book] Update SUMMARY.md

8 years ago[src/doc/book] Update 03-01-specifying-dependencies.md from specifying-dependencies.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:16:52 +0000 (18:16 -0700)]
[src/doc/book] Update 03-01-specifying-dependencies.md from specifying-dependencies.md

8 years ago[src/doc/book] Check 03-08-source-replacement.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:15:26 +0000 (18:15 -0700)]
[src/doc/book] Check 03-08-source-replacement.md

8 years ago[src/doc/book] Update 03-10-policies.md from policies.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:14:29 +0000 (18:14 -0700)]
[src/doc/book] Update 03-10-policies.md from policies.md

8 years ago[src/doc/book] Check 03-07-pkgid-spec.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:12:51 +0000 (18:12 -0700)]
[src/doc/book] Check 03-07-pkgid-spec.md

8 years ago[src/doc/book] Update 03-02-manifest.md from manifest.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:10:13 +0000 (18:10 -0700)]
[src/doc/book] Update 03-02-manifest.md from manifest.md

8 years ago[src/doc/book] Apply 01-*.md changes into index.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:02:21 +0000 (18:02 -0700)]
[src/doc/book] Apply 01-*.md changes into index.md

8 years agoReplace plugins_dylib_path with host_deps_output.
Lucas Kolstad [Thu, 31 Aug 2017 00:59:23 +0000 (17:59 -0700)]
Replace plugins_dylib_path with host_deps_output.

The plugins_dylib_path field on Compilation is removed because it is
identical to host_deps_output, it is only used in one easily replaced
location, and because host_deps_output is a more general name that
includes its new usage location in cargo_test.rs as well while better
matching the corresponding deps_output field.

Also de-indents erroneously indented lines in a test case.

8 years ago[src/doc/book] Update guide.md and 02-*.md from guide.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:38:47 +0000 (17:38 -0700)]
[src/doc/book] Update guide.md and 02-*.md from guide.md

8 years ago[src/doc/book] Check faq.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:26:34 +0000 (17:26 -0700)]
[src/doc/book] Check faq.md

8 years ago[src/doc/book] Update 03-09-external-tools.md from external-tools.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:13:49 +0000 (17:13 -0700)]
[src/doc/book] Update 03-09-external-tools.md from external-tools.md

8 years ago[src/doc/book] Update 03-04-environment-variables.md from environment-variables.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:12:06 +0000 (17:12 -0700)]
[src/doc/book] Update 03-04-environment-variables.md from environment-variables.md

8 years ago[src/doc/book] Update 03-06-crates-io.md from crates-io.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:08:18 +0000 (17:08 -0700)]
[src/doc/book] Update 03-06-crates-io.md from crates-io.md

8 years ago[src/doc/book] Update 03-05-build-scripts.md from build-script.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:05:21 +0000 (17:05 -0700)]
[src/doc/book] Update 03-05-build-scripts.md from build-script.md

8 years ago[src/doc/book] Update 03-03-config.md from config.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:00:04 +0000 (17:00 -0700)]
[src/doc/book] Update 03-03-config.md from config.md

8 years ago[src/doc/book] Add .gitignore
Behnam Esfahbod [Wed, 30 Aug 2017 22:45:37 +0000 (15:45 -0700)]
[src/doc/book] Add .gitignore

Using `mdbook init` command.

Also, update `.gitignore` file manually and add a leading slash.
(Upstream fix for mdBook: <https://github.com/azerupi/mdBook/pull/413>)

8 years ago[src/doc/book] Import from cargo-book repo
Behnam Esfahbod [Wed, 30 Aug 2017 22:38:51 +0000 (15:38 -0700)]
[src/doc/book] Import from cargo-book repo

8 years agoRemove find_host_deps and use Compilation field.
Lucas Kolstad [Wed, 30 Aug 2017 22:16:52 +0000 (15:16 -0700)]
Remove find_host_deps and use Compilation field.

This patch removes the addition of the find_host_deps() function by
adding a host_deps_output field to the Compilation struct instead. The
test case is altered to not use an external crate from crates.io but
instead use the Package.publish(..) method.

8 years agoAuto merge of #4451 - steveklabnik:relax-rustdoc-tests, r=alexcrichton
bors [Wed, 30 Aug 2017 15:40:20 +0000 (15:40 +0000)]
Auto merge of #4451 - steveklabnik:relax-rustdoc-tests, r=alexcrichton

relax rustdoc tests

This was asserting on the output directly, rather than just what it contains.

In https://github.com/rust-lang/rust/pull/44138 we are adding deprecations, and so it
breaks these tests.

8 years agoDon't use deprecated rustdoc flags in tests
steveklabnik [Wed, 30 Aug 2017 14:50:40 +0000 (10:50 -0400)]
Don't use deprecated rustdoc flags in tests

In rust-lang/rust#44138 we are adding deprecations, and so it
breaks these tests.

8 years agoAuto merge of #4440 - nisargthakkar:publish_target, r=alexcrichton
bors [Tue, 29 Aug 2017 17:40:45 +0000 (17:40 +0000)]
Auto merge of #4440 - nisargthakkar:publish_target, r=alexcrichton

Adding target support to cargo package and cargo publish

Fixing Issue #4012

Same as #4077 but couldn't reopen the PR due to force push after rebasing from master

8 years agoRemoving redundant extern
Nisarg Thakkar [Tue, 29 Aug 2017 15:08:02 +0000 (20:38 +0530)]
Removing redundant extern

8 years agoAdding tests for --target with cargo publish and cargo package
Nisarg Thakkar [Sun, 27 Aug 2017 06:49:17 +0000 (12:19 +0530)]
Adding tests for --target with cargo publish and cargo package

8 years agoAdding target support to cargo package and cargo publish
Nisarg Thakkar [Sat, 20 May 2017 17:05:14 +0000 (22:35 +0530)]
Adding target support to cargo package and cargo publish

8 years agoAdd host dependency path via -L for cargo_test.
Lucas Kolstad [Tue, 29 Aug 2017 10:43:41 +0000 (03:43 -0700)]
Add host dependency path via -L for cargo_test.

Proc-macro crates' dependencies in the host dependency directory cannot
be found when running `cargo test` with the `--target {target}` flag
set. This adds the host dependency directory with -L when building tests
and a test case that fails before and passes after this patch.

A new function find_host_deps(..) is added to accomplish this which can
determine the path of the host dependencies directory from within
run_doc_tests(..) where the missing library search path is needed.

Fixes #4224
Fixes #4254

8 years agoAuto merge of #4442 - Xanewok:process-builder-program, r=alexcrichton
bors [Mon, 28 Aug 2017 15:52:06 +0000 (15:52 +0000)]
Auto merge of #4442 - Xanewok:process-builder-program, r=alexcrichton

Allow to substitute executed program in `ProcessBuilder`

Extends #4424. Sorry for the noise, turns out it'd also be useful to substite the executed program (e.g. for rls, which needs to use a rustc shim itself) without having to copy over manually all parts of the `ProcessBuilder`.

While I'm at it, do you think this needs even more functionality, like being able to specify `None` for the `cwd` or `jobserver` (currently API exposes only ability to specify `Some(...)` as values for those)?

r? @alexcrichton

8 years agoAuto merge of #4445 - alexcrichton:bump, r=matklad
bors [Mon, 28 Aug 2017 15:04:51 +0000 (15:04 +0000)]
Auto merge of #4445 - alexcrichton:bump, r=matklad

Bump Cargo to 0.23.0

8 years agoFix tests on nightly
Alex Crichton [Mon, 28 Aug 2017 15:03:42 +0000 (08:03 -0700)]
Fix tests on nightly

8 years agoBump Cargo to 0.23.0
Alex Crichton [Mon, 28 Aug 2017 14:45:43 +0000 (07:45 -0700)]
Bump Cargo to 0.23.0

8 years agoAllow to substitute executed program in `ProcessBuilder`
Igor Matuszewski [Sun, 27 Aug 2017 16:02:05 +0000 (18:02 +0200)]
Allow to substitute executed program in `ProcessBuilder`

8 years agoAuto merge of #4441 - vignesh-sankaran:manifest-doc-fix, r=alexcrichton
bors [Sun, 27 Aug 2017 15:39:13 +0000 (15:39 +0000)]
Auto merge of #4441 - vignesh-sankaran:manifest-doc-fix, r=alexcrichton

Replace maintenance status with ellipses

Since the default maintenance status isn't set to none if it isn't set, feel it'd be more appropriate to have ellipses instead like the other badge docs.

8 years agoReplace maintenance status badge none with ellipses
Vignesh [Sun, 27 Aug 2017 11:19:58 +0000 (21:19 +1000)]
Replace maintenance status badge none with ellipses

8 years agoAuto merge of #4439 - ishitatsuyuki:bench-cleanup, r=matklad
bors [Sun, 27 Aug 2017 07:41:33 +0000 (07:41 +0000)]
Auto merge of #4439 - ishitatsuyuki:bench-cleanup, r=matklad

Gate extern crates for bench tests

I tried my best to skim through the `extern crate` statements, and I hope this will unblock the unused extern crates PR.

8 years agoFix remaining test failures
Tatsuyuki Ishi [Sun, 27 Aug 2017 07:31:16 +0000 (16:31 +0900)]
Fix remaining test failures

8 years agotests/cfg: allow unused extern crates
Tatsuyuki Ishi [Sun, 27 Aug 2017 07:14:15 +0000 (16:14 +0900)]
tests/cfg: allow unused extern crates

8 years agotests/build-script: allow unused extern crates
Tatsuyuki Ishi [Sun, 27 Aug 2017 07:10:54 +0000 (16:10 +0900)]
tests/build-script: allow unused extern crates

8 years agoGate feature for bench tests
Tatsuyuki Ishi [Sun, 27 Aug 2017 05:57:22 +0000 (14:57 +0900)]
Gate feature for bench tests

8 years agoGate extern crates for bench tests
Tatsuyuki Ishi [Sun, 27 Aug 2017 05:30:13 +0000 (14:30 +0900)]
Gate extern crates for bench tests

8 years agoAuto merge of #4358 - Mark-Simulacrum:fix-cfg-cargo, r=alexcrichton
bors [Sat, 26 Aug 2017 17:57:40 +0000 (17:57 +0000)]
Auto merge of #4358 - Mark-Simulacrum:fix-cfg-cargo, r=alexcrichton

Discover crate type information late if necessary.

Some crates aren't found during eager crate-type searching due to being behind `cfg(...)` flags. We still want to be able to handle these, though, so when necessary we now call rustc again to get crate-type information for these cfg-ed crates.

This is necessary for https://github.com/rust-lang/rust/pull/41991.

r? @alexcrichton

8 years agoAuto merge of #4437 - ishitatsuyuki:deps-purge, r=matklad
bors [Sat, 26 Aug 2017 15:18:46 +0000 (15:18 +0000)]
Auto merge of #4437 - ishitatsuyuki:deps-purge, r=matklad

Purge deps, round 2

Sorry for creating so much iterations, I have no local build of the new compiler :)

8 years agoDiscover crate type information late if necessary.
Mark Simulacrum [Mon, 21 Aug 2017 11:46:31 +0000 (05:46 -0600)]
Discover crate type information late if necessary.

Some crates aren't found during eager crate-type searching due to being
behind `cfg(...)` flags. We still want to be able to handle these,
though, so when necessary we now call rustc again to get crate-type
information for these cfg-ed crates.

8 years agoPurge deps, round 2
Tatsuyuki Ishi [Sat, 26 Aug 2017 14:36:13 +0000 (23:36 +0900)]
Purge deps, round 2

8 years agoAuto merge of #4435 - ishitatsuyuki:deps-purge, r=matklad
bors [Sat, 26 Aug 2017 10:01:15 +0000 (10:01 +0000)]
Auto merge of #4435 - ishitatsuyuki:deps-purge, r=matklad

Purge unused extern crates

8 years agoPurge unused extern crates
Tatsuyuki Ishi [Sat, 26 Aug 2017 09:59:51 +0000 (18:59 +0900)]
Purge unused extern crates

8 years agoAuto merge of #4433 - alexcrichton:unstable-features, r=matklad
bors [Fri, 25 Aug 2017 16:02:02 +0000 (16:02 +0000)]
Auto merge of #4433 - alexcrichton:unstable-features, r=matklad

Add infrastructure for nightly features and flags

This PR starts adding infrastructure in Cargo for nightly features and nightly flags. The current design looks like:

* There's a new `package.cargo-features` manifest key which accepts an array of strings. This array of strings is the list of enabled Cargo features for that crate.
* A new suite of flags behind `-Z`, like the compiler, are accepted on the command line for all commands.
* Features and unstable flags in Cargo are required to be used on Cargo's nightly channel, which is the same as Rust's nightly channel.
* Features and unstable flags cannot be used on the stable/beta channels of Rust/Cargo.
* Crates which enable features in their manifest are disallowed from being published to crates.io

The motivation behind this support is unblock a number of efforts in Cargo by allowing them to safely get implemented behind a nightly feature gate. Once behind a feature gate they can iterate in-tree without having to worry about "insta stability" and we can also get valuable usage feedback about upstream users.

Closes https://github.com/rust-lang/cargo/issues/4409

8 years agoAdd infrastructure for nightly Cargo flags
Alex Crichton [Thu, 24 Aug 2017 22:04:46 +0000 (15:04 -0700)]
Add infrastructure for nightly Cargo flags

8 years agoAdd support for nightly features in Cargo
Alex Crichton [Thu, 24 Aug 2017 19:54:57 +0000 (12:54 -0700)]
Add support for nightly features in Cargo

8 years agoAuto merge of #4431 - vignesh-sankaran:maintenance-badge-docs, r=alexcrichton
bors [Thu, 24 Aug 2017 13:56:50 +0000 (13:56 +0000)]
Auto merge of #4431 - vignesh-sankaran:maintenance-badge-docs, r=alexcrichton

Add maintenance badge docs

Pending merging of [this PR for crates.io](https://github.com/rust-lang/crates.io/pull/952). This should close off [#704 on crates.io](https://github.com/rust-lang/crates.io/issues/704). I've also updated the badge metadata docs and reordered the fields into groups by build, code coverage, and maintenance.

So I've decided to put the list of possible badge options in the documentation, we'll have to find another place to put more detailed descriptions of the available maintenance badges.

8 years agoAdded maintenance badge and reordered badge metadata fields
Vignesh [Thu, 24 Aug 2017 05:33:52 +0000 (15:33 +1000)]
Added maintenance badge and reordered badge metadata fields

8 years agoAuto merge of #4432 - potocpav:patch-1, r=matklad
bors [Thu, 24 Aug 2017 09:39:40 +0000 (09:39 +0000)]
Auto merge of #4432 - potocpav:patch-1, r=matklad

Correct a paragraph

The previous formulation was incorrect in the descriptions of the `x` and `y` version numbers.

8 years agoCorrect an inaccuracy
Pavel Potocek [Thu, 24 Aug 2017 09:22:09 +0000 (11:22 +0200)]
Correct an inaccuracy

8 years agoAuto merge of #4429 - ishitatsuyuki:test-purge, r=matklad
bors [Thu, 24 Aug 2017 09:01:00 +0000 (09:01 +0000)]
Auto merge of #4429 - ishitatsuyuki:test-purge, r=matklad

cargotest: purge deps

Blocking rust-lang/rust#42588.

8 years agoCorrect and reword a paragraph
Pavel Potocek [Thu, 24 Aug 2017 08:52:12 +0000 (10:52 +0200)]
Correct and reword a paragraph

The previous formulation was incorrect in the descriptions of the `x` and `y` version numbers.

8 years agocargotest: purge deps
Tatsuyuki Ishi [Thu, 24 Aug 2017 03:56:47 +0000 (12:56 +0900)]
cargotest: purge deps

8 years agoAuto merge of #4424 - Xanewok:process-builder-api, r=alexcrichton
bors [Tue, 22 Aug 2017 15:26:56 +0000 (15:26 +0000)]
Auto merge of #4424 - Xanewok:process-builder-api, r=alexcrichton

Add `fn args_replace` and `fn get_program` to `ProcessBuilder`

`Executor::exec()` provides a `ProcessBuilder` argument representing compiler call and if someone wants to use it or modify it for their own purposes, they have to (partially) recreate it themselves.

This:
* makes the argument modification possible (via `args_replace`, analogous to `env_remove`)
* exposes the program that will be run (via `get_program`, in case `rustc` is overriden via wrapper etc.).

r? @alexcrichton

8 years agoAdd `fn args_replace` and `fn get_program` to `ProcessBuilder`
Igor Matuszewski [Tue, 22 Aug 2017 15:13:00 +0000 (17:13 +0200)]
Add `fn args_replace` and `fn get_program` to `ProcessBuilder`

8 years agoAuto merge of #4416 - Xanewok:more-executor-params, r=alexcrichton
bors [Sun, 20 Aug 2017 18:35:22 +0000 (18:35 +0000)]
Auto merge of #4416 - Xanewok:more-executor-params, r=alexcrichton

Expose `Target` and `Unit` params to appropriate `Executor` callbacks

This effectively does only two things:
* Pass existing `&Unit` to `init()`
* Pass existing `&Target` to `exec()`s

Also updated doc comments slightly.

The `init()` is called for every `Work` preparation by `rustc()` and since it's not called once (not sure if intended?), it'd be good to include more information for which `Unit` the `rustc` process invocation has been initially prepared (I think more importantly it shows that `init()` is called many times for many targets).
Additionally, it'd be good to know about `Unit` compiled in the `exec()` callbacks in more structured manner (so the user doesn't have to parse the `ProcessBuilder` arguments and/or make certain assumptions) and since `target` was already cloned and moved into the closure, it was only a matter of exposing it.

I think it'd be ideal to provide all the necessary information to recreate a `Unit` but with a static lifetime needed for the closure, however this would mean cloning more data per-target ([`Kind`](https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_rustc/mod.rs#L41) should be basically free, however not sure if cloning [`Profile`](https://github.com/rust-lang/cargo/blob/master/src/cargo/core/manifest.rs#L151) is acceptable). With this, `Executor` users could query `Context` more easily (e.g. to get a unit dep graph! :smile:), as the API accepts `Unit`s in many places.

r? @alexcrichton
cc @nrc

EDIT:
This changes the public API, not sure if there's something else I should do about it, only ran `cargo test` locally.

8 years agoAuto merge of #4364 - RalfJung:feat, r=alexcrichton
bors [Sun, 20 Aug 2017 12:57:50 +0000 (12:57 +0000)]
Auto merge of #4364 - RalfJung:feat, r=alexcrichton

Required dependencies are not features

Also, while I was at it, I fixed an error message which complained about something not being an optional dependency, when really what mattered was that it was not a dependency at all.

I made a bunch of guesses about how things work. These guesses ended up as comments in the commit (so hopefully, the next reader of these files has to guess less). I am not totally certain these comments are all correct, so please yell if not. :)

In particular, for resolve_features, I observed that dependencies get compiled even when they are not returned from that function. But judging from how the function used to behave, it actually returns all dependencies, even those that have nothing to do with any features. (Making the name rather misleading, TBH...)

Fixes #4363

8 years agoExpose `Target` and `Unit` params to appropriate `Executor` callbacks
Igor Matuszewski [Sat, 19 Aug 2017 20:47:19 +0000 (22:47 +0200)]
Expose `Target` and `Unit` params to appropriate `Executor` callbacks

8 years agofix borrowing the shell twice
Ralf Jung [Fri, 18 Aug 2017 18:10:34 +0000 (20:10 +0200)]
fix borrowing the shell twice

8 years agoUsing required dep as a feature is a warning for now, not an error
Ralf Jung [Fri, 18 Aug 2017 17:37:12 +0000 (19:37 +0200)]
Using required dep as a feature is a warning for now, not an error

8 years agoAuto merge of #4400 - behnam:pr4157, r=alexcrichton
bors [Thu, 17 Aug 2017 23:09:50 +0000 (23:09 +0000)]
Auto merge of #4400 - behnam:pr4157, r=alexcrichton

[check|build|rustc] Add --all-targets option

`cargo check` does not check all targets by default, and to check all,
you need to call it `cargo check --tests --examples --bins --benches`.

Here, we implement `--all-targets` For `check`, `build`, and `rustc`.

For consitency, `--all-targets` is also added to other commands like
`test` although "all targets" is the default behavior.

This is a rebase of <https://github.com/rust-lang/cargo/pull/4157>

8 years agoimprove misleading error message
Ralf Jung [Sat, 5 Aug 2017 04:27:26 +0000 (21:27 -0700)]
improve misleading error message

8 years agodetect required dependencies used as features
Ralf Jung [Sat, 5 Aug 2017 04:21:09 +0000 (21:21 -0700)]
detect required dependencies used as features

8 years agotest for mandatory dependencies not to be considered features
Ralf Jung [Sat, 5 Aug 2017 03:21:38 +0000 (20:21 -0700)]
test for mandatory dependencies not to be considered features

8 years agoAuto merge of #4404 - parkovski:master, r=alexcrichton
bors [Mon, 14 Aug 2017 23:23:05 +0000 (23:23 +0000)]
Auto merge of #4404 - parkovski:master, r=alexcrichton

Fix #4370 - init panic in C:\ or /

This fixes the crash in this issue, but the error message is strange - unable to create directory 'C:\\.'. I don't have write permissions there without becoming admin, so I suspect it's just a permission issue, but the weird error can be fixed by calling Path::canonicalize on line 300.

8 years agoFix #4370 - init panic in C:\ or /
Parker Snell [Mon, 14 Aug 2017 18:02:07 +0000 (11:02 -0700)]
Fix #4370 - init panic in C:\ or /

8 years agoAuto merge of #4402 - bluss:doc-rustdocflags, r=alexcrichton
bors [Sun, 13 Aug 2017 12:40:53 +0000 (12:40 +0000)]
Auto merge of #4402 - bluss:doc-rustdocflags, r=alexcrichton

Document `RUSTDOCFLAGS`

Documentation for this environment variable was missing. It's supported in stable releases of Rust already.

8 years agoDocument `RUSTDOCFLAGS`
bluss [Sun, 13 Aug 2017 12:27:27 +0000 (14:27 +0200)]
Document `RUSTDOCFLAGS`

8 years agoAuto merge of #4389 - matklad:testless, r=alexcrichton
bors [Sat, 12 Aug 2017 22:08:54 +0000 (22:08 +0000)]
Auto merge of #4389 - matklad:testless, r=alexcrichton

Allow to skip test code during publishing

closes #4365

I don't have time to review this code carefully right now, but looks like it does the job.

8 years agoAllow to skip test code during publishing
Aleksey Kladov [Wed, 9 Aug 2017 21:54:09 +0000 (00:54 +0300)]
Allow to skip test code during publishing

8 years agoAuto merge of #4393 - burtonageo:update-cargo-new-template, r=matklad
bors [Sat, 12 Aug 2017 14:46:51 +0000 (14:46 +0000)]
Auto merge of #4393 - burtonageo:update-cargo-new-template, r=matklad

Update lib template for `cargo new` so that the placeholder test contains an assertion

When you run `rustfmt` on the default generated lib template, it modifies it as shown [here](https://play.rust-lang.org/?gist=bd44610731e26e76719e75d47e598990&version=undefined)

8 years ago[check|build|rustc] Add --all-targets option
Stepan Koltsov [Fri, 11 Aug 2017 01:46:07 +0000 (18:46 -0700)]
[check|build|rustc] Add --all-targets option

`cargo check` does not check all targets by default, and to check all,
you need to call it `cargo check --tests --examples --bins --benches`.

Here, we implement `--all-targets` For `check`, `build`, and `rustc`.

For consitency, `--all-targets` is also added to other commands like
`test` although "all targets" is the default behavior.

This is a rebase of <https://github.com/rust-lang/cargo/pull/4157>

8 years agoAuto merge of #4398 - debris:url_4394, r=alexcrichton
bors [Fri, 11 Aug 2017 17:12:45 +0000 (17:12 +0000)]
Auto merge of #4398 - debris:url_4394, r=alexcrichton

Fixed panic when canonicalizing not-a-base-url, fixes #4394

Fixes #4394. Majority of the changes are caused by propagating error upstream to `SourceId` and `GitSource`.

8 years agoFix implementation and tests for cannot-be-a-base-url canonicalization
debris [Fri, 11 Aug 2017 15:39:18 +0000 (17:39 +0200)]
Fix implementation and tests for cannot-be-a-base-url canonicalization

8 years agoFixed panic when canonicalizing not-a-base-url, fixes #4394
debris [Fri, 11 Aug 2017 14:25:19 +0000 (16:25 +0200)]
Fixed panic when canonicalizing not-a-base-url, fixes #4394

8 years agoAuto merge of #4396 - vignesh-sankaran:documentation-blacklist-list-fix, r=matklad
bors [Fri, 11 Aug 2017 07:28:15 +0000 (07:28 +0000)]
Auto merge of #4396 - vignesh-sankaran:documentation-blacklist-list-fix, r=matklad

Fix list rendering in manifest.md

Fixes a list rendering problem introduced in #4237.

8 years agoFix list rendering for blacklisted hosts
Vignesh [Fri, 11 Aug 2017 05:18:21 +0000 (15:18 +1000)]
Fix list rendering for blacklisted hosts

8 years agoAdd a placeholder assertion in the new lib project template
George Burton [Thu, 10 Aug 2017 22:30:33 +0000 (23:30 +0100)]
Add a placeholder assertion in the new lib project template

8 years agoFix tests
George Burton [Thu, 10 Aug 2017 21:19:41 +0000 (22:19 +0100)]
Fix tests

8 years agoUpdate lib template for `cargo new` so that it conforms to rustfmt style by default
George Burton [Thu, 10 Aug 2017 20:50:41 +0000 (21:50 +0100)]
Update lib template for `cargo new` so that it conforms to rustfmt style by default

8 years agoAuto merge of #4390 - alexcrichton:read-hard-links, r=matklad
bors [Thu, 10 Aug 2017 09:04:21 +0000 (09:04 +0000)]
Auto merge of #4390 - alexcrichton:read-hard-links, r=matklad

Use `same-file` to avoid unnecessary hard links

This is targeted at removing the need for a workaround in rust-lang/rust#39518,
allowing the main rust build system to move back to hard links which should be
much more efficient.

8 years agoAuto merge of #4386 - pornel:backups, r=alexcrichton
bors [Thu, 10 Aug 2017 05:11:28 +0000 (05:11 +0000)]
Auto merge of #4386 - pornel:backups, r=alexcrichton

Exclude target directory from Time Machine

Fixes #3884

8 years agoExclude target directory from Time Machine
Kornel [Wed, 9 Aug 2017 14:41:53 +0000 (15:41 +0100)]
Exclude target directory from Time Machine

Temporary/derived files outside dedicated system directories should be explicitly excluded from backups to prevent undesirable bloat and churn.

8 years agoUse `same-file` to avoid unnecessary hard links
Alex Crichton [Thu, 10 Aug 2017 00:22:34 +0000 (17:22 -0700)]
Use `same-file` to avoid unnecessary hard links

This is targeted at removing the need for a workaround in rust-lang/rust#39518,
allowing the main rust build system to move back to hard links which should be
much more efficient.

8 years agoAuto merge of #4384 - ivanbakel:unused_mut, r=alexcrichton
bors [Wed, 9 Aug 2017 17:42:20 +0000 (17:42 +0000)]
Auto merge of #4384 - ivanbakel:unused_mut, r=alexcrichton

Fixed some variables being unnecessarily mutable

### Changes

Some variables are marked `mut` when they don't need to be. This PR changes those variables to no longer be `mut`.

### Context

PR on https://github.com/rust-lang/rust/pull/43582

tl:dr; There's a bug with the mutability checker that sometimes marks mutable ref variables as being used when they're not.

8 years agoAuto merge of #4382 - Xanewok:expose-filter-rule, r=alexcrichton
bors [Wed, 9 Aug 2017 16:30:21 +0000 (16:30 +0000)]
Auto merge of #4382 - Xanewok:expose-filter-rule, r=alexcrichton

Expose ops::cargo_compile::FilterRule

I've been mindlessly copying and consuming the Cargo API to work on the build plan prototype for RLS and I noticed that, it seems, pub `ops::cargo_compile::CompileFilter` is exported, but not the `ops::cargo_compile::FilterRule`, which `CompileFilter` uses, as a part of a public API.

If I'm wrong and missing something, feel free to ignore/close it. It was possible to match/destructure `CompileFilter` before, but with this change it's possible to use the underlying type.