Commit Graph

10976 Commits

Author SHA1 Message Date
bors
5ae8d74b3b Auto merge of #9611 - ehuss:beta-1.54-backports, r=alexcrichton
Beta 1.54 backports

This backports the following changes to 1.54 beta:

* #9595 — Relax doc collision error.  This was an unintended regression where a warning was switched to an error in 1.54.
* #9563 — Change rustc-cdylib-link-arg error to a warning.  Validation was added in #9523 (1.54) that generated an error. However, it was unknown at the time that use of link args via dependencies was being used. Rather than regress those projects (which has been on stable since 1.50), this switches the validation to a warning to indicate this was not intended.
* #9604 — Disambiguate is_symlink. Required to get CI to pass.
2021-06-22 22:02:10 +00:00
bors
09ed3d2fcd Auto merge of #9604 - ehuss:is_symlink, r=alexcrichton
Disambiguate is_symlink.

`Path::is_symlink` was added in https://github.com/rust-lang/rust/pull/85747 which triggers the `unstable_name_collisions` lint, breaking Cargo's CI.  This switches it to a free function to avoid the collision.
2021-06-22 14:06:26 -07:00
bors
a9eb3efa19 Auto merge of #9595 - ehuss:ws-doc-collision-back-compat, r=alexcrichton
Relax doc collision error.

#9526 moved the `cargo doc` output name collision code to be shared with the other collision detection code. However, the way it detected collisions wasn't quite the same, and started generating errors for situations that were just warnings before. It was intended that the code should behave the same, so this PR relaxes the checks to be more like the original code.  (It's still not 100% the same, but should be close enough.)

Closes #9564
2021-06-22 13:43:43 -07:00
bors
6ef861da96 Auto merge of #9563 - ehuss:link-cdylib-warning, r=alexcrichton
Change `rustc-cdylib-link-arg` error to a warning.

In #9523, an error was added if `cargo:rustc-cdylib-link-arg` was issued in a build script without actually having a cdylib target. This uncovered that there was an unintentional change in #8441 to cause those link args to be applied to transitive dependencies.

This changes it so that the error is now a warning, with a note that this may become an error in the future. It also changes it so that the unstable `rustc-link-arg*` instructions only apply to the package that emitted them.
2021-06-22 13:43:17 -07:00
bors
aa8b09297b Auto merge of #9520 - weihanglo:tree-prune, r=ehuss
Add `--prune` option for cargo-tree

Part of #8105

Prune the given package from the display of the dependency tree. Also providing a nice suggestion if the package is not within the resolved dependency graph.
2021-06-09 00:28:53 +00:00
bors
e21e03f4c0 Auto merge of #9556 - ehuss:gitignore-doc-fix, r=alexcrichton
Fix typo in gitignore docs.

`**.ext` is collapsed to `*.ext` by git.
2021-06-07 22:21:31 +00:00
Eric Huss
9efaaf1654 Fix typo in gitignore docs. 2021-06-07 15:11:56 -07:00
bors
ed0c8c6d66 Auto merge of #9552 - taiki-e:typo, r=alexcrichton
Fix typos in command_prelude.rs
2021-06-07 14:28:06 +00:00
bors
11eec1d04d Auto merge of #9551 - hi-rustin:rustin-patch-clippy, r=alexcrichton
Make clippy happy

It is already a reference.
2021-06-07 14:00:09 +00:00
Taiki Endo
98df612f5f Fix typos in command_prelude.rs 2021-06-07 18:25:33 +09:00
hi-rustin
a71eb1b1ad Make clippy happy 2021-06-07 14:20:14 +08:00
bors
d3bc13288e Auto merge of #9546 - ehuss:fingerprint-dead-code, r=Eh2406
Remove some dead code.
2021-06-05 21:30:59 +00:00
Eric Huss
cc683fddc3 Remove some dead code. 2021-06-05 13:38:27 -07:00
bors
1a8692df11 Auto merge of #9515 - pickfire:patch-1, r=ehuss
Add additional test for CJK progress width

Not clear if CJK test hit boundary, since CJK characters have double width,
if we show an example with an extra single width means one of them hit
character boundary to be able to test ellipsis handling.
2021-06-05 17:21:05 +00:00
bors
71c1760bae Auto merge of #9544 - dtolnay-contrib:semverx, r=alexcrichton
Pull in semver 1.0.3 'x' fix

As requested in https://github.com/rust-lang/rust/pull/85983#issuecomment-854682640 -- a Cargo.toml update to ensure Cargo-the-library users always get https://github.com/dtolnay/semver/pull/247. Fixes https://github.com/rust-lang/cargo/issues/9543.
2021-06-04 16:29:57 +00:00
David Tolnay
f5c2645899
Pull in semver 1.0.3 'x' fix 2021-06-04 09:19:15 -07:00
bors
1c36f7f7dc Auto merge of #9540 - ehuss:unstable-tracking, r=alexcrichton
Add some tracking issues to unstable docs.
2021-06-04 15:32:26 +00:00
bors
4ab971b4d0 Auto merge of #9538 - ehuss:docs-include-exclude, r=alexcrichton
Update documentation for include/exclude.

Closes #9502.
2021-06-04 15:05:30 +00:00
bors
b65a495aa6 Auto merge of #9534 - ehuss:mdbook-contrib, r=alexcrichton
Bump mdbook version for contrib guide.

Just bringing in a few small fixes.
2021-06-04 13:59:39 +00:00
Eric Huss
7fc95b2a0d Add some tracking issues to unstable docs. 2021-06-03 13:48:36 -07:00
Eric Huss
4c35895b86 Update documentation for include/exclude. 2021-06-03 10:26:35 -07:00
Ivan Tham
4d82360249 Add additional test for CJK progress width
Not clear if CJK test hit boundary, since CJK characters have double width,
if we show an example with an extra single width means one of them hit
character boundary to be able to test ellipsis handling.
2021-06-03 10:23:00 +08:00
Weihang Lo
c685c13976
refactor(cargo-tree): simplify arg-parsing logic
Co-authored-by: Eric Huss <eric@huss.org>
2021-06-03 07:01:45 +08:00
Weihang Lo
681c19438e
refactor(cargo-tree): remove premature micro optimization
Co-authored-by: Eric Huss <eric@huss.org>
2021-06-03 06:52:01 +08:00
Eric Huss
ad328f44c6 Bump mdbook version for contrib guide. 2021-06-02 15:41:47 -07:00
bors
6b6ddaa597 Auto merge of #9533 - akien-mga:patch-to-replace-replace-with-patch, r=alexcrichton
Replace deprecated `[replace]` references with `[patch]`

Cf. #7092.

Note: Untested, but given the changes I figure that if the testsuite passes it should be fairly safe.
2021-06-02 14:26:14 +00:00
Rémi Verschelde
0a40a0aea4
Replace deprecated [replace] references with [patch]
Cf. #7092.
2021-06-02 12:30:56 +02: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
Weihang Lo
07c40a7c86
doc(carog-tree): new --prune option 2021-05-29 11:45:10 +08:00
Weihang Lo
64f5d10113
test(carog-tree): new --prune option 2021-05-29 11:45:10 +08:00
Weihang Lo
b5998aeef4
feat(carog-tree): new --prune option 2021-05-29 11:45:08 +08:00
Weihang Lo
8a747ab09c
refactor(cargo-tree): skip level earlier when exceeded 2021-05-29 11:25:07 +08: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