9492 Commits

Author SHA1 Message Date
Daniel Wagner-Hall
6eef9a89a7 select_pkg takes a Dependency not name + vers
Handling of these is coupled, so do the handling in one place, close to
where we parse the command line flags, so we can just pass in a single
derived object.
2020-04-13 02:49:16 +01:00
Daniel Wagner-Hall
7a83d615ed Commenty review comments 2020-04-13 02:41:18 +01:00
Tom Dohrmann
5a051ebe08 remove host & target attributes 2020-04-12 17:49:05 +02:00
bors
12d6e84880 Auto merge of #8096 - ehuss:codegen-units-default, r=Eh2406
Update default for codegen-units.

The default for codegen-units was changed in https://github.com/rust-lang/rust/pull/70156.
2020-04-11 22:36:02 +00:00
Eric Huss
704142537c Update default for codegen-units. 2020-04-11 10:55:51 -07:00
Tom Dohrmann
f9f62ff2b9 fix target 2020-04-11 11:33:58 +02:00
bors
53b1c48a51 Auto merge of #8087 - ehuss:freshness-interrupted2, r=alexcrichton
Fix freshness when linking is interrupted.

Fixes a scenario where hitting Ctrl-C while linking would leave a corrupted executable, but Cargo would think it is "fresh" and fail to rebuild it.

This also includes a separate commit which adds more documentation on fingerprinting.

Fixes #7767
2020-04-10 16:33:24 +00:00
Eric Huss
14e86cc703 More fingerprint and metadata comments. 2020-04-09 15:30:41 -07:00
bors
7d720ef051 Auto merge of #8062 - ehuss:tree, r=alexcrichton
Add `cargo tree` command.

