]> git.proxmox.com Git - cargo.git/log
cargo.git
6 years agotypo
Dale Wijnand [Mon, 7 May 2018 23:21:28 +0000 (16:21 -0700)]
typo

6 years agoMention +nightly in ARCHITECTURE.md
Dale Wijnand [Mon, 7 May 2018 23:20:45 +0000 (16:20 -0700)]
Mention +nightly in ARCHITECTURE.md

6 years agoAuto merge of #5493 - ehuss:fix-changing_bin_features_caches_targets, r=matklad
bors [Mon, 7 May 2018 06:55:24 +0000 (06:55 +0000)]
Auto merge of #5493 - ehuss:fix-changing_bin_features_caches_targets, r=matklad

Fix random Windows CI error for changing_bin_features_caches_targets

Fixes #5481.

6 years agoFix random Windows CI error for changing_bin_features_caches_targets
Eric Huss [Sun, 6 May 2018 15:25:44 +0000 (08:25 -0700)]
Fix random Windows CI error for changing_bin_features_caches_targets

Fixes #5481.

6 years agoAuto merge of #5491 - ehuss:profile-spec, r=alexcrichton
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.

6 years agoAdd package spec support to profile overrides.
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.

6 years agoAuto merge of #5461 - matklad:meta-rename, r=alexcrichton
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.

So, the new format looks like this

```JavaScript
{
    "dependencies": [
        "bar 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
        "bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)"
    ],
    "deps": [
        {
            "extern_crate_name": "baz", // this one is actually renamed
            "id": "bar 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)"
        },
        {
            "extern_crate_name": "bar",
            "id": "bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)"
        }
    ],
    "features": [],
    "id": "foo 0.5.0 (path+file://[..])"
},
```

Questions:

