2222 Commits

Author SHA1 Message Date
hi-rustin
cb1a3f05f0 Detect incorrectly named cargo.toml for build 2021-06-22 15:31:28 +08:00
hi-rustin
a2f903275a Detect incorrectly named cargo.toml for install --path 2021-06-22 15:31:28 +08:00
hi-rustin
d9daaf7a84 Detect incorrectly named cargo.toml for install --git 2021-06-22 15:31:21 +08:00
bors
c111cad106 Auto merge of #9596 - ehuss:fix-dep-info-local, r=alexcrichton
Fix dep-info files including non-local build script paths.

I derped in #8177 and accidentally used the wrong unit when iterating over the dependencies when writing the `.d` file.  The consequence here is that all the `rerun-if-changed` paths from a unit's dependencies are included in the `.d` file. This fixes it so that it does not include non-local dependencies.

Fixes #9445
2021-06-18 03:38:12 +00:00
Eric Huss
2db502f766 Fix dep-info files including non-local build script paths. 2021-06-17 18:28:42 -07:00
Eric Huss
bd4010c43d Relax doc collision error. 2021-06-17 16:28:17 -07:00
Henri Francois
0663b713b7 Handling job=0 argument in cargo config files. 2021-06-17 09:18:59 -07:00
bors
40df0f17b5 Auto merge of #9589 - ehuss:testsuite-diff, r=alexcrichton
Enhancements to testsuite error output.

This includes several changes to the testsuite error reporting in theory to help make it easier to see differences when the test output changes. The key change is to add a Myers diff with a little colored output to highlight the differences. Here is an example:

<img width="666" alt="image" src="https://user-images.githubusercontent.com/43198/122311381-e8d43580-cec6-11eb-81b4-e2675f10d6ba.png">

The rest of the changes here are various refactorings to try to clean up the diffing code.  It ended up being far more changes than I was intending, but I did try to split things into commits to separate them.
2021-06-17 14:50:47 +00:00
Eric Huss
16b5402fd7 testsuite: Switch to colored diffs with Myers diff. 2021-06-16 15:43:29 -07:00
Eric Huss
205148e645 Only normalize paths on windows.
I don't trust that all these transformations won't have unintended
consequences on other platforms. It is nice to verify there aren't any
backslash shenanigans on other platforms.
2021-06-16 10:35:26 -07:00
Eric Huss
aea5ca3ca0 Remove the double-backslash escape for matching.
Using `with_json` is safer since it knows what JSON escaping is.
2021-06-16 09:44:29 -07:00
Eric Huss
b73e3d4fa5 Don't export lines_match.
Use better high-level interfaces to achieve the same thing.
2021-06-16 09:44:29 -07:00
Eric Huss
b9f15ab1f0 Remove got_symlink_permission, we already have one of those. 2021-06-16 09:44:29 -07:00
Eric Huss
24b8936c20 Remove normalized_lines_match, it is not needed. 2021-06-16 09:44:29 -07:00
Eric Huss
6dff99781d Remove with_either_contains.
It isn't needed anymore, and I would prefer to not keep around unused code.
It can always be added back if ever needed again.
2021-06-16 09:44:29 -07:00
Eric Huss
e132bb53ab Move comparison and diffing code to a new module.
This includes various minor refactorings to try to clean things up
and provide better error messages.
2021-06-16 09:44:29 -07:00
bors
7cdf5344ff Auto merge of #9588 - ehuss:edition2021-force-warns, r=alexcrichton
Enable support for fix --edition for 2021.

This adds support for using `cargo fix --edition` to migrate to 2021.

This also uses the new, currently unstable, `--force-warns` flag. This was added because there were a significant number of crates that were "allow"ing lints that are required for migrating the edition. This wasn't a problem for 2018, because its lints were new, and all "allow" to start.  For 2021, several older "warn" lints are becoming hard errors.  "allow"ing them would cause the migration to fail.
2021-06-16 14:51:06 +00:00
bors
ee8497b09f Auto merge of #9582 - hi-rustin:rustin-patch-errors, r=ehuss
Add more details for installing git repository errors

close https://github.com/rust-lang/cargo/issues/9422
close https://github.com/rust-lang/cargo/issues/9011

r? `@ehuss`
2021-06-16 13:03:19 +00:00
Eric Huss
5825206acf Enable support for fix --edition for 2021. 2021-06-15 13:13:35 -07:00
bors
3b17193594 Auto merge of #9568 - hi-rustin:rustin-patch-error, r=alexcrichton
More information for links conflicting

close https://github.com/rust-lang/cargo/issues/9294
2021-06-14 14:14:55 +00:00
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
hi-rustin
724cf0f0eb More information for links conflicting 2021-06-10 15:12:19 +08: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