This migrates [cargo-tree](https://github.com/sfackler/cargo-tree/) into Cargo as a built-in command. This is based on a recent master (4108d216ec), and should be mostly similar in functionality. There are a variety changes:

* `--all-targets` renamed to `--no-filter-targets` to avoid confusion with the `--all-targets` flag used in other Cargo commands with a different meaning.
* `--all`/`-a` renamed to `--no-dedupe` to avoid confusion with the `-all` flag which means "all workspace crates" in other Cargo commands.
* `--duplicate` renamed to `--duplicates` (with alias), just a personal preference.
* Added support for multiple roots (workspace support).
* Added the `--graph-features` flag for including features in the graph (to "explain" why a feature is enabled).
* Added `{f}` to format string to show features.
* Handles new feature resolver.
* Handles cyclical dev dependencies.
* Added a test suite.
* Dropped the dependency on petgraph, in favor of a simpler custom graph.

Closes #7286.
2020-04-09 19:53:41 +00:00
bors
239f2bfd0c Auto merge of #8069 - ehuss:build-finished, r=alexcrichton
Add "build-finished" JSON message.

This adds a JSON message when a build is finished.  This is useful for tools to know when to stop parsing JSON, which is particularly useful for commands like `cargo test` or `cargo run` where additional output may follow.

Closes #7978
2020-04-09 19:34:39 +00:00
Eric Huss
cd396f340a Fix freshness when linking is interrupted. 2020-04-09 08:46:14 -07:00
bors
3a976c1767 Auto merge of #8074 - ehuss:package-features2, r=alexcrichton
Extend -Zpackage-features with more capabilities.

This is a proposal to extend `-Zpackage-features` with new abilities to change how features are selected on the command-line.  See `unstable.md` for documentation on what it does.

I've contemplated a variety of ways we could transition this to stable. I tried a few experiments trying to make a "transition with warnings" mode, but I'm just too concerned about breaking backwards compatibility.  The current way is just fundamentally different from the new way, and I think it would be a bumpy ride to try to push it.

The stabilization story is that the parts of this that add new functionality (feature flags in virtual worskpaces, and `member/feat` syntax) can be stabilized at any time.  The change for `cargo build -p member --features feat` in a different member's directory can maybe be part of `-Zfeatures` stabilization, which will need to be opt-in.  I've been trying to come up with some transition plan, and I can't think of a way without making it opt-in, and making it part of `-Zfeatures` is an opportunity to simplify things.  One concern is that this might be confusing (`--features` flag could behave differently in different workspaces, and documenting the differences), but that seems hard to avoid.

Closes #6195
Closes #4753
Closes #5015
Closes #4106
Closes #5362
2020-04-09 15:43:07 +00:00
Eric Huss
cc53ecad0b Add some more exposition on fingerprints. 2020-04-09 08:42:46 -07:00
bors
1e6ed94ad7 Auto merge of #8090 - mbStavola:invalid-dep-naming, r=alexcrichton
Disallow invalid dependency names through crate renaming

resolves #6656

As suggested in the issue, I simply checked the dep names by calling `validate_package_name` on the dependencies during the TOML deserialization process.

It might be a bit too strict (and sudden) to error out in this case, so it might be best to convert this into a warning instead. However, this _is_ pretty invalid behavior so I'm not too sure really.
2020-04-09 15:26:04 +00:00
bors
da54d6b219 Auto merge of #8073 - ehuss:hash-channel, r=alexcrichton
Use the same filename hash for pre-release channels.

This changes it so that filenames do not hash the entire verbose version from rustc if they are a pre-release version. The intent is to avoid leaving stale artifacts in the target directory whenever someone updates a nightly or beta release. This should help reduce disk space usage for someone who updates these toolchains frequently.

I tested with the rustc repo, and it seems to be OK. It keeps everything in separate target directories, so I think it should be generally safe. This should only affect someone switching between different nightlies and wanting to avoid recompiling when switching back. I suspect that is a rare use case, though if there are complaints this can be easily reverted (or made a config option). cargo-bisect-rustc should also be safe since it uses a different target directory for each toolchain.

One concern here for me was incremental support. It looks like ([src](6387b09153/src/librustc_incremental/persist/file_format.rs (L88-L100))) the incremental cache includes the detailed rustc version, so I think that is safe. It also looks like it is [smart enough](6387b09153/src/librustc_incremental/persist/load.rs (L40-L49)) to delete stale files.

We will need to be more careful in the future when changing the target directory structure or the format of files. We previously relied on the fact that each new nightly will use different filenames. If we change the structure in a backwards-incompatible way, we will need to be careful to update the version (`1.hash` in `compute_metadata`).
2020-04-09 14:25:08 +00:00
Matt Stavola
fcff51b3e0
Add test for bad renaming 2020-04-08 23:46:30 -07:00
Matt Stavola
420608bc70
Error on invalid dependency naming 2020-04-08 23:15:33 -07:00
Eric Huss
fdfdb3ddad Add escape hatch for nightly version hashing. 2020-04-08 14:21:10 -07:00
Eric Huss
54ace8af65 Merge -Zpackage-features2 and -Zpackage-features. 2020-04-08 14:06:09 -07:00
bors
fd25241d3e Auto merge of #8081 - t-nelis:index-commands-section, r=ehuss
Index the commands section
2020-04-07 19:47:54 +00:00
bors
3fc174d790 Auto merge of #8083 - t-nelis:mdbook-v0.3.7, r=ehuss
Upgrade to mdBook v0.3.7

This bumps the requirement from Rust v1.34.0 to v1.35.0 for building docs. AFAICT CI is using nightlies so that should be fine, but I thought I'd mention it in case someone thinks this impacts contributors in any way.

Other than that, there are a few changes that might impact some users in a visible way, like automatic dark theme support for those who picked that perference in their browser, possible color changes to the scrollbar and to the font size, change in the spacing in the sidebar entries, and many more changes and fixes that won't be too immediately impactful but very good all around.

I checked changes from transitive dependency bumps as well, AFAICT there is nothing that *should* impact the final rendering.

**tl;dr:** Nothing will explode. Probably.

For completeness, my raw notes of outtakes as I was reviewing the change logs:

```
[cosmetic]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Added automatic dark-theme detection based on the CSS prefers-color-scheme feature. This may be enabled by setting output.html.preferred-dark-theme to your preferred dark theme. #1037
https://github.com/rust-lang/mdBook/pull/1037

v0.3.3 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-033
Improvements to the automatic dark theme selection. #1069
https://github.com/rust-lang/mdBook/pull/1069

v0.3.7 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-037
Fixed theme selector focus. #1170
https://github.com/rust-lang/mdBook/pull/1170

* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
* users who picked the dark color scheme in their browser will see the cargo doc in dark.

[cosmetic]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Use standard scrollbar-color CSS along with webkit extension #816
https://github.com/rust-lang/mdBook/pull/816

* https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-color
* scroll bar color might change i guess.

[helpful]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Updated highlight.js for syntax highlighting updates (primarily to add async/await to Rust highlighting). #1041
https://github.com/rust-lang/mdBook/pull/1041

* not sure cargo doc has many code examples with async/await, but there we go.

[warning]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Raised minimum supported rust version to 1.35. #1003
https://github.com/rust-lang/mdBook/pull/1003

* from 1.34.0.

[cosmetic]
v0.3.4 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-034
Switch to relative rem font sizes from px. #894
https://github.com/rust-lang/mdBook/pull/894

* will impact some displays, but px is already an abstract thing so maybe not that big of an impact.

[warning]
v0.3.5 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-035
Updated pulldown-cmark to 0.6.1, fixing several issues. #1021
https://github.com/rust-lang/mdBook/pull/1021

* from 0.5, breaking changes.
* parsing only -- the team had to do multiple changes but nothing seems like it would impact final rendering

[cosmetic]
v0.3.6 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-036
Adjusted spacing of sidebar entries. #1137
https://github.com/rust-lang/mdBook/pull/1137

[warning]
v0.3.6 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-036
Handlebars updated to 3.0. #1130
https://github.com/rust-lang/mdBook/pull/1130

* from 2.0
* https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md
* strictly maintenance and perf AFAICS, no changes to final rendering.

[cosmetic]
v0.3.6 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-036
Adjusted the menu bar animation to not immediately obscure the top content. #989
https://github.com/rust-lang/mdBook/pull/989

* personal fave.

[cosmetic]
v0.3.7 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-037
Code spans in headers are no longer highlighted as code. #1162

* users will see some headers change, probably.

[fixes]
+ ~13 fixes impacting rendering in less immediately visible ways.
rest should have no impact on end-user experience.
```
2020-04-07 19:30:55 +00:00
Thibault Nélis
328c38c643 Fetch mdBook in new location
The mdBook project was moved to the rust-lang organization, out of the
nursery organization.

https://github.com/rust-lang/mdBook/issues/1080
https://github.com/rust-lang/mdBook/pull/1083
https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-034
2020-04-07 12:29:35 -07:00
Thibault Nélis
aa71a11122 Index the commands section 2020-04-07 20:18:26 +02:00
Thibault Nélis
e0faf21107 Upgrade to mdBook v0.3.7 2020-04-07 20:02:37 +02:00
bors
390e8f245e Auto merge of #8080 - RoccoDev:master, r=alexcrichton
Compatibility for rust-lang/rust#69926

This adds compatibility for the rust-lang/rust#69926 PR, which makes it so a warning count is displayed when the build is done.
2020-04-07 17:46:45 +00:00
bors
2f10a672f6 Auto merge of #8079 - Timmmm:patch-1, r=alexcrichton
Add note about converting triple case in environment variables

This wasn't obvious to me, since `CARGO_TARGET_x86_64-unknown-linux-gnu_LINKER` is a perfectly valid environment variable name. It's especially important to document environment variable names well because if you get it wrong it is just silently ignored.
2020-04-07 17:27:47 +00:00
Rocco
79c8ae8299
Compatibility for rust-lang/rust#69926 2020-04-07 15:23:43 +02:00
Tim
9922973bf4
Add note about converting triple case in environment variables
This wasn't obvious to me, since `CARGO_TARGET_x86_64-unknown-linux-gnu_LINKER` is a perfectly valid environment variable name. It's especially important to document environment variable names well because if you get it wrong it is just silently ignored.
2020-04-07 12:17:55 +01:00
Linus Färnstrand
c428c0ef41 Use associated constants directly on primitive types instead of modules 2020-04-06 23:37:06 +02:00
Eric Huss
6e3f35b20a Use the same filename hash for pre-release channels. 2020-04-05 13:46:37 -07:00
Eric Huss
c889bbfba8 Add "build-finished" JSON message. 2020-04-04 18:56:50 -07:00
Eric Huss
c17bfcbdb2 Implement -Zpackage-features2 2020-04-04 18:04:03 -07:00
Eric Huss
7c403447bd Switch --invert to take the package name as an argument. 2020-04-03 19:52:21 -07:00
Eric Huss
96ff434cb9 Rename --dep-kinds to --edges and fold in --graph-features. 2020-04-03 19:16:39 -07:00
bors
805462e971 Auto merge of #8066 - alexcrichton:embed-bitcode-no, r=ehuss
Add support for `-Cembed-bitcode=no`

This commit is the Cargo half of support necessary for
rust-lang/rust#70458. Today the compiler emits embedded bytecode in
rlibs by default, but compresses it. This is both extraneous disk space
and wasted build time for almost all builds, so the PR in question there
is changing rustc to have a `-Cembed-bitcode` flag which, when enabled,
places the bitcode in the object file rather than an auxiliary file (no
extra compression), but also enables `-Cembed-bitcode=no` to disable
bitcode emission entirely.

This Cargo support changes Cargo to pass `-Cembed-bitcode=no` for almost
all compilations. Cargo will keep `lto = true` and such working by not
passing this flag (and thus allowing bitcode to get embedded), but by
default `cargo build` and `cargo build --release` will no longer have
any bitcode in rlibs which should result in speedier builds!

Most of the changes here were around the test suite and various
assertions about the `rustc` command lines we spit out. One test was
hard-disabled until we can get `-Cembed-bitcode=no` into nightly, and
then we can make it a nightly-only test. The test will then be stable
again once `-Cembed-bitcode=no` hits stable.

Note that this is intended to land before the upstream `-Cembed-bitcode`
change. The thinking is that we'll land everything in rust-lang/rust all
at once so there's no build time regressions for anyone. If we were to
land the `-Cembed-bitcode` PR first then there would be a build time
regression until we land Cargo changes because rustc would be emitting
uncompressed bitcode by default and Cargo wouldn't be turning it off.
2020-04-03 16:21:39 +00:00
Eric Huss
5ccc5e0177 Change old flags to warnings instead of errors.
Except --all which is ambiguous which flag it means.
2020-04-02 15:23:48 -07:00
Eric Huss
3b1df3a46f Change --no-dev-dependencies to --dep-kinds. 2020-04-02 15:12:17 -07:00
Eric Huss
dd10b597ed Add hint about removal of --all-targets 2020-04-02 13:09:35 -07:00
Eric Huss
afdcab7ced Catch and display error about the --all flag. 2020-04-02 13:00:33 -07:00
Eric Huss
ec5e297b70 Change --no-filter-targets to --target=all. 2020-04-02 12:20:55 -07:00
Eric Huss
a9ff02ed5a Change --no-indent and --prefix-depth to a single --prefix option. 2020-04-02 11:48:52 -07:00
Eric Huss
e1c95e2f42 Fix tree format parsing for bare } 2020-04-02 11:31:39 -07:00
Eric Huss
6868215982 Don't show (*) deduplicate if a node doesn't have any dependencies to show. 2020-04-02 11:25:20 -07:00
Eric Huss
9dc56c6280 Deduplicate nodes across roots. 2020-04-02 11:09:06 -07:00
Eric Huss
b1fd8e986a Try to clarify how node edges works. 2020-04-02 11:05:52 -07:00
Eric Huss
feaa3123b6 Update cargo tree from review comments. 2020-04-02 10:40:44 -07:00
Alex Crichton
bac300bda0 Add support for -Cembed-bitcode=no
This commit is the Cargo half of support necessary for
rust-lang/rust#70458. Today the compiler emits embedded bytecode in
rlibs by default, but compresses it. This is both extraneous disk space
and wasted build time for almost all builds, so the PR in question there
is changing rustc to have a `-Cembed-bitcode` flag which, when enabled,
places the bitcode in the object file rather than an auxiliary file (no
extra compression), but also enables `-Cembed-bitcode=no` to disable
bitcode emission entirely.

