10948 Commits

Author SHA1 Message Date
5225225
9e4c0e1e44 Don't use CargoDocConfig struct 2021-06-19 17:45:44 +01:00
5225225
1919ce7ce5 Add test to try to catch doc --open issue with extern-map 2021-06-06 13:28:45 +01:00
5225225
0989dc1c3d Put cfg in a scope so it's not borrowed twice 2021-06-01 22:30:11 +01:00
bors
0cecbd6732 Auto merge of #9322 - jameshilliard:split-host, r=joshtriplett
Configure hosts separately from targets when --target is specified.

This prevents target configs from accidentally being picked up when cross compiling from hosts that have the same architecture as their targets.

closes #3349
2021-06-01 20:09:13 +00:00
bors
6597523527 Auto merge of #9523 - ehuss:link-args-validate, r=alexcrichton
Add some validation to rustc-link-arg

This adds some validation, so that if a `cargo:rustc-link-arg-*` build script instruction specifies a target that doesn't exist, it will generate an error.  This also changes a parse warning to an error if the `=` is missing from BIN=ARG.

I intentionally did not bother to add the validation to config overrides, as it is a bit trickier to do, and that feature is very rarely used (AFAIK), and I'm uncertain if rustc-link-arg is really useful in that context.

cc #9426
2021-06-01 17:26:35 +00:00
bors
5fb59b0e4a Auto merge of #9420 - In-line:unknown-features-suggestions-in-workspace, r=ehuss
Implement suggestions for unknown features in workspace
2021-06-01 15:41:27 +00:00
bors
cdd6dc7487 Auto merge of #9529 - weihanglo:refactor/make_dep_path, r=alexcrichton
Extract common `make_dep_path` to cargo_util

Just a teeny tiny refactor extracting the same logic.
2021-06-01 15:02:22 +00:00
bors
51eac9c4ff Auto merge of #9524 - ehuss:rustflags-compatibility, r=alexcrichton
Add a note about rustflags compatibility.

Over time, Cargo occasionally starts issuing new flags that may conflict with flags the user is passing directly to the compiler. Some recent examples are `-C embed-bitcode` (which broke anyone passing `-Clto` manually), and `-C prefer-dynamic` (which is kind of a mess). Future conflicts might be things like `--remap-path-prefix` or `--extern-html-root-url` (for rustdoc). This adds a note to mention these potential conflicts.

Although we try to maintain backwards compatibility as much as possible throughout all of Cargo, this particular area I think is dangerous enough that it is prudent to have some kind of warning somewhere. It is very rare that conflicts arise in practice, but they can happen.

I also added a note about passing in flags that Cargo itself issues, which can cause problems. Closes #9358.
2021-06-01 14:35:20 +00:00
bors
0c9eb206c5 Auto merge of #9526 - ehuss:doc-collision-resolve, r=alexcrichton
Consolidate doc collision detection.

This removes the separate collision detection pass (in cargo_doc.rs) and uses the global collision detection instead. This removes the separate pass for running the resolver (which resulted in running the resolver four times every time `cargo doc` was run).

The `--open` option needs to know which path to open, so this is passed in a roundabout way via `Compilation`. Since this method uses the root units, I added a sort on the roots so that the crate that is opened is consistent between runs. This results in some slight behavioral changes.

This also makes the collision check slightly more stringent. The test `doc_multiple_targets_same_name` now generates an error instead of a warning because the old code did not check for collisions between libs and bins across packages (which should be very rare).
2021-06-01 14:12:14 +00:00
Weihang Lo
df82a44f9e
refactor: extract common make_dep_path to cargo_util 2021-06-01 11:14:53 +08:00
Eric Huss
81defa6d1e Consolidate doc collision detection. 2021-05-30 19:39:48 -07:00
Eric Huss
4d3772b882 Add a note about passing in rustflags that conflict with Cargo. 2021-05-29 18:17:03 -07:00
Eric Huss
2d08c73c28 Add a note about rustflags compatibility. 2021-05-29 17:44:16 -07:00
Eric Huss
836e537bc0 Make cargo:rustc-link-arg-bin without the = an error. 2021-05-29 16:12:11 -07:00
Eric Huss
f676b49e52 Add some errors if rustc-link-arg-* specifies a non-existent target. 2021-05-29 16:00:35 -07:00
Eric Huss
795aab168c custom_build.rs: Import anyhow::bail 2021-05-29 13:36:31 -07:00
bors
b1684e2849 Auto merge of #9499 - weihanglo:tree-depth, r=ehuss
Add `--depth` option for `cargo-tree`

