Commit graph

4322 commits

Author SHA1 Message Date
bors 0bbfc5e536 Auto merge of #10191 - weihanglo:issue-9881, r=alexcrichton
Improve I/O error message for fingerprint of build script

It is a bit rough but I don't think there is a network I/O error
in `pkg_fingerprint`. Checking only `io::Error` type should be fine.

Resolves #9881
2021-12-13 21:09:58 +00:00
bors 1ee19f3403 Auto merge of #10177 - ehuss:list-alias, r=alexcrichton
Explicitly mark aliases in `cargo list`.

This I think makes it a little clearer that these are aliases, and matches the form used for built-in aliases.
2021-12-13 20:26:34 +00:00
bors a4cdd757e5 Auto merge of #10171 - ehuss:no-executable-doc, r=alexcrichton
Don't emit "executable" JSON field for non-executables.

The "executable" field of JSON artifact messages was accidentally filled (with the path to `index.html`) when documenting a binary target. This fixes it so that it is null.

Closes #10149
2021-12-13 19:48:00 +00:00
bors c7db2995d0 Auto merge of #10161 - weihanglo:issue-7473, r=alexcrichton
Do not suggest source config if nothing to vendor

fixes #7473

Also remove the empty vendor dir if we've just created it but didn't vendor anything.
2021-12-13 18:26:26 +00:00
bors 3aaa8f975d Auto merge of #10172 - ehuss:doc-lib-before-bin, r=alexcrichton
Document lib before bin.

This changes it so that documenting a library is required to finish before documenting a binary. The issue is that the binary may have intra-doc links to the library. If they are documented concurrently, then the links will sometimes fail (since it is a race).   Or, if doing `cargo doc --bins`, then the library docs wouldn't exist at all.

Note that in the tests this introduces some more name collisions if you just run `cargo doc --bins` and there is a colliding library/binary name. There is some risk that someone might be trying to run the commands separately to get around the collision error, but I think it is unlikely.
2021-12-13 15:38:31 +00:00
Weihang Lo 760ff62f36
Improve I/O error message for fingerprint of build script
It is a bit rough but I don't think there is a network I/O error
in `pkg_fingerprint`. Checking only `io::Error` type should be fine.
2021-12-11 08:31:24 +08:00
Eric Huss 910569aac3 Explicitly mark aliases in cargo list. 2021-12-06 14:02:21 -08:00
bors 263b1690c2 Auto merge of #10165 - Aaron1011:stabilize-future-incompat, r=ehuss
Stabilize future-incompat-report

Depends on https://github.com/rust-lang/rust/pull/91535
2021-12-06 18:47:39 +00:00
Eric Huss 6a79008cad Don't emit "executable" JSON field for non-executables. 2021-12-05 18:39:30 -08:00
Eric Huss a09fbf2ef8 Document lib before bin. 2021-12-05 15:14:54 -08:00
bors cf474a5de7 Auto merge of #10133 - joshtriplett:release-short, r=ehuss
Support abbreviating `--release` as `-r`

Of the options people regularly pass to cargo, `--release` seems by far
the most common. Yet even on the command line, we expect people to type
out `--release`.

Add a short version `-r`, and add some tests in the testsuite that
confirm it works.
2021-12-05 19:44:23 +00:00
Aaron Hill 997bf3fffc
Stabilize future-incompat-report
Depends on https://github.com/rust-lang/rust/pull/91535
2021-12-05 14:14:32 -05:00
Weihang Lo 8a8d39a459
Do not suggest source config if nothing to vendor 2021-12-05 00:10:09 +08:00
bors 294967c53f Auto merge of #10137 - ehuss:lto-pdb-collision-test, r=alexcrichton
Fix some tests with output collisions.

