]> git.proxmox.com Git - cargo.git/log
cargo.git
6 years agoLet Context store BuildConfig by reference
Dirkjan Ochtman [Sat, 14 Apr 2018 09:37:13 +0000 (11:37 +0200)]
Let Context store BuildConfig by reference

6 years agoAuto merge of #5447 - ehuss:ws-error-message, r=alexcrichton
bors [Tue, 1 May 2018 13:50:13 +0000 (13:50 +0000)]
Auto merge of #5447 - ehuss:ws-error-message, r=alexcrichton

Better error message for `cargo rustc` in a workspace.

Fixes #5371

6 years agoAuto merge of #5448 - ehuss:debug_env, r=alexcrichton
bors [Tue, 1 May 2018 03:49:32 +0000 (03:49 +0000)]
Auto merge of #5448 - ehuss:debug_env, r=alexcrichton

Fix "DEBUG" env var in build.rs for debug=0

Fixes #5370

6 years agoBetter error message for `cargo rustc` in a workspace.
Eric Huss [Tue, 1 May 2018 03:39:07 +0000 (20:39 -0700)]
Better error message for `cargo rustc` in a workspace.

Fixes #5371

6 years agoAuto merge of #5443 - rtsuk:update-doc-env-var, r=alexcrichton
bors [Mon, 30 Apr 2018 18:19:47 +0000 (18:19 +0000)]
Auto merge of #5443 - rtsuk:update-doc-env-var, r=alexcrichton

Update documentation on config via environment variables

Use source replacement as a specific example of the kind
of configuration feature that cannot currently be set by
environmental variables.

6 years agoAuto merge of #5300 - djc:namespaced-features, r=alexcrichton
bors [Mon, 30 Apr 2018 17:52:35 +0000 (17:52 +0000)]
Auto merge of #5300 - djc:namespaced-features, r=alexcrichton

