]> git.proxmox.com Git - cargo.git/log
cargo.git
4 years agoAuto merge of #7568 - ehuss:version-bump, r=alexcrichton
bors [Thu, 7 Nov 2019 19:33:43 +0000 (19:33 +0000)]
Auto merge of #7568 - ehuss:version-bump, r=alexcrichton

Update verison to 0.42

- Update changelog
- Update some tests
- Fix a nightly warning
- Remove `--crate-type` check for rustdoc.

4 years agoBump to 0.42.0, Update changelog
Eric Huss [Thu, 7 Nov 2019 19:19:48 +0000 (11:19 -0800)]
Bump to 0.42.0, Update changelog

4 years agoRemove some needless parentheses now reported on nightly.
Eric Huss [Thu, 7 Nov 2019 19:19:07 +0000 (11:19 -0800)]
Remove some needless parentheses now reported on nightly.

4 years agoUpdate some tests that now support stable.
Eric Huss [Thu, 7 Nov 2019 19:16:18 +0000 (11:16 -0800)]
Update some tests that now support stable.

4 years agoRemove --crate-type test for rustdoc now that it is stable.
Eric Huss [Thu, 7 Nov 2019 19:14:49 +0000 (11:14 -0800)]
Remove --crate-type test for rustdoc now that it is stable.

4 years agoAuto merge of #7565 - ehuss:expand-build-script-docs, r=alexcrichton
bors [Thu, 7 Nov 2019 19:01:23 +0000 (19:01 +0000)]
Auto merge of #7565 - ehuss:expand-build-script-docs, r=alexcrichton

Expand documentation on build scripts.

This restructures and adds some more documentation for writing build scripts. An overview:

- Move examples to a separate chapter.
    - Add some links to common build dependencies.
    - Rewrote the example of linking to system libraries.
    - Rewrote some of the `links` and `-sys` examples.
    - Added a "conditional compilation" example.
- De-emphasize setting `build = "build.rs"`.
- Explain how build scripts run.
- Give each `cargo:` instruction a separate section with more detail.
- More detail on how `rerun-if` stuff works. Also, try to emphasize best practices, especially in examples.
- Try to clarify `links` and go into more detail.
- Document the jobserver.
- Expand on environment variables.
    - Document dylib search path behavior.

I have explicitly skipped trying to document rpath issues, as it seems to be a mess, and I can't really sort it out.

I'd be happy to have any feedback for things to add or change.

Closes #1251
Closes #2236
Closes #2888
Closes #3304
Closes #3968
Closes #5499
Closes #7338

4 years agoAdd some warnings/disclaimers about build-dependencies.
Eric Huss [Thu, 7 Nov 2019 17:02:49 +0000 (09:02 -0800)]
Add some warnings/disclaimers about build-dependencies.

Also add `autocfg` to the list.

4 years agoAuto merge of #7566 - rust-lang:dependabot/cargo/crossbeam-utils-0.7, r=alexcrichton
bors [Thu, 7 Nov 2019 15:29:17 +0000 (15:29 +0000)]
Auto merge of #7566 - rust-lang:dependabot/cargo/crossbeam-utils-0.7, r=alexcrichton

Update crossbeam-utils requirement from 0.6 to 0.7

