]> git.proxmox.com Git - cargo.git/log
cargo.git
3 years agoAuto merge of #9597 - ehuss:version-bump, r=alexcrichton
bors [Fri, 18 Jun 2021 15:56:22 +0000 (15:56 +0000)]
Auto merge of #9597 - ehuss:version-bump, r=alexcrichton

Bump to 0.56.0, update changelog

3 years agoUpdate changelog for 1.54
Eric Huss [Fri, 18 Jun 2021 13:54:22 +0000 (06:54 -0700)]
Update changelog for 1.54

3 years agoBump to 0.56.0
Eric Huss [Fri, 18 Jun 2021 13:17:40 +0000 (06:17 -0700)]
Bump to 0.56.0

3 years agoAuto merge of #9596 - ehuss:fix-dep-info-local, r=alexcrichton
bors [Fri, 18 Jun 2021 03:38:12 +0000 (03:38 +0000)]
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

3 years agoAuto merge of #9595 - ehuss:ws-doc-collision-back-compat, r=alexcrichton
bors [Fri, 18 Jun 2021 03:12:08 +0000 (03:12 +0000)]
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

3 years agoFix dep-info files including non-local build script paths.
Eric Huss [Fri, 18 Jun 2021 01:28:42 +0000 (18:28 -0700)]
Fix dep-info files including non-local build script paths.

3 years agoRelax doc collision error.
Eric Huss [Thu, 17 Jun 2021 22:56:45 +0000 (15:56 -0700)]
Relax doc collision error.

3 years agoAuto merge of #9584 - henrifrancois:master, r=ehuss
bors [Thu, 17 Jun 2021 16:20:56 +0000 (16:20 +0000)]
Auto merge of #9584 - henrifrancois:master, r=ehuss

Handle "jobs = 0" case in cargo config files

Cargo hangs without output if the jobs argument under build in a cargo/config file is set to 0. This PR handles this case by providing an appropriate error.

Closes #9219

3 years agoHandling job=0 argument in cargo config files.
Henri Francois [Mon, 14 Jun 2021 15:22:22 +0000 (11:22 -0400)]
Handling job=0 argument in cargo config files.

3 years agoAuto merge of #9589 - ehuss:testsuite-diff, r=alexcrichton
bors [Thu, 17 Jun 2021 14:50:47 +0000 (14:50 +0000)]
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.

3 years agoAuto merge of #9590 - hi-rustin:rustin-patch-fix-typo, r=Eh2406
bors [Thu, 17 Jun 2021 14:25:43 +0000 (14:25 +0000)]
Auto merge of #9590 - hi-rustin:rustin-patch-fix-typo, r=Eh2406

Fix typo

 manfiest -> manifest

3 years agoFix typo
hi-rustin [Thu, 17 Jun 2021 07:14:56 +0000 (15:14 +0800)]
Fix typo

3 years agotestsuite: Switch to colored diffs with Myers diff.
Eric Huss [Wed, 16 Jun 2021 22:40:09 +0000 (15:40 -0700)]
testsuite: Switch to colored diffs with Myers diff.

3 years agoOnly normalize paths on windows.
Eric Huss [Wed, 16 Jun 2021 17:28:43 +0000 (10:28 -0700)]
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.

3 years agoRemove the double-backslash escape for matching.
Eric Huss [Wed, 16 Jun 2021 16:41:38 +0000 (09:41 -0700)]
Remove the double-backslash escape for matching.

Using `with_json` is safer since it knows what JSON escaping is.

3 years agoDon't export lines_match.
Eric Huss [Wed, 16 Jun 2021 02:23:17 +0000 (19:23 -0700)]
Don't export lines_match.

Use better high-level interfaces to achieve the same thing.

3 years agoRemove got_symlink_permission, we already have one of those.
Eric Huss [Wed, 16 Jun 2021 01:11:02 +0000 (18:11 -0700)]
Remove got_symlink_permission, we already have one of those.

3 years agoRemove normalized_lines_match, it is not needed.
Eric Huss [Wed, 16 Jun 2021 01:04:50 +0000 (18:04 -0700)]
Remove normalized_lines_match, it is not needed.

3 years agoRemove with_either_contains.
Eric Huss [Wed, 16 Jun 2021 00:48:05 +0000 (17:48 -0700)]
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.

3 years agoMove comparison and diffing code to a new module.
Eric Huss [Tue, 15 Jun 2021 23:23:06 +0000 (16:23 -0700)]
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.