* 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`...

r? @alexcrichton

6 years agoExpand dependency info of cargo --metadata
Aleksey Kladov [Sat, 5 May 2018 15:07:18 +0000 (18:07 +0300)]
Expand dependency info of cargo --metadata

The old `dependencies` key in `resolve` is deprecated.

Instead, the new `deps` key introduced which lists dependencies kinds
(dev/build/normal) as well as `extern crate` name for the dep.

6 years agoExtract Package::lib_target method
Aleksey Kladov [Wed, 2 May 2018 17:26:52 +0000 (20:26 +0300)]
Extract Package::lib_target method

6 years agoAuto merge of #5490 - alexcrichton:fix-thrash, r=matklad
bors [Sat, 5 May 2018 20:41:12 +0000 (20:41 +0000)]
Auto merge of #5490 - alexcrichton:fix-thrash, r=matklad

Factor in `used_in_plugin` to target filenames

This prevents thrashing the cache of compiled libraries for when they're used in
a plugin or not.

6 years agoFactor in `used_in_plugin` to target filenames
Alex Crichton [Sat, 5 May 2018 19:59:50 +0000 (12:59 -0700)]
Factor in `used_in_plugin` to target filenames

This prevents thrashing the cache of compiled libraries for when they're used in
a plugin or not.

6 years agoAuto merge of #5489 - dwijnand:drop-GitSource-TODO, r=matklad
bors [Sat, 5 May 2018 19:52:25 +0000 (19:52 +0000)]
Auto merge of #5489 - dwijnand:drop-GitSource-TODO, r=matklad

Drop PathSource TODO in GitSource

This effort was started in de6944798cf2940b91c742b8d6cd4294ea28f76a,
and looks (to me) to be resolved at this point.

6 years agoAuto merge of #5488 - alexcrichton:Retry, r=matklad
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.

6 years agoDrop PathSource TODO in GitSource
Dale Wijnand [Sat, 5 May 2018 18:55:37 +0000 (19:55 +0100)]
Drop PathSource TODO in GitSource

This effort was started in de6944798cf2940b91c742b8d6cd4294ea28f76a,
and looks (to me) to be resolved at this point.

6 years agoCop out on fixing a spurious test failure
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.

6 years agoAuto merge of #5358 - djc:options-build-config, r=matklad
bors [Sat, 5 May 2018 18:35:04 +0000 (18:35 +0000)]
Auto merge of #5358 - djc:options-build-config, r=matklad

Let CompileOptions create a BuildConfig directly

This puts input validation in a more central place and prevents copying/moving stuff around as separate values.

6 years agoAuto merge of #5487 - matklad:mixed-deps, r=alexcrhiton
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.

cc https://github.com/rust-lang/cargo/pull/5480

r? @alexcrichton

6 years agoFIx false positive warning
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.

6 years agoAuto merge of #5486 - ehuss:deprecate-doc, r=matklad
bors [Sat, 5 May 2018 16:11:36 +0000 (16:11 +0000)]
Auto merge of #5486 - ehuss:deprecate-doc, r=matklad

Deprecate `doc` profile.

Fixes #5434

6 years agoDeprecate `doc` profile.
Eric Huss [Sat, 5 May 2018 15:52:19 +0000 (08:52 -0700)]
Deprecate `doc` profile.

Fixes #5434

6 years agoAuto merge of #5485 - patriksvensson:feature/GH-5474, r=matklad
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... ðŸ˜„

Closes #5474

(cc @matklad)

6 years agoMade adjustments based on feedback from review.
Patrik Svensson [Sat, 5 May 2018 14:17:59 +0000 (16:17 +0200)]
Made adjustments based on feedback from review.

6 years agoDo not allow running library examples.
Patrik Svensson [Sat, 5 May 2018 08:39:51 +0000 (10:39 +0200)]
Do not allow running library examples.

Closes #5474

6 years agoAuto merge of #5480 - alexcrichton:fix-regr, r=matklad
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.

Closes #5475

6 years agoFix optional deps in multiple sections
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.

Closes #5475

6 years agoAuto merge of #5483 - ehuss:disable-panic-test, r=matklad
bors [Fri, 4 May 2018 18:00:30 +0000 (18:00 +0000)]
Auto merge of #5483 - ehuss:disable-panic-test, r=matklad

Disable --all-targets panic tests until we can land a fix.

6 years agoDisable --all-targets panic tests until we can land a fix.
Eric Huss [Fri, 4 May 2018 17:51:20 +0000 (10:51 -0700)]
Disable --all-targets panic tests until we can land a fix.

6 years agoAuto merge of #5479 - matklad:ghost-hunting, r=alexcrichton
bors [Fri, 4 May 2018 16:07:30 +0000 (16:07 +0000)]
Auto merge of #5479 - matklad:ghost-hunting, r=alexcrichton

Investigating spurious windows errors

r? @alexcrichton

6 years agoTry to diagnose/fix spurious windows error with better rm -r
Aleksey Kladov [Fri, 4 May 2018 15:02:57 +0000 (18:02 +0300)]
Try to diagnose/fix spurious windows error with better rm -r

6 years agoRevert "Attmept to fix a spurious failure on AppVeyor"
Aleksey Kladov [Fri, 4 May 2018 14:53:10 +0000 (17:53 +0300)]
Revert "Attmept to fix a spurious failure on AppVeyor"

This reverts commit db3328f8f7b96701faa62756a0d55ed71899d894.

We get spurious errors for thouse tests even with debug info disabled,
so let's reenable it back.

6 years agoAuto merge of #5476 - dwijnand:Registry-vs-Source-confusion, r=matklad
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).

6 years agoTrash RegistryBuilder, dead cfg(test) code
Dale Wijnand [Fri, 4 May 2018 14:24:08 +0000 (15:24 +0100)]
Trash RegistryBuilder, dead cfg(test) code

6 years agoRe-organise Source impls method definition order
Dale Wijnand [Fri, 4 May 2018 13:15:48 +0000 (14:15 +0100)]
Re-organise Source impls method definition order

Optimised for minimised PR diff, and thus reviewability

6 years agoRe-simplify GitSource::query
Dale Wijnand [Fri, 4 May 2018 13:10:24 +0000 (14:10 +0100)]
Re-simplify GitSource::query

6 years agoMove query definitions back into Source impls!
Dale Wijnand [Fri, 4 May 2018 13:07:51 +0000 (14:07 +0100)]
Move query definitions back into Source impls!

6 years agoRemove all "impl Registry for XSource" blocks!
Dale Wijnand [Fri, 4 May 2018 13:05:23 +0000 (14:05 +0100)]
Remove all "impl Registry for XSource" blocks!

6 years agoDrop unnecessary Registry for Box
Dale Wijnand [Fri, 4 May 2018 13:00:35 +0000 (14:00 +0100)]
Drop unnecessary Registry for Box

6 years agoDuplicate query in Source, drop Registry parent type
Dale Wijnand [Thu, 3 May 2018 22:26:42 +0000 (23:26 +0100)]
Duplicate query in Source, drop Registry parent type

.. and move query definitions to the struct impls.

6 years agoStart moving methods from Registry to Source
Dale Wijnand [Thu, 3 May 2018 22:14:21 +0000 (23:14 +0100)]
Start moving methods from Registry to Source

For now just move `supports_checksums` and `requires_precise` methods
down from `Registry` to `Source`, as they're not as entangled as
`query`.

6 years agoRename default() method that does not implement Default
Dirkjan Ochtman [Sat, 14 Apr 2018 09:58:01 +0000 (11:58 +0200)]
Rename default() method that does not implement Default

6 years agoStore BuildConfig directly in CompileOptions
Dirkjan Ochtman [Sat, 14 Apr 2018 09:06:51 +0000 (11:06 +0200)]
Store BuildConfig directly in CompileOptions

6 years agoPass full build_config to generate_targets()
Dirkjan Ochtman [Thu, 3 May 2018 09:17:38 +0000 (11:17 +0200)]
Pass full build_config to generate_targets()

6 years agoMove rustc and target configs from BuildConfig into BuildContext
Dirkjan Ochtman [Sat, 28 Apr 2018 13:14:51 +0000 (15:14 +0200)]
Move rustc and target configs from BuildConfig into BuildContext

6 years agoPass Workspace directly into Config::rustc()
Dirkjan Ochtman [Thu, 3 May 2018 08:42:45 +0000 (10:42 +0200)]
Pass Workspace directly into Config::rustc()

This means we can store the cache file name in one place.

6 years agoProxy host_triple() and target_triple() on BuildContext
Dirkjan Ochtman [Thu, 3 May 2018 08:09:54 +0000 (10:09 +0200)]
Proxy host_triple() and target_triple() on BuildContext

6 years agoInitialize Compilation fields directly from BuildContext
Dirkjan Ochtman [Thu, 3 May 2018 08:08:16 +0000 (10:08 +0200)]
Initialize Compilation fields directly from BuildContext

6 years agoPass target configs directly to BuildState::new()
Dirkjan Ochtman [Sat, 28 Apr 2018 12:50:56 +0000 (14:50 +0200)]
Pass target configs directly to BuildState::new()

6 years agoMove BuildConfig and dependencies into new module
Dirkjan Ochtman [Sat, 14 Apr 2018 09:55:26 +0000 (11:55 +0200)]
Move BuildConfig and dependencies into new module

6 years agoMove more input validation into BuildConfig::new()
Dirkjan Ochtman [Sat, 14 Apr 2018 09:44:42 +0000 (11:44 +0200)]
Move more input validation into BuildConfig::new()

6 years agoStore compile mode as enum in BuildConfig
Dirkjan Ochtman [Sat, 14 Apr 2018 08:49:15 +0000 (10:49 +0200)]
Store compile mode as enum in BuildConfig

6 years agoExpose CompileMode in command_prelude
Dirkjan Ochtman [Sat, 14 Apr 2018 08:47:58 +0000 (10:47 +0200)]
Expose CompileMode in command_prelude

6 years agoStore message format as enum in BuildConfig
Dirkjan Ochtman [Sat, 14 Apr 2018 08:27:33 +0000 (10:27 +0200)]
Store message format as enum in BuildConfig

6 years agoAuto merge of #5472 - alexcrichton:rename-rust, r=matklad
bors [Thu, 3 May 2018 19:39:24 +0000 (19:39 +0000)]
Auto merge of #5472 - alexcrichton:rename-rust, r=matklad

Rename the `rust` manifest key to `edition`

This'll hopefully jive better with the terminology of "edition" throughout the
rest of Rust!

6 years agoRename the `rust` manifest key to `edition`
Alex Crichton [Thu, 3 May 2018 16:14:25 +0000 (09:14 -0700)]
Rename the `rust` manifest key to `edition`

This'll hopefully jive better with the terminology of "edition" throughout the
rest of Rust!

6 years agoAuto merge of #5473 - ehuss:autobin-warning, r=alexcrichton
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.

6 years agoAddress autobins warning.
Eric Huss [Thu, 3 May 2018 16:13:36 +0000 (09:13 -0700)]
Address autobins warning.

6 years agoAuto merge of #5470 - alexcrichton:hopeful-fix, r=matklad
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.

6 years agoAttmept to fix a spurious failure on AppVeyor
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.

6 years agoAuto merge of #5468 - matklad:aliases, r=alexcrichton
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.

6 years agoTweak error messages
Aleksey Kladov [Thu, 3 May 2018 11:05:21 +0000 (14:05 +0300)]
Tweak error messages

By convention, all errors should start with a lowercase letter

6 years agoMake alias handling more straightforward
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.

6 years agoAuto merge of #5464 - ehuss:restore-example-test, r=alexcrichton
bors [Thu, 3 May 2018 13:43:38 +0000 (13:43 +0000)]
Auto merge of #5464 - ehuss:restore-example-test, r=alexcrichton

Partially revert change to testing examples.

Fixes #5437

I don't think changing the behavior was quite the correct thing to do.  This new behavior is very similar to the old with a few small differences:

```
cargo test
    ORGINAL: Only builds examples.
    NEW: Builds all examples.  Any example with `test` set is tested.

