]> git.proxmox.com Git - cargo.git/log
cargo.git
4 years agoRebuild docs for rephrase --manifest-path.
Eric Huss [Mon, 28 Oct 2019 19:09:26 +0000 (12:09 -0700)]
Rebuild docs for rephrase --manifest-path.

4 years agoReprhase --manifest-path section
Mihaly Hobor [Sun, 22 Sep 2019 11:00:42 +0000 (13:00 +0200)]
Reprhase --manifest-path section

Change the order of the words, for readability.

4 years agoAuto merge of #7536 - ehuss:profile-override-warning-fix, r=alexcrichton
bors [Thu, 24 Oct 2019 20:33:33 +0000 (20:33 +0000)]
Auto merge of #7536 - ehuss:profile-override-warning-fix, r=alexcrichton

Fix profile override warning in a workspace.

Profile overrides would erroneously warn about unused packages in a workspace if the package was not being built.  The fix here is to retain the `Resolve` for the entire workspace, and use that to determine the valid set of packages.

I think it would be good for a long-term goal to get rid of the second ("targeted") resolve.  I'm still contemplating how a separate features resolver could achieve that, but it seems feasible long-term.

Closes #7378

4 years agoAuto merge of #7534 - ehuss:fix-windows-nightly, r=alexcrichton
bors [Thu, 24 Oct 2019 20:11:07 +0000 (20:11 +0000)]
Auto merge of #7534 - ehuss:fix-windows-nightly, r=alexcrichton

Fix some tests failing on Windows nightly.

- Windows MSVC binaries don't have metadata hash anymore.
- Properly escape backslashes in config TOML.

4 years agoAuto merge of #7535 - ehuss:better-windows-errors, r=alexcrichton
bors [Thu, 24 Oct 2019 19:48:28 +0000 (19:48 +0000)]
Auto merge of #7535 - ehuss:better-windows-errors, r=alexcrichton

Show better error message for Windows abnormal termination.

This helps display better error messages when there is an abnormal termination on Windows.

If rustc crashes, there was a slight mistake in #6270, where the error code was actually negative, so the message was getting hidden behind the `--verbose` flag.  This changes it show that the abnormal error is always shown if rustc crashes in an unusual way.

This also changes `cargo test` to display a better message if the test crashes.  Previously:

```
running 1 test
error: test failed, to rerun pass '--bin crash'
```

New:

```
running 1 test
error: test failed, to rerun pass '--bin crash'

Caused by:
  process didn't exit successfully: `D:\Temp\crash\target\debug\deps\crash-b3c2389529da3d3e.exe` (exit code: 0xc0000374, STATUS_HEAP_CORRUPTION)
```

I didn't add any tests because testing on this on Windows seems a little precarious.  AFAIK, the exact error message depends on the processor (like x86 vs i686), and Windows version.  I was concerned about chasing down every little nuance, though I'm willing to try if it seems important.

Fixes rust-lang/rust#65692 (I think).

4 years agoAuto merge of #7541 - alexcrichton:try-apt-update, r=alexcrichton
bors [Thu, 24 Oct 2019 18:25:08 +0000 (18:25 +0000)]
Auto merge of #7541 - alexcrichton:try-apt-update, r=alexcrichton

Run `apt update` before `apt install`

Trying to fix recent errors on CI...

4 years agoRun `apt update` before `apt install`
Alex Crichton [Thu, 24 Oct 2019 15:04:01 +0000 (08:04 -0700)]
Run `apt update` before `apt install`

Trying to fix recent errors on CI...

4 years agoFix profile override warning in a workspace.
Eric Huss [Wed, 23 Oct 2019 18:24:24 +0000 (11:24 -0700)]
Fix profile override warning in a workspace.

4 years agoShow better error message for Windows abnormal termination.
Eric Huss [Wed, 23 Oct 2019 15:24:10 +0000 (08:24 -0700)]
Show better error message for Windows abnormal termination.

4 years agoFix some tests failing on Windows nightly.
Eric Huss [Wed, 23 Oct 2019 15:14:40 +0000 (08:14 -0700)]
Fix some tests failing on Windows nightly.

4 years agoAuto merge of #7532 - dario23:install-cmd-help-typo, r=alexcrichton
bors [Tue, 22 Oct 2019 15:05:18 +0000 (15:05 +0000)]
Auto merge of #7532 - dario23:install-cmd-help-typo, r=alexcrichton

Fix typo in `cargo install --profile` help

4 years agoFix typo in `cargo install --profile` help
Johannes Schilling [Tue, 22 Oct 2019 14:27:46 +0000 (16:27 +0200)]
Fix typo in `cargo install --profile` help

4 years agoAuto merge of #7531 - ehuss:z-flag-parsing, r=alexcrichton
bors [Tue, 22 Oct 2019 14:18:30 +0000 (14:18 +0000)]
Auto merge of #7531 - ehuss:z-flag-parsing, r=alexcrichton

Use stricter -Z flag parsing.

This makes sure that toggle flags don't have any arguments (like `-Zno-index-update=foo`).  It also provides slightly better error messages, like indicating which flag failed.

