bors [Sun, 6 May 2018 03:56:43 +0000 (03:56 +0000)]
Auto merge of #5491 - ehuss:profile-spec, r=alexcrichton
Add package spec support to profile overrides.
Note: It errors out if multiple overrides match the same package. This could potentially merge the overrides together with a hierarchy similar to CSS specificity. However, that seems overkill for now.
Eric Huss [Sat, 5 May 2018 23:13:09 +0000 (16:13 -0700)]
Add package spec support to profile overrides.
Note: It errors out if multiple overrides match the same package. This could potentially merge the overrides together with a hierarchy similar to CSS specificity. However, that seems overkill for now.
bors [Sat, 5 May 2018 21:32:18 +0000 (21:32 +0000)]
Auto merge of #5461 - matklad:meta-rename, r=alexcrichton
Support crate renames in `cargo metadata`
This adds information about (currently unstable) crate renames to metadata. Unfortunately, we already expose dependencies as a list of package ids (which are strings), so we can't easily add a `rename` field easily. For this reason, I've added a parallel `deps` key, which basically deprecates `dependencies` field.
* Is there a better name for `extern_crate_name`? This name is precise, but it's longer than I like, and might become opaque in meaning if we remove `extern crate` from the language :)
* Should we feature gate this (i.e, only produce `deps` if we have a feature in `Cargo.toml`)? I think the answer is yes, but that'll require threading `Features` to `Workspace`...
bors [Sat, 5 May 2018 19:04:30 +0000 (19:04 +0000)]
Auto merge of #5488 - alexcrichton:Retry, r=matklad
Cop out on fixing a spurious test failure
This commit cops out trying to fix `rename_with_link_search_path` by simply
adding a loop on Windows to retry the operation that looks to need retrying.
Alex Crichton [Sat, 5 May 2018 18:47:41 +0000 (11:47 -0700)]
Cop out on fixing a spurious test failure
This commit cops out trying to fix `rename_with_link_search_path` by simply
adding a loop on Windows to retry the operation that looks to need retrying.
bors [Sat, 5 May 2018 17:19:01 +0000 (17:19 +0000)]
Auto merge of #5487 - matklad:mixed-deps, r=alexcrhiton
FIx false positive warning
We warn if a feature was specified corresponding to a dependency which
is not optional. However, a dependency can be both optional and
required, and we shouldn't warn in that case.
Aleksey Kladov [Sat, 5 May 2018 16:04:54 +0000 (19:04 +0300)]
FIx false positive warning
We warn if a feature was specified corresponding to a dependency which
is not optional. However, a dependency can be both optional and
required, and we shouldn't warn in that case.
bors [Sat, 5 May 2018 14:24:55 +0000 (14:24 +0000)]
Auto merge of #5485 - patriksvensson:feature/GH-5474, r=matklad
Do not allow running library examples.
This is my first contribution to anything Rust related that I haven't written myself, and I'm not a very proficient Rust programmer (yet), so would love some feedback on improvements.
I also might have solved this the wrong way... 😄
bors [Fri, 4 May 2018 21:07:15 +0000 (21:07 +0000)]
Auto merge of #5480 - alexcrichton:fix-regr, r=matklad
Fix optional deps in multiple sections
This commit fixes an issue where an optional dependency was listed multiple
times in a manifest (multiple sections). This regression was introduced by #5415
and happened because in the resolver we didn't record a `Dependency` as it was
accidentally deduplicated too soon.
The fix here was to ensure that all `Dependency` annotations make their way into
`Resolve` now that we rely on the listed `Dependency` values for correctness.
Alex Crichton [Fri, 4 May 2018 16:19:30 +0000 (09:19 -0700)]
Fix optional deps in multiple sections
This commit fixes an issue where an optional dependency was listed multiple
times in a manifest (multiple sections). This regression was introduced by #5415
and happened because in the resolver we didn't record a `Dependency` as it was
accidentally deduplicated too soon.
The fix here was to ensure that all `Dependency` annotations make their way into
`Resolve` now that we rely on the listed `Dependency` values for correctness.
bors [Fri, 4 May 2018 14:37:41 +0000 (14:37 +0000)]
Auto merge of #5476 - dwijnand:Registry-vs-Source-confusion, r=matklad
Try & simplify Registry vs Source confusion
Refs #3006.
I tried to go further and replace references of `Registry` with `PackageRegistry`, but I ran into lifetime issue in `ops::resolve_with_previous` which I think has to do with no longer passing `PackageRegistry` as a `Registry` trait object (with a new and distinct lifetime).
bors [Thu, 3 May 2018 18:19:51 +0000 (18:19 +0000)]
Auto merge of #5473 - ehuss:autobin-warning, r=alexcrichton
Address autobins warning.
Removes the large warning displayed if you build Cargo with itself (but adds a warning if you build with an older Cargo). Not sure which approach you prefer to address it, or if you want to do this later.
bors [Thu, 3 May 2018 17:03:06 +0000 (17:03 +0000)]
Auto merge of #5470 - alexcrichton:hopeful-fix, r=matklad
Attmept to fix a spurious failure on AppVeyor
I *think* the issue is that `link.exe` is generating debuginfo in the background
which keeps the file open and prevents us from deleting it, but hopefully by
disabling debug information we'll either be able to confirm or deny this
hypothesis.
Alex Crichton [Thu, 3 May 2018 15:01:25 +0000 (08:01 -0700)]
Attmept to fix a spurious failure on AppVeyor
I *think* the issue is that `link.exe` is generating debuginfo in the background
which keeps the file open and prevents us from deleting it, but hopefully by
disabling debug information we'll either be able to confirm or deny this
hypothesis.
bors [Thu, 3 May 2018 15:31:44 +0000 (15:31 +0000)]
Auto merge of #5468 - matklad:aliases, r=alexcrichton
Tweak handling of aliases
Previously, `execute_subcommand` was called recursively, and each call
would `.configure` the `config` again. It worked, but seemed rather
fragile.
This commit handles aliases more explicitly, ensures that `.configure`
is called once and, as a bonus, adds a warning for when an alias is
shadowed by the built in.
Aleksey Kladov [Thu, 3 May 2018 10:50:05 +0000 (13:50 +0300)]
Make alias handling more straightforward
Previously, `execute_subcommand` was called recursively, and each call
would `.configure` the `config` again. It worked, but seemed rather
fragile.
This commit handles aliases more explicitly, ensures that `.configure`
is called once and, as a bonus, adds a warning for when an alias is
shadowed by the built in.
Nick Cameron [Thu, 3 May 2018 08:23:49 +0000 (20:23 +1200)]
Revert part to #5393
Commit 0b530c30867da26a4b59146f490c9f1d5377c20a (which this commit mostly reverts) did some refactoring around the `target_dir` function. However, it introduced a bug because it meant that where `CARGO_TARGET_DIR` was specified but `--target-dir` was not, the value from `CARGO_TARGET_DIR` was ignored.
bors [Wed, 2 May 2018 23:52:15 +0000 (23:52 +0000)]
Auto merge of #5462 - matklad:install-releases, r=alexcrichton
Don't install pre-releases by default
Currently, `cargo install` will try to install a pre-release version, if available (try `cargo install rand`). This happens because we use `VersionReq::any`, if no version is specified, and that matches pre-releases. The fix is to use `*`, which is different from `any`.
This needs to be done in `cargo install`, and not directly in `parse_no_deprecated`, the latter would be wrong, as demonstrated by a new test with patch.
bors [Wed, 2 May 2018 17:17:27 +0000 (17:17 +0000)]
Auto merge of #5456 - LukasKalbertodt:patch-1, r=matklad
Show elapsed time in minutes if >= 60 secs
In large projects with long compile times, seeing "428.65 secs" isn't as clear to humans as seeing the number of minutes (and seconds).
**Old**:
```
Finished dev [unoptimized + debuginfo] target(s) in 2.23 secs
Finished dev [unoptimized + debuginfo] target(s) in 63.94 secs
Finished dev [unoptimized + debuginfo] target(s) in 428.65 secs
```
**New**:
```
Finished dev [unoptimized + debuginfo] target(s) in 2.23s
Finished dev [unoptimized + debuginfo] target(s) in 1m 3.94s
Finished dev [unoptimized + debuginfo] target(s) in 7m 8.65s
```
Note that I also changed `secs` to `s`, because `7 mins 8.65 secs` and `7m 8.65 secs` both look strange IMO. But if you disagree and you'd prefer `secs`, just tell me and I'll change it.
I *didn't* add a check for `secs >= 3600` to print the time in hours. I *hope* this is not necessary...
bors [Wed, 2 May 2018 14:15:23 +0000 (14:15 +0000)]
Auto merge of #5432 - djc:split-context, r=alexcrichton
Split Context into two types
@matklad here's the crazy attempt to make the `Context` situation slightly more sane. It basically splits all of the stuff that is immutable over the lifetime of the compilation from the stuff that's initialized empty. The latter is now stored in a type which I have provisionally called `BuildProgress` -- feel free to bikeshed about the name (I came up with `BuildData` as another alternative). It stores a reference to the `Context` to make things easier for now, we might want to change that down the line.
IMO this is a pretty good improvement, which clarifies the design quite a bit.
@alexcrichton you'll probably want to review this, too.
bors [Tue, 1 May 2018 18:32:06 +0000 (18:32 +0000)]
Auto merge of #5451 - DarkDrek:add_doc_clean, r=alexcrichton
Add cargo clean --doc
Implements #5449.
It only removes the doc directory and therefore keeps all other build artifacts intact.
When `--doc` is used all other options are ignored.
My test case is mostly copy&paste from `clean_release` so maybe the `.toml`s can be simplified.
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.
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.