This Cargo support changes Cargo to pass `-Cembed-bitcode=no` for almost
all compilations. Cargo will keep `lto = true` and such working by not
passing this flag (and thus allowing bitcode to get embedded), but by
default `cargo build` and `cargo build --release` will no longer have
any bitcode in rlibs which should result in speedier builds!

Most of the changes here were around the test suite and various
assertions about the `rustc` command lines we spit out. One test was
hard-disabled until we can get `-Cembed-bitcode=no` into nightly, and
then we can make it a nightly-only test. The test will then be stable
again once `-Cembed-bitcode=no` hits stable.

Note that this is intended to land before the upstream `-Cembed-bitcode`
change. The thinking is that we'll land everything in rust-lang/rust all
at once so there's no build time regressions for anyone. If we were to
land the `-Cembed-bitcode` PR first then there would be a build time
regression until we land Cargo changes because rustc would be emitting
uncompressed bitcode by default and Cargo wouldn't be turning it off.
2020-04-01 14:31:06 -07:00
Eric Huss
96a393719b Add cargo tree command. 2020-03-31 15:14:47 -07:00
bors
c75216fc55 Auto merge of #8059 - Mark-Simulacrum:add-triagebot, r=alexcrichton
Add triagebot configuration

This enables assignment through triagebot on this repository, in preparation for
the migration from highfive to triagebot for PR assignment.

cc https://github.com/rust-lang/highfive/pull/258 https://github.com/rust-lang/triagebot/pull/433
2020-03-31 18:18:05 +00:00
Mark Rousskov
76a762b45b Add triagebot configuration
This enables assignment through triagebot on this repository, in preparation for
the migration from highfive to triagebot for PR assignment.
2020-03-31 11:15:46 -04:00