4 years agoUse stricter -Z flag parsing.
Eric Huss [Mon, 21 Oct 2019 21:49:28 +0000 (14:49 -0700)]
Use stricter -Z flag parsing.

4 years agoAuto merge of #7523 - bruceg:fix-zero-timestamps, r=alexcrichton
bors [Mon, 21 Oct 2019 17:59:52 +0000 (17:59 +0000)]
Auto merge of #7523 - bruceg:fix-zero-timestamps, r=alexcrichton

Set timestamp on generated files in archive to now

When generating files (Cargo.lock, Cargo.toml, and
.cargo_vcs_info.json), cargo neglected to set any timestamp on the file
in the archive. This results in them being created on disk with a
timestamp of 0 (Jan 1 1970 GMT) which is confusing another tool I use.

This patch alters the behavior to set the mtime to now.

Signed-off-by: Bruce Guenter <bruce@untroubled.org>
4 years agoAuto merge of #7460 - alexcrichton:panic-abort-tests, r=ehuss
bors [Mon, 21 Oct 2019 16:37:34 +0000 (16:37 +0000)]
Auto merge of #7460 - alexcrichton:panic-abort-tests, r=ehuss

Support rustc's `-Z panic-abort-tests` in Cargo

Recently added in rust-lang/rust#64158 the `-Z panic-abort-tests` flag
to the compiler itself will activate a mode in the `test` crate which
enables running tests even if they're compiled with `panic=abort`.  It
effectively runs a test-per-process.

This commit brings the same support to Cargo, adding a `-Z
panic-abort-tests` flag to Cargo which allows building tests in
`panic=abort` mode. While I wanted to be sure to add support for this in
Cargo before we stabilize the flag in `rustc`, I don't actually know how
we're going to stabilize this here. Today Cargo will automatically
switch test targets to `panic=unwind`, and so if we actually were to
stabilize this flag then this configuration would break:

    [profile.dev]
    panic = 'abort'

In that case tests would be compiled with `panic=unwind` (due to how
profiles work today) which would clash with crates also being compiled
with `panic=abort`. I'm hopeful though that we can perhaps either figure
out a solution for this and maybe even integrate it with the ongoing
profiles work.

4 years agoFix broken tests on nightly
Alex Crichton [Mon, 21 Oct 2019 16:37:13 +0000 (09:37 -0700)]
Fix broken tests on nightly

4 years agoInherit `panic` settings in test/bench profiles
Alex Crichton [Fri, 18 Oct 2019 13:39:57 +0000 (06:39 -0700)]
Inherit `panic` settings in test/bench profiles

We've always ignored the `panic` settings configured in test/bench
profiles, so this just continues to ignore them but in a slightly
different way.

4 years agoSupport rustc's `-Z panic-abort-tests` in Cargo
Alex Crichton [Mon, 30 Sep 2019 15:48:43 +0000 (08:48 -0700)]
Support rustc's `-Z panic-abort-tests` in Cargo

Recently added in rust-lang/rust#64158 the `-Z panic-abort-tests` flag
to the compiler itself will activate a mode in the `test` crate which
enables running tests even if they're compiled with `panic=abort`.  It
effectively runs a test-per-process.

This commit brings the same support to Cargo, adding a `-Z
panic-abort-tests` flag to Cargo which allows building tests in
`panic=abort` mode. While I wanted to be sure to add support for this in
Cargo before we stabilize the flag in `rustc`, I don't actually know how
we're going to stabilize this here. Today Cargo will automatically
switch test targets to `panic=unwind`, and so if we actually were to
stabilize this flag then this configuration would break:

    [profile.dev]
    panic = 'abort'

In that case tests would be compiled with `panic=unwind` (due to how
profiles work today) which would clash with crates also being compiled
with `panic=abort`. I'm hopeful though that we can perhaps either figure
out a solution for this and maybe even integrate it with the ongoing
profiles work.

4 years agoAuto merge of #7526 - ehuss:rustfmt, r=alexcrichton
bors [Fri, 18 Oct 2019 22:20:14 +0000 (22:20 +0000)]
Auto merge of #7526 - ehuss:rustfmt, r=alexcrichton

rustfmt for nightly changes.

Something in the latest nightly versions of rustfmt has slightly changed the logic here. Fortunately stable ignores the new formatting, and it looks better to me anyways.  I tend to always use nightly, so this helps me with a slight annoyance where this line keeps getting changed.

4 years agoWrap some really long lines.
Eric Huss [Fri, 18 Oct 2019 22:17:59 +0000 (15:17 -0700)]
Wrap some really long lines.

These do not wrap due to https://github.com/rust-lang/rustfmt/issues/3863.

4 years agorustfmt for nightly changes.
Eric Huss [Fri, 18 Oct 2019 21:20:01 +0000 (14:20 -0700)]
rustfmt for nightly changes.

4 years agoAuto merge of #7525 - ehuss:allow-all-features-virtual-ws, r=alexcrichton
bors [Fri, 18 Oct 2019 17:07:21 +0000 (17:07 +0000)]
Auto merge of #7525 - ehuss:allow-all-features-virtual-ws, r=alexcrichton