This fixes some tests which run afoul of creating colliding outputs (tracked in #6313). In particular, these tests are creating duplicate pdb files on Windows because they have a binary and a library (dylib) with the same name. This is causing significant issues on rust-lang's CI (https://github.com/rust-lang/rust/issues/81890) where the MSVC linker is failing with a mysterious LNK1201 error. Presumably two LINK.exe processes are trying to write to the same PDB file at the same time, which causes it to fail.

Ideally this shouldn't happen, but I don't really have any ideas on how to resolve it, as the name of the PDB has some importance.

I have not been able to reproduce the LNK1201 error. My hope is that this change will help alleviate the issue, though.

I updated the `doc_all_member_dependency_same_name` test to illustrate that it is hitting a collision, which is a fundamental part of that test (and something we should probably figure out how to resolve in the future).
2021-11-29 19:04:22 +00:00
Eric Huss 2507d53bb6 Fix some tests with output collisions. 2021-11-29 11:04:08 -08:00
bors c5fddb0f56 Auto merge of #10130 - weihanglo:issue-8690, r=alexcrichton
Improve unused patch message when source URLs mismatched

Resolves #8690

`Resolve.unused_patches` does not contains info about which source
URLs they are going to patch. As a result, we cannot provide a precise
message but only list all possible URLs of the packages with the same
name in the resolved graph.

There is a little flaw that if multiple patches are patching the same
package, the source URL of the used one would be shown as a possible
URL in the warning.
2021-11-29 16:29:46 +00:00
Josh Triplett 2f53ca2df1 Support abbreviating --release as -r
Of the options people regularly pass to cargo, `--release` seems by far
the most common. Yet even on the command line, we expect people to type
out `--release`.

Add a short version `-r`, and add some tests in the testsuite that
confirm it works.
2021-11-28 20:25:57 -08:00
Eric Huss ca3356a25c Add a note about doctest xcompile. 2021-11-28 17:32:11 -08:00
Weihang Lo 91791c4fb1
Improve unused patch message when source URLs mismatched
`Resolve.unused_patches` does not contains info about which source
URLs they are going to patch. As a result, we cannot provide a precise
message but only list all possible URLs of the packages with the same
name in the resolved graph.

There is a little flaw that if multiple patches are patching the same
package, the source URL of the used one would be shown as a possible
URL in the warning.
2021-11-28 09:20:06 +08:00
bors b85ad15963 Auto merge of #10093 - hi-rustin:rustin-patch-rustc, r=ehuss
Add crate type flag to rustc command

part of https://github.com/rust-lang/cargo/issues/10083

- Add crate type flag to rustc command
- Add tests
- Update docs
2021-11-26 15:30:19 +00:00
Esteban Kuber 0dfe70f7e1 Change test to not trigger emoji error
This change is needed to land rust-lang/rust#88781, as it changes the
handling of emojis in source code to treat them as identifiers.
2021-11-24 17:07:40 +00:00
hi-rustin 660ce6bba4 Add tests
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-23 22:58:18 +08:00
bors e1fb17631e Auto merge of #10110 - hi-rustin:rustin-patch-build-test, r=alexcrichton
re-enable lto_build test on 32-bit MSVC

re-enable lto_build test on 32-bit MSVC. Because https://github.com/rust-lang/rust/pull/27224 landed.
2021-11-22 16:53:06 +00:00
bors a2c6ec7522 Auto merge of #10103 - ehuss:tree-cycle, r=alexcrichton
Fix a couple issues with cyclic features and dev-dependencies

This fixes two issues with cyclic features and dev-dependencies:

* `cargo tree` would enter an infinite loop for cyclic features.
* The resolver would return a confusing error if a cyclic dev-dependency attempted to enable a feature on its parent that resulted in a cycle.  This fixes it to resolve correctly.

Fixes #10101
2021-11-22 16:18:31 +00:00
hi-rustin a22a68e937 re-enabled lto_build test on 32-bit MSVC
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-22 22:12:48 +08:00
bors df8cda0a12 Auto merge of #10107 - hi-rustin:rustin-patch-install, r=ehuss
Add --message-format for install command

close https://github.com/rust-lang/cargo/issues/10104
2021-11-21 16:13:58 +00:00
hi-rustin 6351472a80 Add --message-format for install
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 12:16:50 +08:00
hi-rustin a0dffe0f43 Make clippy happy
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 11:40:31 +08:00
bors 7a947ae523 Auto merge of #10043 - jyn514:hard-error, r=ehuss
Give a hard error if `-Zrustdoc-scrape-examples` is missing a flag

It's the same as if the option wasn't passed, and it makes it difficult to
figure out why rustdoc isn't generating examples.

Fixes https://github.com/rust-lang/cargo/issues/10042 (cc `@willcrichton)`
2021-11-20 18:23:22 +00:00
Eric Huss 2eee644c68 Fix resolve error with cyclic dev-dependency features.
There is a convoluted situation where a cyclic dev-dependency attempts
to enable a feature on its parent. It would result in a confusing error
saying a package didn't have a feature.

This check was intended only for CLI features, not features passed
through the dependency graph.
2021-11-19 18:10:10 -08:00
Eric Huss d7ab4a6598 cargo tree: Fix stack overflow on cyclic features. 2021-11-19 18:07:31 -08:00
bors ad50d0d266 Auto merge of #10082 - basile-henry:basile/alias-shadow-external-warning, r=ehuss
Warn when alias shadows external subcommand

As per #10049, we start by emitting a warning when an alias shadows an
existing external subcommand. After a transition period (duration not
specified), we will make this a hard error.

Should the warning mention that this will become a hard error?
2021-11-17 18:36:37 +00:00
bors adf601d41c Auto merge of #10072 - russweas:master, r=alexcrichton
Implement escaping to allow clean -p to delete all files when directory contains glob characters

Closes #10068.

Runs `glob::Pattern::escape` on path input to `rm_rf_glob()`. This fixes a bug in which `cargo clean -p` fails to delete a number of files from `target/` if the path to target contains glob characters.
2021-11-17 16:00:17 +00:00
bors d2d4b06e55 Auto merge of #10092 - ChrisDenton:tmp-match-err, r=alexcrichton
Match any error when failing to find executables

For Windows targets, Rust now uses [a custom resolver](https://github.com/rust-lang/rust/pull/87704) to find `process::Command` programs. This has caused some error messages to change.

To allow the PR to be merged, some tests have been adjusted to match any error.

cc `@ehuss`
2021-11-17 15:16:29 +00:00
Chris Denton 93bcd97fc1
Match any error when failing to find executables
For Windows targets, Rust now uses a custom resolver to find `process::Command` programs. This has caused some error messages to change.

To allow it to be merged, some tests have been adjusted to match any error.
2021-11-17 11:09:52 +00:00
Weihang Lo 2698bc6a42
Test for target auto-discovery error enhancement 2021-11-17 18:14:27 +08:00
Basile Henry 0b4e2ca330 Add test for alias shadowing external subcommand
This is currently still permitted, so we only test that the warning is properly issued
2021-11-17 09:23:06 +01:00
Basile Henry cba8503e3a Add details in warning for alias shadowing external subcommands 2021-11-17 09:22:08 +01:00
Russ Weas effc72042b Implement glob escaping for clean -p
Implement glob escaping for clean -p

Add pattern escape for glob matching cargo clean files

Implement correct solution for #10068

Removed superfluous formatting changes

Update rm_rf_glob()'s error handling

Remove dir_glob reference for non-glob function

Added test

Satisfy clippy

Add MSVC support for test
2021-11-16 16:55:23 -06:00
Basile Henry 3a5bb75467
Update tests/testsuite/cargo_alias_config.rs 2021-11-14 20:22:13 +00:00
Basile Henry 2ead2d9e3d
Update tests/testsuite/cargo_alias_config.rs 2021-11-14 20:22:05 +00:00
Basile Henry 9f768bbcd8 Update test for warning for alias shadowing an external subcommand 2021-11-14 20:38:40 +01:00
Joshua Nelson 8713cd7e69 Give a hard error if -Zrustdoc-scrape-examples is missing a flag
It's the same as if the flag wasn't passed, and it makes it difficult to
figure out why rustdoc isn't generating examples.
2021-11-05 09:07:15 -05:00
bors e3f2953bcb Auto merge of #10037 - willcrichton:example-analyzer, r=alexcrichton
Fix --scrape-examples-target-crate using package name (with dashes) instead of crate name (with underscores)

This PR fixes #10035.
2021-11-04 19:30:42 +00:00
Will Crichton 7ee3ffc7e6 Fix --scrape-examples-target-crate using package name (with dashes) instead of crate name (with underscores), closes #10035 2021-11-04 11:23:40 -07:00
bors 4cc3f4f193 Auto merge of #10017 - willcrichton:example-analyzer, r=alexcrichton
Change --scrape-examples flag to -Z rustdoc-scrape-examples

I'm working on getting the scrape examples feature working on docs.rs. However, docs.rs uses `cargo rustdoc` instead of `cargo doc`, and right now the `--scrape-examples` flag is only allowed for `cargo doc`. So this PR changes it to a `-Z` flag that can be passed to either command.
2021-10-29 14:07:40 +00:00
Will Crichton 9fb78cf698 Change --scrape-examples flag to -Z rustdoc-scrape-examples 2021-10-29 00:15:19 -07:00
bors 0a98b1de5c Auto merge of #9525 - willcrichton:example-analyzer, r=alexcrichton
Scrape code examples from examples/ directory for Rustdoc

Adds support for the functionality described in rust-lang/rfcs#3123

Matching changes to rustdoc are here: https://github.com/rust-lang/rust/pull/85833
2021-10-28 16:58:42 +00:00
Will Crichton 0a2382b6db Formatting 2021-10-28 00:38:16 -07:00
Will Crichton 11209570c9 Change scraping to apply to all workspace packages instead of just
root units. Only attach Docscrape unit dependencies to workspace Doc
units. Add test for scraping examples with complex reverse dependencies.
2021-10-28 00:35:34 -07:00