Introduction of namespaced features (see #1286)

I think this basically covers all of the plans from #1286, although it still needs a bunch of tests and documentation updates. Submitting this PR to get some early feedback on the direction.

6 years agoFix "DEBUG" env var in build.rs for debug=0.
Eric Huss [Mon, 30 Apr 2018 17:17:43 +0000 (10:17 -0700)]
Fix "DEBUG" env var in build.rs for debug=0.

Fixes #5370

6 years agoUpdate documentation on config via environment variables
Rob Tsuk [Mon, 30 Apr 2018 15:49:27 +0000 (08:49 -0700)]
Update documentation on config via environment variables

Use source replacement as a specific example of the kind
of configuration feature that cannot currently be set by
environmental variables.

6 years agoPut namespaced features behind a feature gate
Dirkjan Ochtman [Mon, 30 Apr 2018 08:42:52 +0000 (10:42 +0200)]
Put namespaced features behind a feature gate

6 years agoAuto merge of #5430 - matklad:bring-old-features-back, r=alexcrichton
bors [Sat, 28 Apr 2018 18:02:36 +0000 (18:02 +0000)]
Auto merge of #5430 - matklad:bring-old-features-back, r=alexcrichton

Revert "Enable new behavior of `--feature`"

This reverts commit 038eec5cb3bd25a0855b0be6ad2aeba5391c6c6e.

As discussed at https://github.com/rust-lang/cargo/issues/5364, the new behavior unfortunately causes real-life breakage, so we have to revert it.

This is kinda sad, this is a part of the larger issue with feature selection, which, at the moment, has a behavior which I would classify (loosely speaking) as unsound:

* `cargo build -p foo` and `cargo build -p foo -p bar` might produce different artifacts for `foo` ([repro](https://github.com/matklad/workspace-vs-feaures))
* `cargo build -p foo` might produce different artifacts, depending on cwd ([repro](https://github.com/matklad/features-cwd))

The new feature behavior specifically addressed the second point.

It is unclear what we could do with this... One option, instead of flatly erroring out, as the revreted commit does, is to print a warning, but change the set of activated features. It will still be a breaking change, but it at least has  a chance of working by accident.

r? @alexcrichton

6 years agoAuto merge of #5425 - matklad:rename-fingerprint, r=alexcrichton
bors [Sat, 28 Apr 2018 16:44:31 +0000 (16:44 +0000)]
Auto merge of #5425 - matklad:rename-fingerprint, r=alexcrichton

Package renames should affect fingerprints

6 years agoAuto merge of #5428 - matklad:graph-with-edges, r=alexcrichton
bors [Sat, 28 Apr 2018 16:10:39 +0000 (16:10 +0000)]
Auto merge of #5428 - matklad:graph-with-edges, r=alexcrichton

Store dependencies as edges of the graph

r? @alexcrichton

6 years agoAuto merge of #5429 - matklad:dashes-test, r=matklad
bors [Sat, 28 Apr 2018 14:59:21 +0000 (14:59 +0000)]
Auto merge of #5429 - matklad:dashes-test, r=matklad

Extend dashes forwarding test

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

Looks like this was fixed when we've transitioned to clap!

6 years agoExtend dashes forwarding test
Aleksey Kladov [Sat, 28 Apr 2018 14:57:03 +0000 (17:57 +0300)]
Extend dashes forwarding test

6 years agoRevert "Enable new behavior of `--feature`"
Aleksey Kladov [Sat, 28 Apr 2018 14:28:39 +0000 (17:28 +0300)]
Revert "Enable new behavior of `--feature`"

This reverts commit 038eec5cb3bd25a0855b0be6ad2aeba5391c6c6e.

6 years agoStore dependencies as edges of the graph
Aleksey Kladov [Sat, 28 Apr 2018 12:59:27 +0000 (15:59 +0300)]
Store dependencies as edges of the graph

6 years agoAdd some documentation about unstable namespaced-features feature
Dirkjan Ochtman [Mon, 23 Apr 2018 07:18:08 +0000 (09:18 +0200)]
Add some documentation about unstable namespaced-features feature

6 years agoAdd tests for namespaced features
Dirkjan Ochtman [Wed, 18 Apr 2018 10:12:43 +0000 (12:12 +0200)]
Add tests for namespaced features

6 years agoTake feature namespace into account while building summary (fixes #1286)
Dirkjan Ochtman [Thu, 5 Apr 2018 14:59:51 +0000 (16:59 +0200)]
Take feature namespace into account while building summary (fixes #1286)

Here's an attempt at a table to cover the different cases:

Feature
    Old (must be in features table)
        Continue
    Namespaced (might be stray value)
        In features table: Check that Crate dependency is in the list
        -> Non-optional dependency: Bail [PREVIOUSLY: bailed for non-optional dependency]
        -> Optional dependency: Insert feature of this name
        -> Else: Bail [PREVIOUSLY: bailed for unknown dependency or feature]

Crate
    Old (might be stray value)
        Non-optional dependency: Bail
        No dependency found: Bail
    Namespaced
        Non-optional dependency: Bail
        No dependency found: Bail

CrateFeature
    Old
        No dependency found: Bail
    Namespaced
        No dependency found: Bail

6 years agoKeep track of namespaced-features flag in Summary objects
Dirkjan Ochtman [Mon, 2 Oct 2017 09:00:18 +0000 (11:00 +0200)]
Keep track of namespaced-features flag in Summary objects

For now, all Summaries from a registry have it set to false.

6 years agoAdd namespaced-features option for manifest [project] section
Dirkjan Ochtman [Mon, 2 Oct 2017 07:30:22 +0000 (09:30 +0200)]
Add namespaced-features option for manifest [project] section

6 years agoMake a dependencies map while building feature map
Dirkjan Ochtman [Thu, 5 Apr 2018 14:23:11 +0000 (16:23 +0200)]
Make a dependencies map while building feature map

6 years agoSimplify retrieval of dependency data
Dirkjan Ochtman [Thu, 5 Apr 2018 13:22:37 +0000 (15:22 +0200)]
Simplify retrieval of dependency data

6 years agoMix package renames into fingerprints
Aleksey Kladov [Sat, 28 Apr 2018 10:35:49 +0000 (13:35 +0300)]
Mix package renames into fingerprints

6 years agoAuto merge of #5384 - ehuss:profile-override, r=matklad
bors [Fri, 27 Apr 2018 23:22:50 +0000 (23:22 +0000)]
Auto merge of #5384 - ehuss:profile-override, r=matklad

Profile Overrides (RFC #2282 Part 1)

Profile Overrides (RFC #2282 Part 1)

WIP: Putting this up before I dig into writing tests, but should be mostly complete.  I also have a variety of questions below.

This implements the ability to override profiles for dependencies and build scripts.  This includes a general rework of how profiles work internally. Closes #5298.

Profile overrides are available with `profile-overrides` set in `cargo-features` in the manifest.

Part 2 is to implement profiles in config files (to be in a separate PR).

General overview of changes:

- `Profiles` moved to `core/profiles.rs`. All profile selection is centralized there.
- Removed Profile flags `test`, `doc`, `run_custom_build`, and `check`.
- Removed `Profile` from `Unit` and replaced it with two enums: `CompileMode` and `ProfileFor`.  This is the minimum information needed to compute profiles at a later stage.
- Also removed `rustc_args`/`rustdoc_args` from `Profile` and place them in `Context`.  This is currently not very elegant because it is a special case, but it works. An alternate solution I considered was to leave them in the `Profile` and add a special uber-override layer.  Let me know if you think it should change.
- Did some general cleanup in `generate_targets`.

## Misc Fixes
- `cargo check` now honors the `--release` flag.  Fixes #5218.
- `cargo build --test` will set `panic` correctly for dependences. Fixes #5369.
- `cargo check --tests` will no longer include bins twice (once as a normal check, once as a `--test` check).  It only does `--test` check now.
    - Similarly, `cargo check --test name` no longer implicitly checks bins.
- Examples are no longer considered a "test".  (See #5397). Consequences:
    - `cargo test` will continue to build examples as a regular build (no change).
    - `cargo test --tests` will no longer build examples at all.
    - `cargo test --all-targets` will no longer build examples as tests, but instead build them as a regular build (now matches `cargo test` behavior).
    - `cargo check --all-targets` will no longer check examples twice (once as
      normal, once as `--test`).  It now only checks it once as a normal
      target.

## Questions
- Thumbs up/down on the general approach?
- The method to detect if a package is a member of a workspace should probably be redone.  I'm uncertain of the best approach.  Maybe `Workspace.members` could be a set?
- `Hash` and `PartialEq` are implemented manually for `Profile` only to avoid matching on the `name` field.  The `name` field is only there for debug purposes. Is it worth it to keep `name`?  Maybe useful for future use (like #4140)?
- I'm unhappy with the `Finished` line summary that displays `[unoptimized + debuginfo]`.  It doesn't actually show what was compiled.  Currently it just picks the base "dev" or "release" profile.  I'm not sure what a good solution is (to be accurate it would need to potentially display a list of different options).  Is it ok?  (See also #4140 for the wrong profile name being printed.)
- Build-dependencies use different profiles based on whether or not `--release` flag is given.  This means that if you want build-dependencies to always use a specific set of settings, you have to specify both `[profile.dev.build_override]` and `[profile.release.build_override]`.  Is that reasonable (for now)?  I've noticed some issues (like #1774, #2234, #2424) discussing having more control over how build-dependencies are handled.
- `build --bench xxx` or `--benches` builds dependencies with dev profile, which may be surprising.  `--release` does the correct thing.  Perhaps print a warning when using `cargo build` that builds benchmark deps in dev mode?
- Should it warn/error if you have an override for a package that does not exist?
- Should it warn/error if you attempt to set `panic` on the `test` or `bench` profile?

## TODO
- I have a long list of tests to add.
- Address a few "TODO" comments left behind.

6 years agoMinor style update.
Eric Huss [Fri, 27 Apr 2018 18:23:57 +0000 (11:23 -0700)]
Minor style update.

6 years agoComment why `deps_of` doesn't need to keep track of `profile_for` in map.
Eric Huss [Tue, 24 Apr 2018 17:35:20 +0000 (10:35 -0700)]
Comment why `deps_of` doesn't need to keep track of `profile_for` in map.

6 years agoFix Unit/Context parameter order.
Eric Huss [Tue, 24 Apr 2018 17:12:53 +0000 (10:12 -0700)]
Fix Unit/Context parameter order.

6 years agoAvoid building libs and bins twice in `cargo build --all-targets --release`.
Eric Huss [Sun, 22 Apr 2018 20:57:38 +0000 (13:57 -0700)]
Avoid building libs and bins twice in `cargo build --all-targets --release`.

This changes it so that `Build` mode is not set in the Unit, since there is
no difference between Bench and Test once the profile has been selected.

6 years agoUpdate tests now that `cargo check` does not re-check bins.
Eric Huss [Sun, 22 Apr 2018 16:05:18 +0000 (09:05 -0700)]
Update tests now that `cargo check` does not re-check bins.

6 years agoAdd some more tests.
Eric Huss [Sun, 22 Apr 2018 00:21:42 +0000 (17:21 -0700)]
Add some more tests.

6 years agoAdd thorough tests for target/profile selection.
Eric Huss [Sat, 21 Apr 2018 20:57:54 +0000 (13:57 -0700)]
Add thorough tests for target/profile selection.

6 years agoMove profile override tests to a dedicated file.
Eric Huss [Sat, 21 Apr 2018 20:47:01 +0000 (13:47 -0700)]
Move profile override tests to a dedicated file.

6 years agorustfmt
Eric Huss [Sat, 21 Apr 2018 19:16:03 +0000 (12:16 -0700)]
rustfmt

6 years agoRemove last TODO comments.
Eric Huss [Sat, 21 Apr 2018 18:18:05 +0000 (11:18 -0700)]
Remove last TODO comments.

6 years agoSome test cleanup for profiles.
Eric Huss [Sat, 21 Apr 2018 17:41:05 +0000 (10:41 -0700)]
Some test cleanup for profiles.

6 years agoAdd more profile override validation tests.
Eric Huss [Sat, 21 Apr 2018 17:03:23 +0000 (10:03 -0700)]
Add more profile override validation tests.

6 years agoAdd test for profile override on non-dev/release.
Eric Huss [Sat, 21 Apr 2018 16:50:55 +0000 (09:50 -0700)]
Add test for profile override on non-dev/release.

6 years agoAdd warning if `panic` is set in test or bench profile.
Eric Huss [Sat, 21 Apr 2018 16:40:00 +0000 (09:40 -0700)]
Add warning if `panic` is set in test or bench profile.

6 years agoAdd warnings for unknown profile overrides.
Eric Huss [Sat, 21 Apr 2018 05:19:16 +0000 (22:19 -0700)]
Add warnings for unknown profile overrides.

6 years agoMinor tweaks on how examples are handled with tests, and some panic propagation.
Eric Huss [Sat, 21 Apr 2018 02:43:57 +0000 (19:43 -0700)]
Minor tweaks on how examples are handled with tests, and some panic propagation.

6 years agoAvoid running `build.rs` too often.
Eric Huss [Fri, 20 Apr 2018 20:20:38 +0000 (13:20 -0700)]
Avoid running `build.rs` too often.

6 years agoAdd extra rustc/rustdoc args to the fingerprint and metadata.
Eric Huss [Thu, 19 Apr 2018 02:54:01 +0000 (19:54 -0700)]
Add extra rustc/rustdoc args to the fingerprint and metadata.

6 years agoUpdate for some review comments.
Eric Huss [Thu, 19 Apr 2018 02:17:38 +0000 (19:17 -0700)]
Update for some review comments.

6 years agoFix a variety of profile bugs.
Eric Huss [Thu, 19 Apr 2018 00:21:03 +0000 (17:21 -0700)]
Fix a variety of profile bugs.

6 years agoMove `Profile` back into `Unit` as a copy.
Eric Huss [Wed, 18 Apr 2018 18:41:58 +0000 (11:41 -0700)]
Move `Profile` back into `Unit` as a copy.

The de-duplication of Units just doesn't work without it.

6 years agoMinor cleanup.
Eric Huss [Wed, 18 Apr 2018 14:03:17 +0000 (07:03 -0700)]
Minor cleanup.

6 years agoProfile Overrides (RFC #2282 Part 1)
Eric Huss [Wed, 18 Apr 2018 01:46:44 +0000 (18:46 -0700)]
Profile Overrides (RFC #2282 Part 1)

6 years agoAuto merge of #5415 - alexcrichton:rename-same-dep, r=matklad
bors [Fri, 27 Apr 2018 17:48:52 +0000 (17:48 +0000)]
Auto merge of #5415 - alexcrichton:rename-same-dep, r=matklad

Fix renaming crates as they come from 2 sources

Previously there was a verification in manifest parsing that the same dependency
must come from the same source, but this erroneously triggered an error to get
emitted when the `package` key was used to rename crates. The first change here
was to update that clause to key off the `rename` field rather than the `name`
field.

Afterwards, though, this exposed an existing bug in the implementation. During
compilation we have a `Resolve` which is a graph of crates, but we don't know
*why* each edge in the dependency graph exists. In other words we don't know,
when looking at an edge of the graph, what `Dependency` caused that edge to be
drawn. We need to know this when passing `--extern` flags because the
`Dependency` is what lists what's being renamed.

This commit then primarily refactors `Resolve::deps` from an iterator of package
ids to an iterator of a tuples. The first element is the package id from before
and the second element is a list of `Dependency` directives which caused the
edge to ber driven.

This refactoring cleaned up a few places in the backend where we had to work
around the lack of this knowledge. Namely this also fixes the extra test added
here.

Closes #5413

6 years agoFix renaming crates as they come from 2 sources
Alex Crichton [Wed, 25 Apr 2018 17:41:33 +0000 (10:41 -0700)]
Fix renaming crates as they come from 2 sources

Previously there was a verification in manifest parsing that the same dependency
must come from the same source, but this erroneously triggered an error to get
emitted when the `package` key was used to rename crates. The first change here
was to update that clause to key off the `rename` field rather than the `name`
field.

Afterwards, though, this exposed an existing bug in the implementation. During
compilation we have a `Resolve` which is a graph of crates, but we don't know
*why* each edge in the dependency graph exists. In other words we don't know,
when looking at an edge of the graph, what `Dependency` caused that edge to be
drawn. We need to know this when passing `--extern` flags because the
`Dependency` is what lists what's being renamed.

This commit then primarily refactors `Resolve::deps` from an iterator of package
ids to an iterator of a tuples. The first element is the package id from before
and the second element is a list of `Dependency` directives which caused the
edge to ber driven.

This refactoring cleaned up a few places in the backend where we had to work
around the lack of this knowledge. Namely this also fixes the extra test added
here.

Closes #5413

6 years agoAuto merge of #5349 - bmwill:fetch-by-target, r=alexcrichton
bors [Fri, 27 Apr 2018 15:36:16 +0000 (15:36 +0000)]
Auto merge of #5349 - bmwill:fetch-by-target, r=alexcrichton

cargo-fetch: add option to fetch for a target

Teach cargo-fetch how to optionally fetch dependencies based on a target
platform by specifying the target triple via `--target <TRIPLE>`.

#5216

6 years agoAuto merge of #5410 - klnusbaum:edition_5406, r=matklad
bors [Fri, 27 Apr 2018 15:14:03 +0000 (15:14 +0000)]
Auto merge of #5410 - klnusbaum:edition_5406, r=matklad

switch to using the --edition flag

Now that we have an `--edition` flag in the rust compiler, let's switch to using it.

fixes #5406

6 years agocargo-fetch: add option to fetch for a target
Brandon Williams [Mon, 9 Apr 2018 18:31:04 +0000 (11:31 -0700)]
cargo-fetch: add option to fetch for a target

Teach cargo-fetch how to optionally fetch dependencies based on a target
platform by specifying the target triple via `--target <TRIPLE>`.

Signed-off-by: Brandon Williams <bmwill@google.com>
6 years agoAuto merge of #5394 - henriklaxhuber:master, r=alexcrichton
bors [Tue, 24 Apr 2018 14:36:52 +0000 (14:36 +0000)]
Auto merge of #5394 - henriklaxhuber:master, r=alexcrichton

Pass linker path to build script

This change adds the environment variable LINKER to pass the path of the linker used by cargo to the build script. This complements the variable RUSTC (the rustc binary used) to give the build script full knowledge of its environment.

A specific usage example would be automatically generating bindings to system headers in cross compilation, e.g. by locating jni.h for android targets.

6 years agoAuto merge of #5393 - smithsps:master, r=matklad
bors [Tue, 24 Apr 2018 14:12:10 +0000 (14:12 +0000)]
Auto merge of #5393 - smithsps:master, r=matklad

Add target directory parameter --target-dir

Implements: https://github.com/rust-lang/cargo/issues/5308

Adds a target directory parameter, that acts in the same manner as the environment variable `CARGO_TARGET_DIR`, to the following subcommands:
- `bench`
- `build`
- `check`
- `clean`
- `doc`
- `package`
- `publish`
- `run`
- `rustc`
- `rustdoc`
- `test`

6 years agoAuto merge of #5398 - dwijnand:drop-legacy-paths, r=matklad
bors [Tue, 24 Apr 2018 09:07:18 +0000 (09:07 +0000)]
Auto merge of #5398 - dwijnand:drop-legacy-paths, r=matklad

Drop legacy path support under Rust edition 2018 (or later)

builds on #5335

submitted for early feedback: wdyt @matklad? is this what you had in mind? what should change? what should be added? how should we test this? is the current (2015) messaging enough to drop it in 2018?

r? @matklad

<!--{"baseBranch":"rust-lang:cargo:target-autodiscovery"}-->

6 years agoAdd target directory parameter: address suggestions
Simon Smith [Tue, 24 Apr 2018 06:15:55 +0000 (02:15 -0400)]
Add target directory parameter: address suggestions

6 years agoMoved RUSTC_LINKER test into its own fn
Henrik Laxhuber [Tue, 24 Apr 2018 06:18:33 +0000 (08:18 +0200)]
Moved RUSTC_LINKER test into its own fn

6 years agoAdd target directory parameter --target-dir
Simon Smith [Mon, 16 Apr 2018 23:50:30 +0000 (19:50 -0400)]
Add target directory parameter --target-dir

6 years agoFixed RUSTC_LINKER test for Windows hosts
Henrik Laxhuber [Mon, 23 Apr 2018 16:28:38 +0000 (18:28 +0200)]
Fixed RUSTC_LINKER test for Windows hosts

6 years agoFixed build script env var test
Henrik Laxhuber [Mon, 23 Apr 2018 15:45:17 +0000 (17:45 +0200)]
Fixed build script env var test

6 years agoAdded tests for RUSTC_LINKER buils script env var
Henrik Laxhuber [Mon, 23 Apr 2018 15:11:10 +0000 (17:11 +0200)]
Added tests for RUSTC_LINKER buils script env var

Added tests for the environment variable RUSTC_LINKER that is
passed to the build script.
Also slightly improved readability of the code responsible for
passing the env var.

6 years agoswitch to using the --edition flag
Kurtis Nusbaum [Sun, 22 Apr 2018 19:14:21 +0000 (12:14 -0700)]
switch to using the --edition flag

6 years agoAuto merge of #5407 - klausi:fixed-minimal-versions, r=matklad
bors [Sun, 22 Apr 2018 19:11:37 +0000 (19:11 +0000)]
Auto merge of #5407 - klausi:fixed-minimal-versions, r=matklad

fix(dependendies): Bump minimal dependency versions so that cargo successfully builds with those

Spin-off from #5275 .

Just bump the minimum dependency versions here, we are developing CI testing in #5275 .

6 years agofix(dependendies): Bump minimal dependency versions so that cargo successfully builds...
Klaus Purer [Sun, 22 Apr 2018 18:55:53 +0000 (20:55 +0200)]
fix(dependendies): Bump minimal dependency versions so that cargo successfully builds with those

6 years agoAuto merge of #5405 - dwijnand:contributing-lint-overrides, r=matklad
bors [Sun, 22 Apr 2018 16:38:01 +0000 (16:38 +0000)]
Auto merge of #5405 - dwijnand:contributing-lint-overrides, r=matklad

Detail how to override lint warnings when compiling tests

alternative to #5403

6 years agoDetail how to override lint warnings when compiling tests
Dale Wijnand [Sun, 22 Apr 2018 16:35:47 +0000 (17:35 +0100)]
Detail how to override lint warnings when compiling tests

6 years agoAuto merge of #5404 - matklad:remove-useless-nightly, r=matklad
bors [Sun, 22 Apr 2018 15:26:44 +0000 (15:26 +0000)]
Auto merge of #5404 - matklad:remove-useless-nightly, r=matklad

Remove some `is_nightly` checks from tests

6 years agoRemove some `is_nightly` checks from tests
Aleksey Kladov [Sun, 22 Apr 2018 15:06:21 +0000 (18:06 +0300)]
Remove some `is_nightly` checks from tests

6 years agoAuto merge of #5400 - kornelski:master, r=alexcrichton
bors [Sat, 21 Apr 2018 19:57:10 +0000 (19:57 +0000)]
Auto merge of #5400 - kornelski:master, r=alexcrichton

Docs: rename gcc-rs → cc-rs

6 years agoDocs: rename gcc-rs → cc-rs
Kornel [Sat, 21 Apr 2018 19:40:59 +0000 (20:40 +0100)]
Docs: rename gcc-rs → cc-rs

6 years agoDrop legacy path support under Rust edition 2018 (or later)
Dale Wijnand [Sat, 21 Apr 2018 14:08:40 +0000 (15:08 +0100)]
Drop legacy path support under Rust edition 2018 (or later)

6 years agoAdded missing file extension
Henrik Laxhuber [Sat, 21 Apr 2018 16:43:03 +0000 (18:43 +0200)]
Added missing file extension

6 years agoChanged LINKER env var to RUSTC_LINKER, improved docs
Henrik Laxhuber [Sat, 21 Apr 2018 16:41:41 +0000 (18:41 +0200)]
Changed LINKER env var to RUSTC_LINKER, improved docs

6 years agoAuto merge of #5335 - dwijnand:target-autodiscovery, r=alexcrichton
bors [Sat, 21 Apr 2018 16:10:13 +0000 (16:10 +0000)]
Auto merge of #5335 - dwijnand:target-autodiscovery, r=alexcrichton

Introduce autoXXX keys for target auto-discovery

In Rust 2015 absence of the configuration makes it default to not
include auto-discovered targets (i.e false), with a warnings message.

In Rust 2018 absence makes it default to include auto-discovered
targets (i.e true).

Fixes #5330

---

_original_

Fixes #5330

submitted for early review. feedback very welcome, I'm happy to iterate (and learn).

in particular I require assistance with the borrowing of `warnings` in `clean_benches`.

6 years agoAuto merge of #5399 - dwijnand:cleanup/drop-an-old-visible-doc-todo, r=matklad
bors [Sat, 21 Apr 2018 14:51:24 +0000 (14:51 +0000)]
Auto merge of #5399 - dwijnand:cleanup/drop-an-old-visible-doc-todo, r=matklad

Drop an old visible doc TODO

Looks like this originates from
https://github.com/istankovic/cargo-book/commit/418611304daac22e3590aee9322355ae159802fe

But it's even visible in the render docs:
https://doc.rust-lang.org/cargo/reference/manifest.html#package-selection
:-O

6 years agoDrop an old visible doc TODO
Dale Wijnand [Sat, 21 Apr 2018 14:17:24 +0000 (15:17 +0100)]
Drop an old visible doc TODO

Looks like this originates from
https://github.com/istankovic/cargo-book/commit/418611304daac22e3590aee9322355ae159802fe

But it's even visible in the render docs:
https://doc.rust-lang.org/cargo/reference/manifest.html#package-selection
:-O

6 years agoAdded documentation for LINKER environment variable
Henrik Laxhuber [Sat, 21 Apr 2018 07:24:31 +0000 (09:24 +0200)]
Added documentation for LINKER environment variable

This commit amends the documentation on environment variables to
reflect the proposed LINKER variable.

6 years agobacktick auto-discovery key usage advice
Dale Wijnand [Fri, 20 Apr 2018 21:23:08 +0000 (22:23 +0100)]
backtick auto-discovery key usage advice

6 years agomanually line wrap warnings at 80 characters
Dale Wijnand [Fri, 20 Apr 2018 21:22:41 +0000 (22:22 +0100)]
manually line wrap warnings at 80 characters

6 years agoprefer PathBuf::display over {:?}
Dale Wijnand [Fri, 20 Apr 2018 21:21:33 +0000 (22:21 +0100)]
prefer PathBuf::display over {:?}

6 years agoavoid windows path assertion bug
Dale Wijnand [Fri, 20 Apr 2018 21:20:31 +0000 (22:20 +0100)]
avoid windows path assertion bug

6 years agoAuto merge of #5396 - dwijnand:arg_targets_all-typos, r=matklad
bors [Fri, 20 Apr 2018 20:33:06 +0000 (20:33 +0000)]
Auto merge of #5396 - dwijnand:arg_targets_all-typos, r=matklad

fix typos in arg_targets_all

None

6 years agofix typos in arg_targets_all
Dale Wijnand [Fri, 20 Apr 2018 19:00:57 +0000 (20:00 +0100)]
fix typos in arg_targets_all

6 years agoIntroduce autoXXX keys for target auto-discovery
Dale Wijnand [Mon, 16 Apr 2018 22:19:42 +0000 (00:19 +0200)]
Introduce autoXXX keys for target auto-discovery

In Rust 2015 absence of the configuration makes it default to not
include auto-discovered targets (i.e false), with a warnings message.

In Rust 2018 absence makes it default to include auto-discovered
targets (i.e true).

Fixes #5330

6 years agoExtract toml_targets_and_inferred & inferred_to_toml_targets
Dale Wijnand [Mon, 16 Apr 2018 22:13:14 +0000 (00:13 +0200)]
Extract toml_targets_and_inferred & inferred_to_toml_targets

6 years agoIncrease scope nesting to borrow
Dale Wijnand [Mon, 16 Apr 2018 22:17:57 +0000 (00:17 +0200)]
Increase scope nesting to borrow

6 years agoMove edition earlier in TomlManifest::to_real_manifest
Dale Wijnand [Tue, 10 Apr 2018 07:22:29 +0000 (08:22 +0100)]
Move edition earlier in TomlManifest::to_real_manifest

and fix a typo in the error message

6 years agoAuto merge of #5395 - dwijnand:contributing-setup-cross-tests, r=alexcrichton
bors [Fri, 20 Apr 2018 18:43:05 +0000 (18:43 +0000)]
Auto merge of #5395 - dwijnand:contributing-setup-cross-tests, r=alexcrichton

add contributing notes for cross compile test setup

adding notes from @alexcrichton's help in https://gitter.im/rust-lang/cargo?at=5ada2eae2b9dfdbc3ab01f29.

6 years agoadd contributing notes for cross compile test setup
Dale Wijnand [Fri, 20 Apr 2018 18:29:42 +0000 (19:29 +0100)]
add contributing notes for cross compile test setup

6 years agoPass linker path to build script
Henrik Laxhuber [Fri, 20 Apr 2018 15:04:14 +0000 (17:04 +0200)]
Pass linker path to build script

This change adds the environment variable LINKER to pass the path
of the linker used by cargo to the build script. This ammends the
variable RUSTC (the rustc binary used) to give the build script
full knowledge of its environment.

A specific usage example would be automatically generating bindings
to system headers in cross compilation, e.g. by locating jni.h for
android targets.

6 years agoAuto merge of #5391 - varkor:check-message, r=alexcrichton
bors [Thu, 19 Apr 2018 22:21:08 +0000 (22:21 +0000)]
Auto merge of #5391 - varkor:check-message, r=alexcrichton

Print "Checking" for cargo check

I often alternate between `check` and `build` and I'd like to be able to tell which is currently happening (short-term memory being what it is, and "compiling" implying to me that codegen is occurring). Changing the message to "Checking" seemed to be reasonable (and there was precedent for `doc` with "Documenting").

6 years agoUpdate tests to check for Checking
varkor [Thu, 19 Apr 2018 18:19:11 +0000 (19:19 +0100)]
Update tests to check for Checking

6 years agoAuto merge of #5390 - matklad:new-feature-behavior, r=alexcrichton
bors [Thu, 19 Apr 2018 14:30:48 +0000 (14:30 +0000)]
Auto merge of #5390 - matklad:new-feature-behavior, r=alexcrichton

Enable new behavior of `--feature`

So far, the feedback on https://internals.rust-lang.org/t/help-us-test-the-breaking-bug-fix-to-cargo-features/7317 has been positive, so here's a PR to try this in nightly.

Note that the logic is slightly tweak for the case `cargo build -p not-a-workspace-member`: we want not only to resolve all ws members in this case, but to enable all of their features as well!

As a sanity check, this seems to be forward compatible with further improvements to features:

1) when we solve the grand bug of features being unified across the whole workspace, `cargo build -p not-a-member` would hopefully just work without additional contortions.
2) we might add a way to specify features per package, like `cargo build -p foo -p bar --features "foo/serde bar/serde"`

6 years agoAuto merge of #5392 - ehuss:test-does-not-contain, r=alexcrichton
bors [Thu, 19 Apr 2018 14:08:29 +0000 (14:08 +0000)]
Auto merge of #5392 - ehuss:test-does-not-contain, r=alexcrichton

cargotest: Fix `with_*_does_not_contain` to support `[..]` and macro matching.

I changed it so that it is essentially the opposite of `with_*_contains` to keep it symmetric.

Any in-flight PRs using the old style will need to be updated (else they will incorrectly silently pass).  Alternatively, we could rename the method to avoid that.

The following tests contained brackets, so they were not checking what they thought they were checking.  I did a cursory look at them, but perhaps someone else could double-check that they make sense.  Asserting what *doesn't* happen can be tricky since there is an infinite number of things that won't happen.  Preferably a test would assert that it appears in one scenario and not another (like `incremental_profile` does), but some of them don't or can't.

```
build::incremental_profile
build::incremental_config
build::cargo_compile_with_workspace_excluded
build::build_all_exclude
build::targets_selected_default
check::targets_selected_default
check::check_filters
rustc::targets_selected_default
rustc_info_cache::rustc_info_cache
warn_on_failure::no_warning_on_bin_failure
warn_on_failure::warning_on_lib_failure
```

BTW, would you be interested in a PR that adds some documentation to `cargotest`?
I've discovered things I didn't know where there.  I think some docstrings on some of the methods, and a short guide for new contributors would be helpful.

6 years agoFix `with_*_does_not_contain` to support `[..]` and macro matching.
Eric Huss [Thu, 19 Apr 2018 05:13:30 +0000 (22:13 -0700)]
Fix `with_*_does_not_contain` to support `[..]` and macro matching.

6 years agoPrint "Checking" for cargo check
varkor [Thu, 19 Apr 2018 00:08:35 +0000 (01:08 +0100)]
Print "Checking" for cargo check

6 years agoEnable new behavior of `--feature`
Aleksey Kladov [Wed, 18 Apr 2018 20:36:59 +0000 (23:36 +0300)]
Enable new behavior of `--feature`

6 years agoAuto merge of #5389 - matklad:one-hard-cs-problem, r=alexcrichton
bors [Wed, 18 Apr 2018 15:09:00 +0000 (15:09 +0000)]
Auto merge of #5389 - matklad:one-hard-cs-problem, r=alexcrichton

One hard cs problem

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

r? @alexcrichton

Note that, due to the first commit, this still gives us all the benefits of #5249: if RUSTFLAGS is empty, we will run only a single rustc process, even if we can't cache it across different cargo invocations.

6 years agoDon't try to use the same info if target == host
Aleksey Kladov [Wed, 18 Apr 2018 15:00:21 +0000 (18:00 +0300)]
Don't try to use the same info if target == host

The info might be different due to RUSTFLAGS, which, in general,
are applied only to target.