Allow --all-features in root of virtual workspace.

Accidentally restricted in #7507, pointed out by @hjmallon, `--all-features` flag is allowed in the root of a virtual workspace.  Added a test to demonstrate its strange behavior.

For anyone that is curious, [this line](https://github.com/rust-lang/cargo/blob/3a9abe3f065554a7fbc59f440df2baba4a6e47ee/src/cargo/ops/resolve.rs#L302) is the code responsible for this behavior.

4 years agoAllow --all-features in root of virtual workspace.
Eric Huss [Fri, 18 Oct 2019 16:39:58 +0000 (09:39 -0700)]
Allow --all-features in root of virtual workspace.

4 years agoRefactor the common code for generating an archive member
Bruce Guenter [Fri, 18 Oct 2019 15:35:27 +0000 (09:35 -0600)]
Refactor the common code for generating an archive member

Signed-off-by: Bruce Guenter <bruce@untroubled.org>
4 years agoSet timestamp on generated files in archive to now
Bruce Guenter [Thu, 17 Oct 2019 21:40:05 +0000 (15:40 -0600)]
Set timestamp on generated files in archive to now

When generating files (Cargo.lock, Cargo.toml, and
.cargo_vcs_info.json), cargo neglected to set any timestamp on the file
in the archive. This results in them being created on disk with a
timestamp of 0 (Jan 1 1970 GMT) which is confusing another tool I use.

This patch alters the behavior to set the mtime to now.

Signed-off-by: Bruce Guenter <bruce@untroubled.org>
4 years agoAuto merge of #7512 - Xyene:patch-1, r=alexcrichton
bors [Tue, 15 Oct 2019 15:55:35 +0000 (15:55 +0000)]
Auto merge of #7512 - Xyene:patch-1, r=alexcrichton

Fix typo in git index initialization error path

This PR proposes a fix for a small typo I ran into while using `cargo`.

4 years agoAuto merge of #7507 - ehuss:virtual-ws-features, r=alexcrichton
bors [Tue, 15 Oct 2019 15:26:07 +0000 (15:26 +0000)]
Auto merge of #7507 - ehuss:virtual-ws-features, r=alexcrichton

Reject feature flags in a virtual workspace.

This generates an error if feature flags are used in the root of a virtual workspace. Previously these flags were completely ignored.  In the interest of avoiding confusion, I think it would be good to be explicit that these don't currently work.  This could alternatively be a warning, but I think it is better to reject it outright.

cc #4753, #3620, #5015, #6195, etc.

4 years agoAuto merge of #7504 - ehuss:rename-package-overrides, r=alexcrichton
bors [Tue, 15 Oct 2019 15:01:26 +0000 (15:01 +0000)]
Auto merge of #7504 - ehuss:rename-package-overrides, r=alexcrichton

Rename `overrides` to `package` in profiles.

Renaming per the discussion at https://github.com/rust-lang/rust/issues/48683#issuecomment-488842694.

I left backwards-compatibility in case anyone is using it, since it required very little effort.

cc @da-x, FYI.

4 years agoAuto merge of #7333 - ehuss:allow-dev-dep-path, r=alexcrichton
bors [Tue, 15 Oct 2019 14:38:29 +0000 (14:38 +0000)]
Auto merge of #7333 - ehuss:allow-dev-dep-path, r=alexcrichton

Allow publishing with dev-dependencies without a version.

This change allows dev-dependencies without a `version` key to be published.  If a dev-dependency is missing the `version`, it will be stripped from the packaged manifest.

4 years agoAuto merge of #7450 - ehuss:stabilize-cache-messages, r=alexcrichton
bors [Tue, 15 Oct 2019 13:48:13 +0000 (13:48 +0000)]
Auto merge of #7450 - ehuss:stabilize-cache-messages, r=alexcrichton

Stabilize cache-messages

This stabilizes the -Zcache-messages feature, making it always enabled.

## What is stabilized?

This feature is intended to redisplay previous warnings on a "fresh" build instead of displaying no output.

Users have occasionally indicated frustration when they know there are warnings, but no output is displayed when the build is fresh. This also improves the interaction between `cargo check` and `cargo clippy-preview`. This also simplifies the code, and opens more possibilities for `rustc` to send side-channel messages to Cargo.

Cargo will now use JSON output from `rustc` and `rustdoc` 100% of the time (`rustdoc --test` does not use JSON). Previously Cargo would only use JSON for pipelined crates.

Cargo will save the JSON output into a file named `output` in the `.fingerprint` directory. This file is only created when the compiler outputs a diagnostic message.

If a crate is being recompiled, and Cargo considers it to be "fresh", it will replay the output file to the console.

## Notable changes in this PR

- Fixed a bug where replays were erroneously including pipeline rmeta artifact json messages.
- clippy-preview is now included in the metadata hash, to force its artifacts to be separate from `cargo check`.
- clippy-preview is no longer force-enabled, under the assumption that caching and fingerprinting is accurate, and the cached messages will be replayed.
- clippy-preview's arguments are included in the fingerprint now that it is not force-enabled.
- Rustdoc colors and short messages were fixed when pipelining was stabilized, so updated tests.

Closes #6986
Closes #6848
Closes #6664
Closes #2458

## Concerns

The only notable issue with this is that switching between short and long human messages only replays the format from the first invocation.  That is, if you do `cargo build` and it generates warnings, then running again with `--message-format=short` will still show the full length human messages. I'm personally fine with that behavior, even though it is not ideal. I think this feature overall improves the situation (where before *no* output was displayed). Being able to re-render between short/long is a very difficult problem, and unlikely to be fixable in the foreseeable future.

There was some concern expressed about being able to disable this. I think that would only be necessary if a severe bug is discovered. I do not feel that this change is risky enough to warrant a configurable option. If it does cause a problem, it can be quickly reverted with a one-line change to set `OutputOptions::cache_cell` to `None`. Since pipelining has been using JSON output for a while now without complaints, I feel pretty confident in it.

4 years agoFix typo in git index initialization error path
Tudor Brindus [Tue, 15 Oct 2019 02:46:02 +0000 (22:46 -0400)]
Fix typo in git index initialization error path

4 years agoReject feature flags in a virtual workspace.
Eric Huss [Sat, 12 Oct 2019 18:18:06 +0000 (11:18 -0700)]
Reject feature flags in a virtual workspace.

4 years agoRename `overrides` to `package` in profiles.
Eric Huss [Thu, 10 Oct 2019 21:39:30 +0000 (14:39 -0700)]
Rename `overrides` to `package` in profiles.

4 years agoAuto merge of #7502 - matthiaskrgr:dont_lock_target_dir_7490, r=ehuss
bors [Thu, 10 Oct 2019 21:34:35 +0000 (21:34 +0000)]
Auto merge of #7502 - matthiaskrgr:dont_lock_target_dir_7490, r=ehuss

don't lock the package cache when cleaning target dir.

Fixes #7490

4 years agodon't lock the package cache when cleaning target dir.
Matthias Krüger [Thu, 10 Oct 2019 19:48:04 +0000 (21:48 +0200)]
don't lock the package cache when cleaning target dir.

Fixes #7490

4 years agoAuto merge of #7499 - orium:document-rustc-wrapper, r=Eh2406
bors [Thu, 10 Oct 2019 15:37:37 +0000 (15:37 +0000)]
Auto merge of #7499 - orium:document-rustc-wrapper, r=Eh2406

Document rustc wrapper

4 years agoDocument the `rustc-wrapper` configuration.
Diogo Sousa [Wed, 9 Oct 2019 22:40:54 +0000 (23:40 +0100)]
Document the `rustc-wrapper` configuration.

4 years ago`Config::get_tool()` now also accepts the configuration path in idiomatic kebab-case.
Diogo Sousa [Wed, 9 Oct 2019 22:40:01 +0000 (23:40 +0100)]
`Config::get_tool()` now also accepts the configuration path in idiomatic kebab-case.

4 years agoAuto merge of #7456 - alexcrichton:config-only-serde, r=ehuss
bors [Wed, 9 Oct 2019 16:55:15 +0000 (16:55 +0000)]
Auto merge of #7456 - alexcrichton:config-only-serde, r=ehuss

Migrate towards exclusively using serde for `Config`

This series of commits was spawned off a thought I had while reading https://github.com/rust-lang/cargo/issues/7253#issuecomment-535656059, although it ended up not really touching on that at all. I was a little unsettled about how unstructured the config accesses are throughout Cargo and we had sort of two systems (one serde which is nice, one which is more manual) for reading config values.

This PR converts everything to run through serde for deserializing values, except for `get_list` which is funky. There's only one usage of that with the `paths` key though and we can probably fix this soon-ish.

In any case, the highlights of this PR are:

* This PR is surprisingly large. I did a lot of movement in `config.rs` to try to make the file smaller and more understandable.
* The `Value` type which retains information about where it was deserialized from is very special, and has special treatment with serde's data model. That's what allows us to use that and serde at the same time.
* The `ConfigRelativePath` and `ConfigKey` structures have been revamped internally, but morally serve the same purposes as before.
* Cargo now has structured `struct` access for a bunch of its configuration (`net`, `http`, `build`, etc). I would ideally like to move toward a world where this is the *only* way to read configuration, or at least everything conventionally runs through those paths.
* Functionally, this PR should have no difference other than tweaks to error messages here and there, and perhaps more strict validation on commands where we validate more configuration on each run than we previously did.
* This isn't a 100% transition for Cargo yet, but I figured it would be a good idea to post this and get some feedback first.
* In the long run I want to remove `get_env`, `get_cv`, and `get_*_priv` from `Config` as internal details. I'd like to move this all to `de.rs` and have it walk down the tree of configuration as we deserialize a value. For now though these all remain in place and that refactoring is left to a future PR.

4 years agoMore review comments
Alex Crichton [Wed, 9 Oct 2019 16:54:57 +0000 (09:54 -0700)]
More review comments

4 years agoAuto merge of #7492 - ehuss:enable-msvc-tests, r=alexcrichton
bors [Tue, 8 Oct 2019 22:12:48 +0000 (22:12 +0000)]
Auto merge of #7492 - ehuss:enable-msvc-tests, r=alexcrichton

Re-enable some MSVC tests.

These tests were disabled for MSVC in #7400, but I would prefer to keep them running.

4 years agoAuto merge of #7489 - da-x:fix-7488, r=ehuss
bors [Tue, 8 Oct 2019 19:53:13 +0000 (19:53 +0000)]
Auto merge of #7489 - da-x:fix-7488, r=ehuss

when -Z unstable-options not specified, don't validate --profile

This fixes a regression caused by 8b0561d68f12 - Closes #7488.

4 years agoRe-enable some MSVC tests.
Eric Huss [Tue, 8 Oct 2019 17:13:24 +0000 (10:13 -0700)]
Re-enable some MSVC tests.

4 years agoRustfmt lint
Dan Aloni [Tue, 8 Oct 2019 08:07:19 +0000 (11:07 +0300)]
Rustfmt lint

4 years agotests: cover issue #7488
Dan Aloni [Tue, 8 Oct 2019 06:48:31 +0000 (09:48 +0300)]
tests: cover issue #7488

4 years agoAuto merge of #7470 - alexcrichton:cyclic-error, r=Eh2406
bors [Tue, 8 Oct 2019 01:16:07 +0000 (01:16 +0000)]
Auto merge of #7470 - alexcrichton:cyclic-error, r=Eh2406

Improve error message for cyclic dependencies

First reported in rust-lang/rust#65014 it looks like our error message
on cyclic dependencies may be confusing at times. It looks like this is
an issue because there are multiple paths through a graph for a
dependency, so using the generic `path_to_top` function isn't producing
the most useful path for this purpose.

We're already walking the graph though, so this commit adds an extra
parameter which collects the list of packages we've visited so far to
produce a hopefully always-accurate error message showing the chain of
dependencies end-to-end for what depends on what.

4 years agoAdd comments of `Value<T>`'s deserialization protocol
Alex Crichton [Tue, 8 Oct 2019 00:11:30 +0000 (17:11 -0700)]
Add comments of `Value<T>`'s deserialization protocol

4 years agoDocument the new `ConfigKey` implementation
Alex Crichton [Tue, 8 Oct 2019 00:02:18 +0000 (17:02 -0700)]
Document the new `ConfigKey` implementation

4 years agoRemove unnecessary clone
Alex Crichton [Mon, 7 Oct 2019 23:54:18 +0000 (16:54 -0700)]
Remove unnecessary clone

4 years agoAdd documentation for `StringList`
Alex Crichton [Mon, 7 Oct 2019 23:53:36 +0000 (16:53 -0700)]
Add documentation for `StringList`

4 years agoUse `#[serde(rename_all)]` instead of listing them all
Alex Crichton [Mon, 7 Oct 2019 23:52:07 +0000 (16:52 -0700)]
Use `#[serde(rename_all)]` instead of listing them all

4 years agoRun rustfmt
Alex Crichton [Thu, 3 Oct 2019 19:18:48 +0000 (12:18 -0700)]
Run rustfmt

4 years agoHandle rebase conflicts
Alex Crichton [Thu, 3 Oct 2019 19:17:18 +0000 (12:17 -0700)]
Handle rebase conflicts

4 years agoSimplify `cargo-new` configuration reading
Alex Crichton [Fri, 27 Sep 2019 21:24:15 +0000 (14:24 -0700)]
Simplify `cargo-new` configuration reading

No need for lots of extra helpers/parsing when using serde!

4 years agoConsolidate `build` key configuration
Alex Crichton [Fri, 27 Sep 2019 21:19:48 +0000 (14:19 -0700)]
Consolidate `build` key configuration

Add a typed structure which lists all `build` key configuration
throughout Cargo.

4 years agoRemove dead `Config::get_i64` method
Alex Crichton [Fri, 27 Sep 2019 20:02:50 +0000 (13:02 -0700)]
Remove dead `Config::get_i64` method

4 years agoRemove no-longer-needed `Config::get_bool`
Alex Crichton [Fri, 27 Sep 2019 20:01:25 +0000 (13:01 -0700)]
Remove no-longer-needed `Config::get_bool`

4 years agoConsolidate `net` configuration into a typed structure
Alex Crichton [Fri, 27 Sep 2019 20:00:53 +0000 (13:00 -0700)]
Consolidate `net` configuration into a typed structure

Less need for `get_bool` and friends!

4 years agoAccess `term` config through a deserialized type
Alex Crichton [Fri, 27 Sep 2019 19:55:46 +0000 (12:55 -0700)]
Access `term` config through a deserialized type

Going through and removing users of raw `get_*` functions!

4 years agoCentralize HTTP configuration in one struct
Alex Crichton [Fri, 27 Sep 2019 19:51:44 +0000 (12:51 -0700)]
Centralize HTTP configuration in one struct

Gives us one nice place to access and document all HTTP-related configuration

4 years agoRemove a usage of `get_list`
Alex Crichton [Fri, 27 Sep 2019 19:33:28 +0000 (12:33 -0700)]
Remove a usage of `get_list`

This callsite doesn't need the full power of `get_list`, knowing the
definition path of each element along the list.

4 years agoFinish implementing `Value`, use it in helpers
Alex Crichton [Fri, 27 Sep 2019 19:29:01 +0000 (12:29 -0700)]
Finish implementing `Value`, use it in helpers

Rewrite helpers like `get_bool` to use `get::<Option<Value<bool>>>`
instead of duplicating the logic that's already with the typed access of
configuration. This is more along the effort to centralize all
deserialization of configuration into typed values instead of using
ad-hoc accessors in a number of locations.

4 years agoRefactor `ConfigKey` to its own file
Alex Crichton [Fri, 27 Sep 2019 18:34:29 +0000 (11:34 -0700)]
Refactor `ConfigKey` to its own file

Also make it a little less allocation-heavy by tweaking the API to
encourage incremental building of the key and incremental destruction as
we walk throughout the configuration tree.

4 years agoExtra serde config support to a separate file
Alex Crichton [Thu, 26 Sep 2019 21:09:17 +0000 (14:09 -0700)]
Extra serde config support to a separate file

4 years agoMove `config.rs` to `config/mod.rs`
Alex Crichton [Thu, 26 Sep 2019 20:59:05 +0000 (13:59 -0700)]
Move `config.rs` to `config/mod.rs`

4 years agoImprove error message for cyclic dependencies
Alex Crichton [Wed, 2 Oct 2019 20:42:42 +0000 (13:42 -0700)]
Improve error message for cyclic dependencies

First reported in rust-lang/rust#65014 it looks like our error message
on cyclic dependencies may be confusing at times. It looks like this is
an issue because there are multiple paths through a graph for a
dependency, so using the generic `path_to_top` function isn't producing
the most useful path for this purpose.

We're already walking the graph though, so this commit adds an extra
parameter which collects the list of packages we've visited so far to
produce a hopefully always-accurate error message showing the chain of
dependencies end-to-end for what depends on what.

4 years agoAuto merge of #7484 - ehuss:clippy-fixes, r=alexcrichton
bors [Mon, 7 Oct 2019 23:29:59 +0000 (23:29 +0000)]
Auto merge of #7484 - ehuss:clippy-fixes, r=alexcrichton

Some minor clippy fixes.

4 years agonamed-profiles: when -Z unstable-options not specified, don't validate --profile
Dan Aloni [Mon, 7 Oct 2019 20:09:17 +0000 (23:09 +0300)]
named-profiles: when -Z unstable-options not specified, don't validate --profile

Fixes #7488.

4 years agoSome minor clippy fixes.
Eric Huss [Fri, 4 Oct 2019 21:21:28 +0000 (14:21 -0700)]
Some minor clippy fixes.

4 years agoAuto merge of #7481 - Lythenas:doc-spdx-list-3.6, r=ehuss
bors [Fri, 4 Oct 2019 17:36:12 +0000 (17:36 +0000)]
Auto merge of #7481 - Lythenas:doc-spdx-list-3.6, r=ehuss

Update SPDX list to 3.6

Fixes #7477

4 years agoAuto merge of #7482 - alexcrichton:fix-bin, r=ehuss
bors [Fri, 4 Oct 2019 17:07:14 +0000 (17:07 +0000)]
Auto merge of #7482 - alexcrichton:fix-bin, r=ehuss

Fix wrong directories in PATH on Windows

This fixes an accidental regression from #7425 where `PATH` was being
augmented on Windows with the wrong search path for target/host
libraries. This commit fixes the issue by simply always calculating the
host/target library paths for `TargetInfo`, and then we explicitly use
the same `TargetInfo` for filling out information in `Compilation`.

Closes #7475

4 years agoFix wrong directories in PATH on Windows
Alex Crichton [Fri, 4 Oct 2019 15:04:48 +0000 (08:04 -0700)]
Fix wrong directories in PATH on Windows

This fixes an accidental regression from #7425 where `PATH` was being
augmented on Windows with the wrong search path for target/host
libraries. This commit fixes the issue by simply always calculating the
host/target library paths for `TargetInfo`, and then we explicitly use
the same `TargetInfo` for filling out information in `Compilation`.

Closes #7475

4 years agoAuto merge of #7476 - tlively:emscripten-wasm-aux, r=alexcrichton
bors [Fri, 4 Oct 2019 14:50:53 +0000 (14:50 +0000)]
Auto merge of #7476 - tlively:emscripten-wasm-aux, r=alexcrichton

Mark Emscripten's .wasm files auxiliary

This fixes #7471 and fixes #7255 by preventing the .wasm file from
being treated as an executable binary, so `cargo test` and `cargo run`
will no longer try to execute it directly. This change is only made
for Emscripten, which outputs a .js file as the primary executable
entry point, as opposed to other WebAssembly targets for which the
.wasm file is the only output.

4 years agoUpdate SPDX list to 3.6
Matthias Seiffert [Fri, 4 Oct 2019 13:59:40 +0000 (15:59 +0200)]
Update SPDX list to 3.6

4 years agoDrop unnecessary target check
Thomas Lively [Fri, 4 Oct 2019 01:06:00 +0000 (18:06 -0700)]
Drop unnecessary target check

4 years agorustfmt, even if I disagree
Thomas Lively [Thu, 3 Oct 2019 23:57:30 +0000 (16:57 -0700)]
rustfmt, even if I disagree

4 years agoMark Emscripten's .wasm files auxiliary
Thomas Lively [Thu, 3 Oct 2019 23:42:23 +0000 (16:42 -0700)]
Mark Emscripten's .wasm files auxiliary

This fixes #7471 and fixes #7255 by preventing the .wasm file from
being treated as an executable binary, so `cargo test` and `cargo run`
will no longer try to execute it directly. This change is only made
for emscripten, which outputs a .js file as the primary executable
entry point, as opposed to other WebAssembly targets for which the
.wasm file is the only output.

4 years agoAuto merge of #7464 - alexcrichton:update-curl-sys, r=ehuss
bors [Wed, 2 Oct 2019 17:55:29 +0000 (17:55 +0000)]
Auto merge of #7464 - alexcrichton:update-curl-sys, r=ehuss

Update `curl-sys` dependency requirement

Pulls in alexcrichton/curl-rust#304 which fixes a bug from the last curl
update in #7308. This bug was not introduced by the Cargo PR itself but
rather by updating the `curl` submodule in the `curl-sys` crate. Without
this bugfix all downloads of a crate will make a new connection to
crates.io, which drastically increases download time since setting up a
connection takes so long.

4 years agoAuto merge of #7443 - guanqun:patch-1, r=ehuss
bors [Wed, 2 Oct 2019 17:31:03 +0000 (17:31 +0000)]
Auto merge of #7443 - guanqun:patch-1, r=ehuss

add dependencies for `pkg-config`

Otherwise, it complains:

    run pkg_config fail: "Failed to run `\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"`: No such file or directory (os error 2)"

4 years agoAuto merge of #7400 - snf:fix_7358, r=alexcrichton
bors [Wed, 2 Oct 2019 15:55:23 +0000 (15:55 +0000)]
Auto merge of #7400 - snf:fix_7358, r=alexcrichton

Removing hash from output files when using MSVC

This is the fix for https://github.com/rust-lang/cargo/issues/7358 suggested by @alexcrichton . Tested and working.

I see a few tests failling but seem unrelated. I'll investigate them tomorrow.

4 years agoAuto merge of #7465 - alexcrichton:no-preserve, r=Eh2406
bors [Wed, 2 Oct 2019 15:31:58 +0000 (15:31 +0000)]
Auto merge of #7465 - alexcrichton:no-preserve, r=Eh2406

Disable preserving mtimes on archives

These are just wasted syscalls for our purposes, no need to issue
updates to the modification/creation/access times of files we unpack!

4 years agoremoving hash from output files when using MSVC
snf [Sat, 21 Sep 2019 01:38:24 +0000 (22:38 -0300)]
removing hash from output files when using MSVC

4 years agoDisable preserving mtimes on archives
Alex Crichton [Tue, 1 Oct 2019 21:39:13 +0000 (14:39 -0700)]
Disable preserving mtimes on archives

These are just wasted syscalls for our purposes, no need to issue
updates to the modification/creation/access times of files we unpack!

4 years agoUpdate `curl-sys` dependency requirement
Alex Crichton [Tue, 1 Oct 2019 21:36:04 +0000 (14:36 -0700)]
Update `curl-sys` dependency requirement

Pulls in alexcrichton/curl-rust#304 which fixes a bug from the last curl
update in #7308. This bug was not introduced by the Cargo PR itself but
rather by updating the `curl` submodule in the `curl-sys` crate. Without
this bugfix all downloads of a crate will make a new connection to
crates.io, which drastically increases download time since setting up a
connection takes so long.

4 years agoAuto merge of #7462 - hbina:redundant_borrow, r=ehuss
bors [Tue, 1 Oct 2019 20:35:54 +0000 (20:35 +0000)]
Auto merge of #7462 - hbina:redundant_borrow, r=ehuss

Removed redundant borrow

As described here https://rust-lang.github.io/rust-clippy/master/#needless_borrow.
rust-clippy is complaining that the related borrows are unnecessary.

4 years agoAuto merge of #7361 - Eh2406:public_dependency-as-type_4, r=alexcrichton
bors [Tue, 1 Oct 2019 19:01:47 +0000 (19:01 +0000)]
Auto merge of #7361 - Eh2406:public_dependency-as-type_4, r=alexcrichton

Public dependency refactor and re-allow backjumping

There were **three** attempts at vanquishing exponential time spent in Public dependency resolution. All failures. All three started with some refactoring that seams worth saving. Specifically the data structure `public_dependency` that is used to test for Public dependency conflicts is large, tricky, and modified in line. So lets make it a type with a name and move the interactions into methods.

Next each attempt needed to know how far back to jump to undo any given dependency edge. I am fairly confident that any full solution will need this functionality. I also think any solution will need a way to represent richer conflicts than the existing "is this pid active". So let's keep the `still_applies` structure from the last attempt.

Last each attempt needs to pick a way to represent a Public dependency conflict. The last attempt used three facts about a situation.

- `a1`: `PublicDependency(p)` witch can be read as the package `p` can see the package `a1`
- `b`: `PublicDependency(p)` witch can be read as the package `p` can see the package `b`
- `a2`: `PubliclyExports(b)` witch can be read as the package `b` has the package `a2` in its publick interface.

This representation is good enough to allow for `backjumping`. I.E. `find_candidate` can go back several frames until the `age` when the Public dependency conflict was introduced. This optimization, added for normal dependencies in #4834, saves the most time in practice. So having it for Public dependency conflicts is important for allowing real world experimentation of the Public dependencies feature.  We will have to alter/improve/replace this representation to unlock all of the important optimizations. But I don't know one that will work for all of them and this is a major step forward.

Can be read one commit at a time.

4 years agoRemoved redundant borrow
Hanif Bin Ariffin [Tue, 1 Oct 2019 18:16:58 +0000 (14:16 -0400)]
Removed redundant borrow

As described here https://rust-lang.github.io/rust-clippy/master/#needless_borrow.
rust-clippy is complaining that the related borrows are unnecessary.

4 years agoAuto merge of #7461 - guanqun:unify-quotes-in-cargo-toml, r=alexcrichton
bors [Tue, 1 Oct 2019 13:06:40 +0000 (13:06 +0000)]
Auto merge of #7461 - guanqun:unify-quotes-in-cargo-toml, r=alexcrichton

unify the quote in Cargo.toml

A bit nit-picked...

It tries to use double-quotes in Cargo.toml instead of single quote, that would be more uniform in this file.

4 years agounify the quote in Cargo.toml
Guanqun Lu [Tue, 1 Oct 2019 07:39:57 +0000 (15:39 +0800)]
unify the quote in Cargo.toml

4 years agoStabilize cache-messages
Eric Huss [Wed, 25 Sep 2019 01:17:36 +0000 (18:17 -0700)]
Stabilize cache-messages

4 years agoAuto merge of #6989 - da-x:custom-profile-pr-rfc, r=ehuss
bors [Mon, 30 Sep 2019 19:51:19 +0000 (19:51 +0000)]
Auto merge of #6989 - da-x:custom-profile-pr-rfc, r=ehuss

Support for named profiles (RFC 2678)

Tracking issue: https://github.com/rust-lang/cargo/issues/6988

Implementation according to the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/2678-named-custom-cargo-profiles.md).

4 years agoAuto merge of #7308 - guanqun:add-ssl-version, r=alexcrichton
bors [Mon, 30 Sep 2019 18:35:21 +0000 (18:35 +0000)]
Auto merge of #7308 - guanqun:add-ssl-version, r=alexcrichton

add an option to specify ssl version

Fixes #6684

4 years agoadd a bit more docs
Guanqun Lu [Mon, 30 Sep 2019 16:05:23 +0000 (00:05 +0800)]
add a bit more docs

4 years agorun cargo fmt to pass the CI build
Guanqun Lu [Mon, 30 Sep 2019 15:48:08 +0000 (23:48 +0800)]
run cargo fmt to pass the CI build

4 years agoAuto merge of #7417 - alexcrichton:less-hashing, r=Eh2406
bors [Mon, 30 Sep 2019 14:57:58 +0000 (14:57 +0000)]
Auto merge of #7417 - alexcrichton:less-hashing, r=Eh2406

Go back to not hashing `RUSTFLAGS` in `-Cmetadata`

This is a moral revert of #6503 but not a literal code revert. This
switches Cargo's behavior to avoid hashing compiler flags into
`-Cmetadata` since we've now had multiple requests of excluding flags
from the `-Cmetadata` hash: usage of `--remap-path-prefix` and PGO
options. These options should only affect how the compiler is
invoked/compiled and not radical changes such as symbol names, but
symbol names are changed based on `-Cmetadata`. Instead Cargo will still
track these flags internally, but only for reinvoking rustc, and not for
caching separately based on rustc flags.

Closes #7416

4 years agofixes
Guanqun Lu [Sun, 29 Sep 2019 16:32:57 +0000 (00:32 +0800)]
fixes

4 years agomodify to enum/struct and add test for SslVersionConfig
Guanqun Lu [Sun, 29 Sep 2019 16:29:15 +0000 (00:29 +0800)]
modify to enum/struct and add test for SslVersionConfig

4 years agonamed-profiles: fix backward compatibility for `rustc` with `--profile=check`
Dan Aloni [Fri, 27 Sep 2019 22:10:08 +0000 (01:10 +0300)]
named-profiles: fix backward compatibility for `rustc` with `--profile=check`

And a small cleanup in `base_profile` to make the logic parallel to the
one in `get_profile`.

4 years agoadd a test to show the new performance
Eh2406 [Fri, 13 Sep 2019 19:22:43 +0000 (15:22 -0400)]
add a test to show the new performance