cargo test --tests
    ORIGINAL: Runs all examples as tests.
    NEW: Only runs examples as tests if `test` is set.

cargo test --examples
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)

cargo test --example foo
    ORIGINAL: Runs the given example as a test.
    NEW: (SAME)

cargo test --all-targets
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)
```

6 years agoAuto merge of #5469 - matklad:fix-link, r=matklad
bors [Thu, 3 May 2018 13:06:37 +0000 (13:06 +0000)]
Auto merge of #5469 - matklad:fix-link, r=matklad

Fix link in docs

6 years agoFix link in docs
Aleksey Kladov [Thu, 3 May 2018 13:06:18 +0000 (16:06 +0300)]
Fix link in docs

6 years agoAuto merge of #5466 - matklad:pr-5465, r=matklad
bors [Thu, 3 May 2018 10:26:59 +0000 (10:26 +0000)]
Auto merge of #5466 - matklad:pr-5465, r=matklad

Fix target_dir handling for RLS

Supersedes  and closes #5465

6 years agoFix the test
Aleksey Kladov [Thu, 3 May 2018 10:22:03 +0000 (13:22 +0300)]
Fix the test

6 years agoRevert part to #5393
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.

6 years agoPartially revert change to testing examples.
Eric Huss [Thu, 3 May 2018 03:17:53 +0000 (20:17 -0700)]
Partially revert change to testing examples.

Fixes #5437

I don't think changing the behavior was quite the correct thing to do.  This new behavior is very similar to the old with a few small differences:

```
cargo test
    ORGINAL: Only builds examples.
    NEW: Builds all examples.  Any example with `test` set is tested.