3 years agotestsuite: Support anyhow error chains in error messages.
Eric Huss [Tue, 15 Jun 2021 23:09:03 +0000 (16:09 -0700)]
testsuite: Support anyhow error chains in error messages.

This is intended to help with adding more usage of anyhow in the
testsuite, which can help show context for errors.

This also includes some small improvements to the error messages to
provide more information.

3 years agoAuto merge of #9588 - ehuss:edition2021-force-warns, r=alexcrichton
bors [Wed, 16 Jun 2021 14:51:06 +0000 (14:51 +0000)]
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.

3 years agoAuto merge of #9582 - hi-rustin:rustin-patch-errors, r=ehuss
bors [Wed, 16 Jun 2021 13:03:19 +0000 (13:03 +0000)]
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`

3 years agoRemove some unused code.
Eric Huss [Tue, 15 Jun 2021 22:38:02 +0000 (15:38 -0700)]
Remove some unused code.

3 years agoEnable support for fix --edition for 2021.
Eric Huss [Mon, 7 Jun 2021 20:21:36 +0000 (13:21 -0700)]
Enable support for fix --edition for 2021.

3 years agoAuto merge of #9568 - hi-rustin:rustin-patch-error, r=alexcrichton
bors [Mon, 14 Jun 2021 14:14:55 +0000 (14:14 +0000)]
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

3 years agoAdd more details when installing git repository errors
hi-rustin [Mon, 14 Jun 2021 06:41:49 +0000 (14:41 +0800)]
Add more details when installing git repository errors

3 years agoAuto merge of #9577 - ehuss:json-test, r=alexcrichton
bors [Sat, 12 Jun 2021 18:00:01 +0000 (18:00 +0000)]
Auto merge of #9577 - ehuss:json-test, r=alexcrichton

Fix package_default_run test.

The `package_default_run` test was checking the output of `cargo metadata`, which included the "targets" field. Unfortunately the order of the targets in this test depend on the filesystem order, so the test may randomly fail.

The fix here is to just check for the one field that this test was interested in.

An alternate solution would be to sort the targets.  Another alternate solution would be to use `"{...}"` for the targets to ignore them.  I kinda liked simplifying it to check just one field.

This includes a series of commits that are just general changes to the test infrastructure:

* Change cargo-test-support to use anyhow.
* Remove unused `ErrMsg`.
* Fix a bug with `verify_checks_output`.
* Remove the weird Debug impl for Execs.
* Added a helper function for getting the JSON output from cargo.  (I can imagine a lot of possible enhancements here.)

3 years agoFix `package_default_run`.
Eric Huss [Fri, 11 Jun 2021 23:08:20 +0000 (16:08 -0700)]
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.

3 years agoAdd `run_json` to `Execs`.
Eric Huss [Fri, 11 Jun 2021 23:07:20 +0000 (16:07 -0700)]
Add `run_json` to `Execs`.

This is a helper to run the process and return a JSON object.

3 years agoRemove "Expected: execs" from testsuite error.
Eric Huss [Fri, 11 Jun 2021 22:25:50 +0000 (15:25 -0700)]
Remove "Expected: execs" from testsuite error.

That message was not helpful.

3 years agoFix verify_checks_output.
Eric Huss [Fri, 11 Jun 2021 20:12:30 +0000 (13:12 -0700)]
Fix verify_checks_output.

This was accidentally broken in
https://github.com/rust-lang/cargo/commit/cc5e9df64a7ed6b3657e9dd790e2e34387d33df5
causing it to not check in the error case (which is the only case that mattered).

3 years agoSwitch cargo-test-support to anyhow.
Eric Huss [Fri, 11 Jun 2021 19:37:27 +0000 (12:37 -0700)]
Switch cargo-test-support to anyhow.

3 years agoAuto merge of #9571 - sunjay:fix_deny_warnings_but_not_others, r=alexcrichton
bors [Fri, 11 Jun 2021 00:00:14 +0000 (00:00 +0000)]
Auto merge of #9571 - sunjay:fix_deny_warnings_but_not_others, r=alexcrichton

Change how the fix_deny_warnings_but_not_others test works

This changes how the `fix_deny_warnings_but_not_others` test works to avoid breakage from a new compiler suggestion that affects rustfix. It should still test the same thing, but through a slightly different mechanism to avoid breaking when new compiler suggestion are added.

Relevant PR for rust-lang/rust: https://github.com/rust-lang/rust/pull/83004

Full explanation in this comment: https://github.com/rust-lang/rust/pull/83004#issuecomment-859155118

Please let me know if you have a better suggestion for this fix. I believe [we're trying to land this ASAP because the beta is being cut tomorrow](https://github.com/rust-lang/rust/pull/83004#issuecomment-858481702), so I will try to get back to any feedback as soon as possible.

cc `@pnkfelix`

3 years agoChange how the fix_deny_warnings_but_not_others test works to avoid breakage from...
Sunjay Varma [Thu, 10 Jun 2021 23:49:29 +0000 (16:49 -0700)]
Change how the fix_deny_warnings_but_not_others test works to avoid breakage from new compiler suggestions

3 years agoAuto merge of #9565 - KubaP:doc-fix, r=ehuss
bors [Thu, 10 Jun 2021 16:12:42 +0000 (16:12 +0000)]
Auto merge of #9565 - KubaP:doc-fix, r=ehuss

Add mising documentation regarding `cargo doc`

It seems that the `--document-private-items` flag for `cargo doc` is automatically set when documenting a binary target. This change mentions that in the doc page.

The documentation did not mention this before, and it got me confused whilst I was trying to track down something going wrong.

3 years agoAuto merge of #9561 - In-line:add-warning-for-ignored-arguments, r=ehuss
bors [Thu, 10 Jun 2021 15:47:52 +0000 (15:47 +0000)]
Auto merge of #9561 - In-line:add-warning-for-ignored-arguments, r=ehuss

Implement warning for ignored trailing arguments

3 years agoAuto merge of #9569 - hi-rustin:rustin-patch-clippy, r=ehuss
bors [Thu, 10 Jun 2021 15:23:27 +0000 (15:23 +0000)]
Auto merge of #9569 - hi-rustin:rustin-patch-clippy, r=ehuss

Make clippy happy

It is already a reference.

3 years agoAuto merge of #9566 - ehuss:relative-rustc-path, r=alexcrichton
bors [Thu, 10 Jun 2021 14:15:18 +0000 (14:15 +0000)]
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

3 years agoAdd missing information to the man pages
KubaP [Thu, 10 Jun 2021 09:37:01 +0000 (10:37 +0100)]
Add missing information to the man pages

Add the short missing description and build all of the manpages.

3 years agoMake clippy happy
hi-rustin [Thu, 10 Jun 2021 07:14:52 +0000 (15:14 +0800)]
Make clippy happy

3 years agoMore information for links conflicting
hi-rustin [Thu, 10 Jun 2021 07:12:19 +0000 (15:12 +0800)]
More information for links conflicting

3 years agoAuto merge of #9567 - ehuss:new-rustfix, r=alexcrichton
bors [Thu, 10 Jun 2021 02:55:53 +0000 (02:55 +0000)]
Auto merge of #9567 - ehuss:new-rustfix, r=alexcrichton

Update rustfix.

This updates rustfix to 0.6.0. There are a few changes since 0.5.0, the following are noticeable changes:

* https://github.com/rust-lang/rustfix/pull/185 — Fix some panics in edge cases.
* https://github.com/rust-lang/rustfix/pull/195 — Revert revert multiple suggestions fix

The important one is https://github.com/rust-lang/rustfix/pull/195 which is necessary to handle some 2021 edition migration support. I have added a test to check that it works correctly.

3 years agoUpdate rustfix.
Eric Huss [Thu, 10 Jun 2021 01:13:56 +0000 (18:13 -0700)]
Update rustfix.

3 years agoFix rustc/rustdoc config values to be config-relative paths.
Eric Huss [Thu, 10 Jun 2021 00:46:18 +0000 (17:46 -0700)]
Fix rustc/rustdoc config values to be config-relative paths.

3 years agoMove the rustc-echo-wrapper to be shared across tests.
Eric Huss [Thu, 10 Jun 2021 00:13:33 +0000 (17:13 -0700)]
Move the rustc-echo-wrapper to be shared across tests.

This helps avoid rebuilding the same project several times.

3 years agoAdd mising information regarding `cargo doc`
KubaP [Wed, 9 Jun 2021 23:30:53 +0000 (00:30 +0100)]
Add mising information regarding `cargo doc`

It seems that the `--document-private-items` flag is automatically set when documenting a binary target.

3 years agoAuto merge of #9549 - Bryysen:master, r=ehuss
bors [Wed, 9 Jun 2021 18:00:26 +0000 (18:00 +0000)]
Auto merge of #9549 - Bryysen:master, r=ehuss

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.

This is my first PR and there are a couple things that I'm unsure about
* The integration test covers only one case (ideally it should cover every combination of the above mentioned flags the user can pass). I figured since the warning function is so simple, it'd best not to clog the testsuite with unnecessary `p.cargo().runs()` and whatnot. If I should make the test more comprehensive I can do that, it's also very easy to write unit tests so i can do that as well if needed.
* I figure we don't actually have to check the `--all-targets`, but i'm doing so for consistency. I also didn't check for the `--lib` flag at all because (I'm assuming) if the user passes `--lib` and there are no libraries, we error.
Edit: I notice (among other things) we sometimes silently skip certain units that have incompatible feature flags (see [here](https://github.com/rust-lang/cargo/blob/ed0c8c6d66e36fafbce4f78907a110838797ae39/src/cargo/ops/cargo_compile.rs#L1140)) so maybe we should be checking the `--lib` flag after all, in the event that a library was silently skipped and we no-opped :thinking:

And thanks to `@ehuss` for taking the time to answer my questions and helping me through the contribution process, much appreciated

Closes #9536

3 years agoWarn if an "all" target is specified, but we don't match anything
Bryysen [Sun, 6 Jun 2021 23:36:36 +0000 (01:36 +0200)]
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

3 years agoAuto merge of #9550 - hi-rustin:rustin-patch-feat, r=ehuss
bors [Wed, 9 Jun 2021 16:50:47 +0000 (16:50 +0000)]
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

3 years agoAuto merge of #9522 - Aelnor:respect_user_choice_of_binlib, r=ehuss
bors [Wed, 9 Jun 2021 16:26:15 +0000 (16:26 +0000)]
Auto merge of #9522 - Aelnor:respect_user_choice_of_binlib, r=ehuss

respect user choice of lib/bin over heuristics

This one fixes #9333

3 years agoAuto merge of #9547 - lu-zero:members_mut, r=alexcrichton
bors [Wed, 9 Jun 2021 15:06:38 +0000 (15:06 +0000)]
Auto merge of #9547 - lu-zero:members_mut, r=alexcrichton

Add a mean to mutably access the members of a workspace

It is used by cargo-c to patch all the lib crates in a workspace.

3 years agoImplement warning for ignored trailing arguments
Alik Aslanyan [Wed, 9 Jun 2021 14:41:46 +0000 (18:41 +0400)]
Implement warning for ignored trailing arguments
in case built-in `cargo` command was invoked with `--`

3 years agoAuto merge of #9520 - weihanglo:tree-prune, r=ehuss
bors [Wed, 9 Jun 2021 00:28:53 +0000 (00:28 +0000)]
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.

3 years agoAdd test and update docs
hi-rustin [Tue, 8 Jun 2021 03:28:58 +0000 (11:28 +0800)]
Add test and update docs

3 years agoAuto merge of #9556 - ehuss:gitignore-doc-fix, r=alexcrichton
bors [Mon, 7 Jun 2021 22:21:31 +0000 (22:21 +0000)]
Auto merge of #9556 - ehuss:gitignore-doc-fix, r=alexcrichton

Fix typo in gitignore docs.

`**.ext` is collapsed to `*.ext` by git.

3 years agoFix typo in gitignore docs.
Eric Huss [Mon, 7 Jun 2021 22:11:56 +0000 (15:11 -0700)]
Fix typo in gitignore docs.

3 years agoSimplify Workspace::members()/default_members()
Luca Barbato [Mon, 7 Jun 2021 18:52:13 +0000 (20:52 +0200)]
Simplify Workspace::members()/default_members()

3 years agoAdd a mean to mutably access the members of a workspace
Luca Barbato [Tue, 1 Jun 2021 14:45:10 +0000 (16:45 +0200)]
Add a mean to mutably access the members of a workspace

It is used by cargo-c to patch all the lib crates in a workspace.

3 years agoAuto merge of #9552 - taiki-e:typo, r=alexcrichton
bors [Mon, 7 Jun 2021 14:28:06 +0000 (14:28 +0000)]
Auto merge of #9552 - taiki-e:typo, r=alexcrichton

Fix typos in command_prelude.rs

3 years agoAuto merge of #9551 - hi-rustin:rustin-patch-clippy, r=alexcrichton
bors [Mon, 7 Jun 2021 14:00:09 +0000 (14:00 +0000)]
Auto merge of #9551 - hi-rustin:rustin-patch-clippy, r=alexcrichton

Make clippy happy

It is already a reference.

3 years agoFix typos in command_prelude.rs
Taiki Endo [Mon, 7 Jun 2021 09:25:33 +0000 (18:25 +0900)]
Fix typos in command_prelude.rs

3 years agoMake test happy
hi-rustin [Mon, 7 Jun 2021 06:59:44 +0000 (14:59 +0800)]
Make test happy

3 years agoadd default_run to SerializedPackage
hi-rustin [Mon, 7 Jun 2021 06:17:34 +0000 (14:17 +0800)]
add default_run to SerializedPackage

Delete "default_run": null,

3 years agoMake clippy happy
hi-rustin [Mon, 7 Jun 2021 06:20:14 +0000 (14:20 +0800)]
Make clippy happy

3 years agoAuto merge of #9546 - ehuss:fingerprint-dead-code, r=Eh2406
bors [Sat, 5 Jun 2021 21:30:59 +0000 (21:30 +0000)]
Auto merge of #9546 - ehuss:fingerprint-dead-code, r=Eh2406

Remove some dead code.

3 years agoRemove some dead code.
Eric Huss [Sat, 5 Jun 2021 20:38:27 +0000 (13:38 -0700)]
Remove some dead code.

3 years agoAuto merge of #9515 - pickfire:patch-1, r=ehuss
bors [Sat, 5 Jun 2021 17:21:05 +0000 (17:21 +0000)]
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.

3 years agoAuto merge of #9544 - dtolnay-contrib:semverx, r=alexcrichton
bors [Fri, 4 Jun 2021 16:29:57 +0000 (16:29 +0000)]
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.

3 years agoPull in semver 1.0.3 'x' fix
David Tolnay [Fri, 4 Jun 2021 16:19:11 +0000 (09:19 -0700)]
Pull in semver 1.0.3 'x' fix

3 years agoAuto merge of #9540 - ehuss:unstable-tracking, r=alexcrichton
bors [Fri, 4 Jun 2021 15:32:26 +0000 (15:32 +0000)]
Auto merge of #9540 - ehuss:unstable-tracking, r=alexcrichton

Add some tracking issues to unstable docs.

3 years agoAuto merge of #9538 - ehuss:docs-include-exclude, r=alexcrichton
bors [Fri, 4 Jun 2021 15:05:30 +0000 (15:05 +0000)]
Auto merge of #9538 - ehuss:docs-include-exclude, r=alexcrichton

Update documentation for include/exclude.

Closes #9502.

3 years agoAuto merge of #9534 - ehuss:mdbook-contrib, r=alexcrichton
bors [Fri, 4 Jun 2021 13:59:39 +0000 (13:59 +0000)]
Auto merge of #9534 - ehuss:mdbook-contrib, r=alexcrichton

Bump mdbook version for contrib guide.

Just bringing in a few small fixes.

3 years agoAdd some tracking issues to unstable docs.
Eric Huss [Thu, 3 Jun 2021 20:48:36 +0000 (13:48 -0700)]
Add some tracking issues to unstable docs.

3 years agoUpdate documentation for include/exclude.
Eric Huss [Thu, 3 Jun 2021 17:26:35 +0000 (10:26 -0700)]
Update documentation for include/exclude.

3 years agoAdd additional test for CJK progress width
Ivan Tham [Thu, 27 May 2021 17:19:22 +0000 (01:19 +0800)]
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.

3 years agorefactor(cargo-tree): simplify arg-parsing logic
Weihang Lo [Wed, 2 Jun 2021 23:01:45 +0000 (07:01 +0800)]
refactor(cargo-tree): simplify arg-parsing logic

Co-authored-by: Eric Huss <eric@huss.org>
3 years agorefactor(cargo-tree): remove premature micro optimization
Weihang Lo [Wed, 2 Jun 2021 22:52:01 +0000 (06:52 +0800)]
refactor(cargo-tree): remove premature micro optimization

Co-authored-by: Eric Huss <eric@huss.org>
3 years agoBump mdbook version for contrib guide.
Eric Huss [Wed, 2 Jun 2021 22:41:47 +0000 (15:41 -0700)]
Bump mdbook version for contrib guide.

3 years agoAuto merge of #9533 - akien-mga:patch-to-replace-replace-with-patch, r=alexcrichton
bors [Wed, 2 Jun 2021 14:26:14 +0000 (14:26 +0000)]
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.

3 years agoReplace deprecated `[replace]` references with `[patch]`
Rémi Verschelde [Wed, 2 Jun 2021 10:28:52 +0000 (12:28 +0200)]
Replace deprecated `[replace]` references with `[patch]`

Cf. #7092.

3 years agoAuto merge of #9322 - jameshilliard:split-host, r=joshtriplett
bors [Tue, 1 Jun 2021 20:09:13 +0000 (20:09 +0000)]
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

3 years agoAuto merge of #9523 - ehuss:link-args-validate, r=alexcrichton
bors [Tue, 1 Jun 2021 17:26:35 +0000 (17:26 +0000)]
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

3 years agoUpdate src/cargo/ops/cargo_new.rs
Alexey Chernyshov [Tue, 1 Jun 2021 17:15:39 +0000 (20:15 +0300)]
Update src/cargo/ops/cargo_new.rs

Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
3 years agochange simple quotes with backticks for file names
Alexey Chernyshov [Tue, 1 Jun 2021 17:13:45 +0000 (20:13 +0300)]
change simple quotes with backticks for file names

3 years agoremove separate `Auto` enum for `NewProjectKind`
Alexey Chernyshov [Tue, 1 Jun 2021 17:08:30 +0000 (20:08 +0300)]
remove separate `Auto` enum for `NewProjectKind`

3 years agoUpdate tests/testsuite/init.rs
Alexey Chernyshov [Tue, 1 Jun 2021 16:52:45 +0000 (19:52 +0300)]
Update tests/testsuite/init.rs

Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
3 years agoAuto merge of #9420 - In-line:unknown-features-suggestions-in-workspace, r=ehuss
bors [Tue, 1 Jun 2021 15:41:27 +0000 (15:41 +0000)]
Auto merge of #9420 - In-line:unknown-features-suggestions-in-workspace, r=ehuss

Implement suggestions for unknown features in workspace

3 years agoAuto merge of #9529 - weihanglo:refactor/make_dep_path, r=alexcrichton
bors [Tue, 1 Jun 2021 15:02:22 +0000 (15:02 +0000)]
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.

3 years agoAuto merge of #9524 - ehuss:rustflags-compatibility, r=alexcrichton
bors [Tue, 1 Jun 2021 14:35:20 +0000 (14:35 +0000)]
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.

3 years agoAuto merge of #9526 - ehuss:doc-collision-resolve, r=alexcrichton
bors [Tue, 1 Jun 2021 14:12:14 +0000 (14:12 +0000)]
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).

3 years agorefactor: extract common `make_dep_path` to cargo_util
Weihang Lo [Tue, 1 Jun 2021 02:28:36 +0000 (10:28 +0800)]
refactor: extract common `make_dep_path` to cargo_util

3 years agoConsolidate doc collision detection.
Eric Huss [Mon, 31 May 2021 02:39:48 +0000 (19:39 -0700)]
Consolidate doc collision detection.

3 years agorespect user choice of lib/bin over heuristics
Alexey Chernyshov [Sat, 29 May 2021 18:24:27 +0000 (21:24 +0300)]
respect user choice of lib/bin over heuristics

3 years agoAdd a note about passing in rustflags that conflict with Cargo.
Eric Huss [Sun, 30 May 2021 01:17:03 +0000 (18:17 -0700)]
Add a note about passing in rustflags that conflict with Cargo.

3 years agoAdd a note about rustflags compatibility.
Eric Huss [Sun, 30 May 2021 00:44:16 +0000 (17:44 -0700)]
Add a note about rustflags compatibility.

3 years agoMake cargo:rustc-link-arg-bin without the `=` an error.
Eric Huss [Sat, 29 May 2021 23:12:11 +0000 (16:12 -0700)]
Make cargo:rustc-link-arg-bin without the `=` an error.

3 years agoAdd some errors if rustc-link-arg-* specifies a non-existent target.
Eric Huss [Sat, 29 May 2021 23:00:35 +0000 (16:00 -0700)]
Add some errors if rustc-link-arg-* specifies a non-existent target.

3 years agocustom_build.rs: Import anyhow::bail
Eric Huss [Sat, 29 May 2021 20:36:31 +0000 (13:36 -0700)]
custom_build.rs: Import anyhow::bail

3 years agodoc(carog-tree): new `--prune` option
Weihang Lo [Sat, 29 May 2021 03:33:26 +0000 (11:33 +0800)]
doc(carog-tree): new `--prune` option