Part of #8105

Note that the `--depth` option only regards the "tree" depth but not dependency depth.

## To resolve

Bike-shedding naming problem: `-L,--level`  or `--depth`?
2021-05-28 16:27:46 +00:00
Weihang Lo
da2327f129
Merge branch 'master' into tree-depth 2021-05-28 23:27:42 +08:00
bors
238a9fa71f Auto merge of #9488 - weihanglo:issue-9165, r=ehuss
`cargo tree -e no-proc-macro` to hide procedural macro dependencies

Probably resolves #9165

`cargo tree -e no-proc-macro` now hides procedural macro dependencies.

Note that when passed with `--invert <spec>`, the spec's reverse proc-macro dependencies are also hidden. Is this desired result?

Also, since I want `-p <spec>` and `-i <spec>` works with any valid package-id in the project, the filter logic is written in print stage instead of graph build stage
2021-05-28 14:55:26 +00:00
Weihang Lo
c2fd499eac
fix: remove unnecessary match bindings
Co-authored-by: Eric Huss <eric@huss.org>
2021-05-28 07:25:57 +08:00
bors
2f3df16921 Auto merge of #9508 - dtolnay-contrib:semver, r=ehuss
Update to semver 1.0.0

I am working on a 1.0.0 of the `semver` crate some time this week. It would be good to confirm Cargo will be able to use it, beforehand!

It's a from-scratch rewrite, but https://github.com/dtolnay/semver/issues/237 has code to compare against 0.10.0 (currently used by Cargo) how every possible version requirement currently published to crates.io matches against every possible crate version. The differences are all broken syntax like `^0-.11.0` previously parsing with ".11.0" as a pre-release string (which is invalid, because pre-release are not allowed to contain empty dot-separated identifiers) and `~2.0-2.2` previously parsing with "2.2" as a pre-release string, when the user almost certainly meant `>=2.0, <=2.2`. I'm not sure how much of those you want to add code into Cargo to preserve behavior, but I would be happy to do it.
2021-05-27 22:34:28 +00:00
bors
cc75485f72 Auto merge of #9517 - alexcrichton:update-rrar, r=ehuss
Update tar dependency to 0.4.35

Pulls in a fix which should avoid 0 mtime files from showing up.

Closes #9512
2021-05-27 22:08:08 +00:00
Alex Crichton
a02b6e5bfc Update tar dependency to 0.4.34
Pulls in a fix which should avoid 0 mtime files from showing up.

Closes #9512
2021-05-27 14:16:59 -07:00
David Tolnay
7ace4470c4
Update to semver 1.0.0 2021-05-26 14:39:13 -07:00
David Tolnay
396bdd3a89
Remove parsing of broken version syntax from 5 years ago 2021-05-26 14:37:39 -07:00
David Tolnay
3b62e466ec
Update to semver 1.0.0-rc 2021-05-25 17:42:05 -07:00
bors
e931e4796b Auto merge of #9486 - Dirbaio:link-arg-bin, r=ehuss
Add `cargo:rustc-link-arg-bin` flag.

This PR implements a `cargo:rustc-link-arg-bin` command to specify per-binary link args from build scripts. This follows the suggestion from the tracking issue #9426.

Syntax is `cargo:rustc-link-arg-bin=BIN_NAME=ARG`

This was previously possible to do using the `#[link_args=".."]` attribute, but it was removed in rust-lang/rust#83820 in favor of the Cargo extra-link-args feature, which can currently not specify different link args for different bins in the same crate. This PR adds back the ability to do that.
2021-05-24 16:17:27 +00:00
bors
f898eff9b9 Auto merge of #9473 - lf-:meow, r=ehuss
Add a cargo-doc.browser config option