cargo test --tests
    ORIGINAL: Runs all examples as tests.
    NEW: Only runs examples as tests if `test` is set.

cargo test --examples
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)

cargo test --example foo
    ORIGINAL: Runs the given example as a test.
    NEW: (SAME)

cargo test --all-targets
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)
```

6 years agoAuto merge of #5462 - matklad:install-releases, r=alexcrichton
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.

6 years agoDon't install pre-releases by default
Aleksey Kladov [Wed, 2 May 2018 22:26:48 +0000 (01:26 +0300)]
Don't install pre-releases by default

6 years agoAuto merge of #5459 - matklad:more-comments, r=alexcrichton
bors [Wed, 2 May 2018 19:03:17 +0000 (19:03 +0000)]
Auto merge of #5459 - matklad:more-comments, r=alexcrichton

Explain why we need a `Vec<Dependency>` in `Resolve`.

Looks like everyone, who sees it, asks the same question, so let's add an explanation!

cc https://github.com/rust-lang/cargo/pull/5428#issuecomment-385459845

6 years agoAuto merge of #5456 - LukasKalbertodt:patch-1, r=matklad
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...

6 years agoAuto merge of #5458 - alexcrichton:track-panic, r=matklad
bors [Wed, 2 May 2018 16:35:38 +0000 (16:35 +0000)]
Auto merge of #5458 - alexcrichton:track-panic, r=matklad

Track panic mode in fingerprint

Ensure that if we've previously compiled a crate with panic=abort and we later
need it for panic=unwind we correctly recompile it.

Closes #5445

6 years agoAdjust tests to new time output format
Lukas Kalbertodt [Wed, 2 May 2018 12:52:40 +0000 (14:52 +0200)]
Adjust tests to new time output format

6 years agoShow elapsed time in minutes if >= 60 secs
Lukas Kalbertodt [Wed, 2 May 2018 10:15:37 +0000 (12:15 +0200)]
Show elapsed time in minutes if >= 60 secs

In large projects with long compile times, seeing "400.65 secs" isn't as
clear as seeing the number of minutes (and seconds).

6 years agoAuto merge of #5454 - alexcrichton:fix, r=matklad
bors [Wed, 2 May 2018 15:35:33 +0000 (15:35 +0000)]
Auto merge of #5454 - alexcrichton:fix, r=matklad

Fix optional dependencies and required dev-deps

This fixes an accidental bug introduced in #5300 by ensuring a local map keeps
track of the fact that there can be multiple dependencies for one name

Closes #5453

6 years agoExplain why we need a `Vec<Dependency>` in `Resolve`.
Aleksey Kladov [Wed, 2 May 2018 15:13:03 +0000 (18:13 +0300)]
Explain why we need a `Vec<Dependency>` in `Resolve`.

6 years agoAuto merge of #5446 - csmoe:new_name, r=alexcrichton
bors [Wed, 2 May 2018 14:40:15 +0000 (14:40 +0000)]
Auto merge of #5446 - csmoe:new_name, r=alexcrichton

Emit correct project name with --name

Fixes #5440

6 years agoTrack panic mode in fingerprint
Alex Crichton [Wed, 2 May 2018 14:32:10 +0000 (07:32 -0700)]
Track panic mode in fingerprint

Ensure that if we've previously compiled a crate with panic=abort and we later
need it for panic=unwind we correctly recompile it.

Closes #5445

6 years agoAuto merge of #5432 - djc:split-context, r=alexcrichton
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.

6 years agoStore unit dependencies directly into Context
Dirkjan Ochtman [Sun, 29 Apr 2018 19:55:57 +0000 (21:55 +0200)]
Store unit dependencies directly into Context

6 years agoMove Links into context module
Dirkjan Ochtman [Sun, 29 Apr 2018 19:45:35 +0000 (21:45 +0200)]
Move Links into context module

6 years agoExtract new build_context module out of context module
Dirkjan Ochtman [Sat, 28 Apr 2018 15:33:11 +0000 (17:33 +0200)]
Extract new build_context module out of context module

6 years agoSplit Context into two types
Dirkjan Ochtman [Sat, 28 Apr 2018 15:20:27 +0000 (17:20 +0200)]
Split Context into two types

6 years agoFix optional dependencies and required dev-deps
Alex Crichton [Wed, 2 May 2018 00:03:23 +0000 (17:03 -0700)]
Fix optional dependencies and required dev-deps

This fixes an accidental bug introduced in #5300 by ensuring a local map keeps
track of the fact that there can be multiple dependencies for one name

Closes #5453

6 years agoAuto merge of #5451 - DarkDrek:add_doc_clean, r=alexcrichton
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.

6 years agoAdd cargo clean --doc
DarkDrek [Tue, 1 May 2018 15:33:10 +0000 (17:33 +0200)]
Add cargo clean --doc

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 agoadd test for project name
csmoe [Tue, 1 May 2018 01:39:22 +0000 (09:39 +0800)]
add test for project name

6 years agofix project name
csmoe [Tue, 1 May 2018 01:38:13 +0000 (09:38 +0800)]
fix project name

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