Updates the requirements on [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [crossbeam-utils's changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md).*

> # Version 0.7.0
>
> - Remove `ArcCell`, `MsQueue`, and `TreiberStack`.
> - Change the interface of `ShardedLock` to match `RwLock`.
> - Add `SegQueue::len()`.
> - Rename `SegQueue::try_pop()` to `SegQueue::pop()`.
> - Change the return type of `SegQueue::pop()` to `Result`.
> - Introduce `ArrayQueue`.
> - Update dependencies.
>
> # Version 0.6.0
>
> - Update dependencies.
>
> # Version 0.5.0
>
> - Update `crossbeam-channel` to 0.3.
> - Update `crossbeam-utils` to 0.6.
> - Add `AtomicCell`, `SharedLock`, and `WaitGroup`.
>
> # Version 0.4.1
>
> - Fix a double-free bug in `MsQueue` and `SegQueue`.
>
> # Version 0.4
>
> - Switch to the new implementation of epoch-based reclamation in
>   [`crossbeam-epoch`](https://github.com/crossbeam-rs/crossbeam-epoch), fixing numerous bugs in the
>   old implementation.  Its API is changed in a backward-incompatible way.
> - Switch to the new implementation of `CachePadded` and scoped thread in
>   [`crossbeam-utils`](https://github.com/crossbeam-rs/crossbeam-utils).  The scoped thread API is
>   changed in a backward-incompatible way.
> - Switch to the new implementation of Chase-Lev deque in
>   [`crossbeam-deque`](https://github.com/crossbeam-rs/crossbeam-deque).  Its API is changed in a
>   backward-incompatible way.
> - Export channel implemented in
>   [`crossbeam-channel`](https://github.com/crossbeam-rs/crossbeam-channel).
> - Remove `AtomicOption`.
> - Implement `Default` and `From` traits.
>
> # Version 0.3
>
> - Introduced `ScopedThreadBuilder` with the ability to name threads and set stack size
> - `Worker` methods in the Chase-Lev deque don't require mutable access anymore
> - Fixed a bug when unblocking `pop()` in `MsQueue`
> - Implemented `Drop` for `MsQueue`, `SegQueue`, and `TreiberStack`
> - Implemented `Default` for `TreiberStack`
> - Added `is_empty` to `SegQueue`
> - Renamed `mem::epoch` to `epoch`
> - Other bug fixes
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`28ad2b7`](https://github.com/crossbeam-rs/crossbeam/commit/28ad2b7e015832b47db7e389dd9ebce3e94b3adb) Update versions in readmes
- [`c98fea1`](https://github.com/crossbeam-rs/crossbeam/commit/c98fea12e67447d71065539fe2cdde545ea57d8b) Merge [#444](https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/444)
- [`d953f49`](https://github.com/crossbeam-rs/crossbeam/commit/d953f49ecc7eb5fe6c271b018a4a753ba435ee58) Add compatibility section to readme
- [`c76f145`](https://github.com/crossbeam-rs/crossbeam/commit/c76f1451820009bb81bbc0ccf782eb976637667f) Prepare for the next release
- [`99762ee`](https://github.com/crossbeam-rs/crossbeam/commit/99762ee63333fcd7b9abcd1c5ede835cba68c438) Merge [#442](https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/442)
- [`ebb6b5f`](https://github.com/crossbeam-rs/crossbeam/commit/ebb6b5fe6d7423a97a7762fa5fde7cb2d801fd39) Do not perform superfluous bounds checks on drop
- [`d2ab7a5`](https://github.com/crossbeam-rs/crossbeam/commit/d2ab7a5c437322e01de7807e3a7803249ec28d20) Update LICENSE-APACHE
- [`f54db88`](https://github.com/crossbeam-rs/crossbeam/commit/f54db88d1a66eea8338176ae288b91a26764f7b7) Merge [#437](https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/437)
- [`caa52c4`](https://github.com/crossbeam-rs/crossbeam/commit/caa52c4e841c11bf2a26489635696080d7deca21) Merge [#436](https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/436)
- [`af68803`](https://github.com/crossbeam-rs/crossbeam/commit/af688031a219f6586b7e8e54719087bc0a1bc693) Merge [#438](https://github-redirect.dependabot.com/crossbeam-rs/crossbeam/issues/438)
- Additional commits viewable in [compare view](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-utils-0.6.0...crossbeam-utils-0.7.0)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

</details>

4 years agoUpdate crossbeam-utils requirement from 0.6 to 0.7
dependabot-preview[bot] [Thu, 7 Nov 2019 05:12:30 +0000 (05:12 +0000)]
Update crossbeam-utils requirement from 0.6 to 0.7

Updates the requirements on [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) to permit the latest version.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-utils-0.6.0...crossbeam-utils-0.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
4 years agoFix some awkward wording.
Eric Huss [Wed, 6 Nov 2019 18:59:08 +0000 (10:59 -0800)]
Fix some awkward wording.

4 years agoAuto merge of #7513 - Eh2406:ci, r=ehuss
bors [Mon, 4 Nov 2019 22:58:40 +0000 (22:58 +0000)]
Auto merge of #7513 - Eh2406:ci, r=ehuss

don't download std-docs on CI

Now that we have a way to do it, lets not download std-docs on CI. Based on the blog post:
https://blog.rust-lang.org/2019/10/15/Rustup-1.20.0.html

4 years agoonly on nightly
Eh2406 [Mon, 4 Nov 2019 21:14:46 +0000 (16:14 -0500)]
only on nightly

4 years agoadd rustc-dev
Eh2406 [Mon, 4 Nov 2019 20:05:12 +0000 (15:05 -0500)]
add rustc-dev

4 years agouse curl on windows
Eh2406 [Sun, 3 Nov 2019 15:51:18 +0000 (10:51 -0500)]
use curl on windows

4 years agouse no-self-update
Eh2406 [Sun, 3 Nov 2019 01:38:55 +0000 (21:38 -0400)]
use no-self-update

4 years agoupdate is annoying
Eh2406 [Tue, 15 Oct 2019 17:21:34 +0000 (13:21 -0400)]
update is annoying

4 years agowidows is annoying
Eh2406 [Tue, 15 Oct 2019 15:54:00 +0000 (11:54 -0400)]
widows is annoying

4 years agodont download std-docs on CI
Eh2406 [Tue, 15 Oct 2019 15:17:14 +0000 (11:17 -0400)]
dont download std-docs on CI

4 years agoAuto merge of #7553 - EverlastingBugstopper:patch-1, r=alexcrichton
bors [Tue, 29 Oct 2019 20:26:58 +0000 (20:26 +0000)]
Auto merge of #7553 - EverlastingBugstopper:patch-1, r=alexcrichton

Change my-buddy to github-handle

This change has the benefit of being both more descriptive and gender neutral

4 years agoChange my-buddy to github-handle
Avery Harnish [Tue, 29 Oct 2019 20:23:34 +0000 (15:23 -0500)]
Change my-buddy to github-handle

This change has the dual benefit of being both more descriptive and gender neutral

4 years agoAuto merge of #7376 - ehuss:filter-platform, r=alexcrichton
bors [Mon, 28 Oct 2019 21:53:41 +0000 (21:53 +0000)]
Auto merge of #7376 - ehuss:filter-platform, r=alexcrichton

Add --filter-platform to `cargo metadata`.

This adds the `--filter-platform` flag to `cargo metadata` to give users a way to filter the resolve information based on the target triple.

This is just a prototype to open for feedback.  Some things that need feedback:

- Debate the name of the flag.
- It uses "host" as a special triple to mean the local host.  Does that make sense?  It seemed a little weird.
- Should it also filter the dependencies in the "packages" array?  Right now it only does resolve.  I'm on the fence. It probably should, but that would be an intrusive change to rewrite the Package values.
- Should the filtering be transitive?  That is, if a package is only reachable by a specific platform, should it be removed from the resolve "nodes"?  What about "packages"?  Currently it is included, with the intent that you walk the resolve starting with a root (like a workspace member).  But it might be surprising to see "winapi" when you filter for a unix platform.

This will need documentation before it is merged.

4 years agoAdd some documentation for --filter-platform.
Eric Huss [Mon, 28 Oct 2019 21:51:03 +0000 (14:51 -0700)]
Add some documentation for --filter-platform.

4 years agoRewrite target filtering to filter the entire graph.
Eric Huss [Tue, 8 Oct 2019 15:08:08 +0000 (08:08 -0700)]
Rewrite target filtering to filter the entire graph.

This also removes the special `host` target.

4 years agoAdd --filter-platform to `cargo metadata`.
Eric Huss [Wed, 18 Sep 2019 00:17:29 +0000 (17:17 -0700)]
Add --filter-platform to `cargo metadata`.

4 years agoAuto merge of #7550 - ehuss:fix-color, r=alexcrichton
bors [Mon, 28 Oct 2019 19:57:57 +0000 (19:57 +0000)]
Auto merge of #7550 - ehuss:fix-color, r=alexcrichton

Fix `cargo fix` not showing colors.

`cargo fix` runs `rustc` a final time after it has finished to:
- Show what happened if the fix failed.
- Show errors with `--broken-code`.
- Show any remaining warnings after a successful fix.

This last run was no longer showing colored diagnostics due to the stabilization of cache-messages. Cargo now unconditionally uses colored JSON messages, and then conditionally strips them after the fact.  "cargo as rustc wrapper" was stripping the JSON flags which allowed Cargo to handle colors.

This fix works by putting the json flags back in for this final pass.

4 years agoAuto merge of #7409 - hoborm:patch-1, r=ehuss
bors [Mon, 28 Oct 2019 19:11:04 +0000 (19:11 +0000)]
Auto merge of #7409 - hoborm:patch-1, r=ehuss

Rephrase --manifest-path section

Change the order of the words, for readability.

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 agoFix `cargo fix` not showing colors.
Eric Huss [Mon, 28 Oct 2019 19:00:09 +0000 (12:00 -0700)]
Fix `cargo fix` not showing colors.

4 years agoAuto merge of #7549 - ehuss:minimal-versions-note, r=alexcrichton
bors [Mon, 28 Oct 2019 17:20:43 +0000 (17:20 +0000)]
Auto merge of #7549 - ehuss:minimal-versions-note, r=alexcrichton

Add a note to discourage the use of -Zminimal-versions.

We've discussed this a few times, that the current implementation isn't working out, so let's be more transparent about it.

4 years agoAdd a note to discourage the use of -Zminimal-versions.
Eric Huss [Mon, 28 Oct 2019 16:26:58 +0000 (09:26 -0700)]
Add a note to discourage the use of -Zminimal-versions.

4 years agoExpand documentation on build scripts.
Eric Huss [Mon, 28 Oct 2019 16:11:06 +0000 (09:11 -0700)]
Expand documentation on build scripts.

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.