The idea of this option is to allow cargo to use a separate browser from
the rest of the system. My motivation in doing this is that I want to
write a script that adds a symbolic link in some web root on my system
such that I can access my docs via the http protocol to avoid the
limitations of the file protocol that are accessibility problems for me.
For instance, zoom is not retained across multiple pages and Stylus
filters don't work well.
2021-05-24 15:54:16 +00:00
bors
07340c95c6 Auto merge of #9437 - In-line:unknown-feature-resolver-1, r=ehuss
Fix bug when with resolver = "1" non-virtual package was allowing unknown features
2021-05-24 15:20:48 +00:00
Eric Huss
61b762b9ff Remove unneeded masquerade_as_nightly_cargo.
This was accidentally missed when it was stabilized.
2021-05-24 08:18:14 -07:00
Jade
6128b54b8a docs: cargo-doc.browser -> doc.browser; mention in cargo-{rust,}doc.1 2021-05-20 22:52:49 -07:00
Dario Nieuwenhuis
daffd0a42b Add unstable docs for cargo:rustc-link-arg-bin=foo=--bar 2021-05-20 21:50:50 +02:00
Dario Nieuwenhuis
160756368f Add test for cargo:rustc-link-arg-bin=foo=--bar 2021-05-20 21:41:17 +02:00
Dario Nieuwenhuis
5382aa650a Add rustc-link-arg-bin key to specify per-bin link args. 2021-05-20 20:47:54 +02:00
Dario Nieuwenhuis
0895469aec Allow LinkType to access the Target for checking if it applies. 2021-05-20 20:47:12 +02:00
Alik Aslanyan
1839ded4aa
Cargo fmt 2021-05-20 08:36:01 +04:00
Alik Aslanyan
766c3bbcb8 Merge branch 'master' of github.com:rust-lang/cargo into unknown-feature-resolver-1 2021-05-20 08:34:48 +04:00
Alik Aslanyan
2762dcdbe9
Revert fmt 2021-05-20 08:33:57 +04:00
Alik Aslanyan
ca0cce760e
Revert unnecessary changes 2021-05-20 08:31:57 +04:00
Weihang Lo
40791da11f
doc: generated via build-man.sh 2021-05-19 09:59:02 +08:00
Weihang Lo
d8334d5a6d
doc(cargo-tree): add --depth option 2021-05-19 09:59:01 +08:00
Weihang Lo
62d811d9f7
test(cargo-tree): --depth option 2021-05-19 09:29:47 +08:00
Weihang Lo
7cbc365da8
feat: new --depth option for cargo tree 2021-05-19 09:29:46 +08:00
bors
6ca6dd0bff Auto merge of #9493 - ehuss:contrib-git-url, r=alexcrichton
Add GitHub link to contributor guide.

This adds a small icon on each page that links back to the GitHub source.
2021-05-18 21:48:52 +00:00
bors
0d9bc9dfad Auto merge of #9498 - ehuss:rustup-windows-workaround, r=alexcrichton
Add temporary fix for rustup on windows in CI.

This adds a temporary fix for rustup on the Windows CI runners. The GitHub image updated to rustup 1.24.1 which has an issue (https://github.com/rust-lang/rustup/issues/2759) causing them to fail.  This is fixed in 1.24.2.  I believe the images are updated on roughly a weekly basis, and from what I can see the image just downloads the most recently release, so hopefully this will be fixed on GitHub's side in roughly a week. Until then, this will force rustup to update.

Note: Self updates aren't available on macOS images, but they seem to work on the others.
2021-05-18 20:47:05 +00:00
Eric Huss
65ca4e0d1e Add temporary fix for rustup on windows in CI. 2021-05-18 13:33:35 -07:00
bors
f0b39fc853 Auto merge of #9495 - dunkyl:master, r=ehuss
3 typos and some capitalization

3 typos and...

Most of the docs use "command-line" instead of "commandline", changed where it made sense (in plain text).

Most of the docs also use "SemVer" instead of "semver", changed for consistency except for the "semver trick" (consistent with context).

I believe these are the correct files to change, since none of these changes are in doc/man?
2021-05-18 14:05:33 +00:00
dunkyl
4d8c0bb6b2 Capitalization
SemVer

Rust capitalization
2021-05-17 23:05:23 -07:00
dunkyl
c4635dabce typo 2021-05-17 22:49:17 -07:00
dunkyl
67900818cf dash-style command-line 2021-05-17 22:18:10 -07:00