2201 Commits

Author SHA1 Message Date
hi-rustin
5e86dd455d Add more details when installing git repository errors 2021-06-14 14:41:49 +08:00
Eric Huss
2492bf53ab Fix package_default_run.
The output was checking the `targets`, whose order depends on the
filesystem order. Instead of checking all the output, just
check the one field this test is for.
2021-06-11 16:09:32 -07:00
Eric Huss
393077f968 Add run_json to Execs.
This is a helper to run the process and return a JSON object.
2021-06-11 16:07:20 -07:00
Sunjay Varma
f68cdb9947 Change how the fix_deny_warnings_but_not_others test works to avoid breakage from new compiler suggestions 2021-06-10 16:49:29 -07:00
bors
da2c7705e4 Auto merge of #9561 - In-line:add-warning-for-ignored-arguments, r=ehuss
Implement warning for ignored trailing arguments
2021-06-10 15:47:52 +00:00
bors
40b674cd11 Auto merge of #9566 - ehuss:relative-rustc-path, r=alexcrichton
Fix rustc/rustdoc config values to be config-relative.

The `rustc`, `rustdoc`, `rustc_wrapper`, and `rustc_workspace_wrapper` config values (in the `[build]` table) were being interpreted literally. This caused a problem if you used a relative path like `foo/rustc`.  This would be interpreted as a relative path from whatever cwd cargo launches rustc from, which changes for different scenarios, making it essentially unusuable (since crates.io dependencies wouldn't be buildable).

Additionally, due to https://github.com/rust-lang/rust/issues/37868, it is a bad idea to use relative paths.

This changes it so that those paths are config-relative.  Bare names (like "my-rustc-program") still use PATH as before.

This also includes a commit to centralize the rustc-wrapper program used by several tests so that it isn't built multiple times (and to allow several tests to work on windows).

Fixes #8202
2021-06-10 14:15:18 +00:00
Eric Huss
9362fe5ff3 Update rustfix. 2021-06-09 18:13:56 -07:00
Eric Huss
47a02919cc Fix rustc/rustdoc config values to be config-relative paths. 2021-06-09 17:46:18 -07:00
Eric Huss
7b229bbe39 Move the rustc-echo-wrapper to be shared across tests.
This helps avoid rebuilding the same project several times.
2021-06-09 17:13:33 -07:00
Bryysen
da1c2f3b9c Warn if an "all" target is specified, but we don't match anything
If a combination of --bins, --benches, --examples, --tests flags have
been specified, but we didn't match on anything after resolving the unit-list,
we emit a warning to make it clear that cargo didn't do anything and that the
code is unchecked.

Closes #9536
2021-06-09 19:29:24 +02:00
bors
66686fd995 Auto merge of #9550 - hi-rustin:rustin-patch-feat, r=ehuss
add default_run to SerializedPackage

close https://github.com/rust-lang/cargo/issues/9497
2021-06-09 16:50:47 +00:00
bors
2544bd3418 Auto merge of #9522 - Aelnor:respect_user_choice_of_binlib, r=ehuss
respect user choice of lib/bin over heuristics

This one fixes #9333
2021-06-09 16:26:15 +00:00
Alik Aslanyan
e5d10f973d
Implement warning for ignored trailing arguments
in case built-in `cargo` command was invoked with `--`
2021-06-09 18:50:51 +04: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
hi-rustin
1abc4f2e8a Add test and update docs 2021-06-08 11:28:58 +08:00
hi-rustin
c971400330 Make test happy 2021-06-07 14:59:59 +08:00
hi-rustin
f9a5625733 add default_run to SerializedPackage
Delete "default_run": null,
2021-06-07 14:59:57 +08: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
Alexey Chernyshov
3bc2341b56 change simple quotes with backticks for file names 2021-06-01 20:13:45 +03:00
Alexey Chernyshov
e1a6bf454b Update tests/testsuite/init.rs
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2021-06-01 19:54:54 +03: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
Eric Huss
81defa6d1e Consolidate doc collision detection. 2021-05-30 19:39:48 -07:00
Alexey Chernyshov
3f8fc0e66a respect user choice of lib/bin over heuristics 2021-05-30 15:24:29 +03: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
Weihang Lo
64f5d10113
test(carog-tree): new --prune option 2021-05-29 11:45:10 +08: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
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
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
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
Dario Nieuwenhuis
160756368f Add test for cargo:rustc-link-arg-bin=foo=--bar 2021-05-20 21:41:17 +02: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
Weihang Lo
62d811d9f7
test(cargo-tree): --depth option 2021-05-19 09:29:47 +08:00
Jade
50486be0c0 testsuite/doc: Check the arguments used to invoke the browser
Previously we apparently weren't doing this as we weren't checking
stdout.
2021-05-15 18:59:24 -07:00
Jade
ed46a9a4de test path and args 2021-05-15 14:23:44 -07:00
Weihang Lo
a5139b96b9
test: cargo tree incorrect --edges arg 2021-05-16 02:00:56 +08:00
Weihang Lo
c8af63795e
test: assert no-proc-macro for existing tests 2021-05-16 02:00:22 +08:00
Alik Aslanyan
503a8670d9
Another way to fix 2021-05-13 11:30:46 +04:00
Jade
e840c8e81c 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-10 21:04:41 -07:00
Eric Huss
a200640dbd Improve performance of git status check in cargo package. 2021-05-10 18:15:05 -07:00
bors
5b37ab3c7e Auto merge of #9472 - r00ster91:bettererrors, r=alexcrichton
Improve two error messages

The first error message saying "an integer" is confusing because if you give it `4` it's an integer but it will still complain that it must be an integer. So it's more specific now and tells you that it actually needs to be `1`, `2` or `3`.
In the second error there was a space missing. It says `is not a valid setting,must be`.
2021-05-10 15:35:17 +00:00
r00ster91
b381fdb71e Improve two error messages 2021-05-10 17:28:19 +02:00