Commit graph

3906 commits

Author SHA1 Message Date
bors 5db0d51279 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
2018-05-02 19:03:17 +00:00
bors 420f9ec576 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...
2018-05-02 17:17:27 +00:00
bors 31b38fe7e0 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
2018-05-02 16:35:38 +00:00
Lukas Kalbertodt 88d2886fb3 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).
2018-05-02 18:34:59 +02:00
bors 1b26ece291 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
2018-05-02 15:35:33 +00:00
Aleksey Kladov 20d8ff4fec Explain why we need a Vec<Dependency> in Resolve. 2018-05-02 18:14:50 +03:00
bors 2eebc86056 Auto merge of #5446 - csmoe:new_name, r=alexcrichton
Emit correct project name with --name

Fixes #5440
2018-05-02 14:40:15 +00:00
Alex Crichton 7f44648616 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
2018-05-02 07:34:19 -07:00
bors 9d57564a62 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.
2018-05-02 14:15:23 +00:00
Dirkjan Ochtman d02c726eb4 Store unit dependencies directly into Context 2018-05-02 10:03:35 +02:00
Dirkjan Ochtman 42e9412ea3 Move Links into context module 2018-05-02 10:03:35 +02:00
Dirkjan Ochtman 509c5b44bf Extract new build_context module out of context module 2018-05-02 10:03:33 +02:00
Dirkjan Ochtman c32e395cad Split Context into two types 2018-05-02 10:02:17 +02:00
Alex Crichton 02b0dba36b 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
2018-05-01 17:03:23 -07:00
DarkDrek 2ea2fafca9 Add cargo clean --doc 2018-05-01 17:38:22 +02:00
Dirkjan Ochtman 11a7cbdb1f Let Context store BuildConfig by reference 2018-05-01 17:02:45 +02:00
bors 181de52b2e Auto merge of #5447 - ehuss:ws-error-message, r=alexcrichton
Better error message for `cargo rustc` in a workspace.

Fixes #5371
2018-05-01 13:50:13 +00:00
bors f2abbe8b54 Auto merge of #5448 - ehuss:debug_env, r=alexcrichton
Fix "DEBUG" env var in build.rs for debug=0

Fixes #5370
2018-05-01 03:49:32 +00:00
Eric Huss 037a879dbd Better error message for cargo rustc in a workspace.
Fixes #5371
2018-04-30 20:39:07 -07:00
csmoe 59030eef14 fix project name 2018-05-01 09:38:13 +08:00
bors 0d377b6f34 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.
2018-04-30 18:19:47 +00:00
bors 4963d884a4 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.
2018-04-30 17:52:35 +00:00
Eric Huss 83b8c234a1 Fix "DEBUG" env var in build.rs for debug=0.
Fixes #5370
2018-04-30 10:17:43 -07:00
Rob Tsuk ce8fd49520 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.
2018-04-30 08:49:27 -07:00
Dirkjan Ochtman 0b6f420670 Put namespaced features behind a feature gate 2018-04-30 17:33:36 +02:00
bors 122fd5be52 Auto merge of #5430 - matklad:bring-old-features-back, r=alexcrichton
Revert "Enable new behavior of `--feature`"

This reverts commit 038eec5cb3.

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
2018-04-28 18:02:36 +00:00
bors 07d022dc70 Auto merge of #5425 - matklad:rename-fingerprint, r=alexcrichton
Package renames should affect fingerprints
2018-04-28 16:44:31 +00:00
Aleksey Kladov d369f97c19 Revert "Enable new behavior of --feature"
This reverts commit 038eec5cb3.
2018-04-28 17:28:39 +03:00
Aleksey Kladov 8164be2c95 Store dependencies as edges of the graph 2018-04-28 17:24:37 +03:00
Dirkjan Ochtman f5a4282e0b Add some documentation about unstable namespaced-features feature 2018-04-28 13:42:17 +02:00
Dirkjan Ochtman cb533ae1bf 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
2018-04-28 13:41:18 +02:00
Dirkjan Ochtman a9f163e390 Keep track of namespaced-features flag in Summary objects
For now, all Summaries from a registry have it set to false.
2018-04-28 13:41:18 +02:00
Dirkjan Ochtman 797d453424 Add namespaced-features option for manifest [project] section 2018-04-28 13:41:18 +02:00
Dirkjan Ochtman 4966f5394f Make a dependencies map while building feature map 2018-04-28 13:41:18 +02:00
Dirkjan Ochtman e357d17484 Simplify retrieval of dependency data 2018-04-28 13:41:18 +02:00
Aleksey Kladov fc72bcb449 Mix package renames into fingerprints 2018-04-28 13:38:16 +03:00
Eric Huss e82e9c19c5 Minor style update. 2018-04-27 13:42:30 -07:00
Eric Huss 040f9849dc Comment why deps_of doesn't need to keep track of profile_for in map. 2018-04-27 13:42:30 -07:00
Eric Huss 902cb9808d Fix Unit/Context parameter order. 2018-04-27 13:42:30 -07:00
Eric Huss 195520b853 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.
2018-04-27 13:42:30 -07:00
Eric Huss a4947c2b47 rustfmt 2018-04-27 13:42:30 -07:00
Eric Huss accc9b2867 Remove last TODO comments. 2018-04-27 13:42:30 -07:00
Eric Huss ba537d73b9 Add test for profile override on non-dev/release. 2018-04-27 13:42:30 -07:00
Eric Huss 36b8769025 Add warning if panic is set in test or bench profile. 2018-04-27 13:42:30 -07:00
Eric Huss a0a880c36e Add warnings for unknown profile overrides. 2018-04-27 13:42:30 -07:00
Eric Huss 7dc9e071c7 Minor tweaks on how examples are handled with tests, and some panic propagation. 2018-04-27 13:42:30 -07:00
Eric Huss 0d8ebe9109 Avoid running build.rs too often. 2018-04-27 13:42:30 -07:00
Eric Huss 768f573955 Add extra rustc/rustdoc args to the fingerprint and metadata. 2018-04-27 13:42:30 -07:00
Eric Huss 7051b630c8 Update for some review comments. 2018-04-27 13:42:29 -07:00
Eric Huss 138eb33e98 Fix a variety of profile bugs. 2018-04-27 13:42:29 -07:00