Add note about RUSTFLAGS removal from build scripts.
The RUSTFLAGS environment variable was removed from build scripts in #9601, but the release notes did not make a note of this change. This adds a highlight to this potentially breaking change.
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).
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.
Add a note about doctest xcompile.
This adds a note when running with `--verbose` if doctests are being skipped because they do not support cross-compiling.
I decided to use verbose instead of always displaying it because I felt it could get really noisy. However, I'm a bit on the fence. I'm kinda curious what is blocking doctest-xcompile from being stabilized?
`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.
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.
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
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)`
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.
silly fix, pointer to the empty slice
Just a silly thing. I don't know when this was fixed. NLL? But we no longer need a real Vec to produce a pointer to the empty slice.
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?
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.
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`
Enhance error message for target auto-discovery
resolves#9014resolves#9117
Enhance for following scenarios:
1. Target without `path` specified and cannot be found.
2. Target without `path` specified and cannot be found, but a file
exists at the commonly wrong path, e.g. `example/a.rs`, `bench/b.rs`.
3. Found multiple candidate files and cannot infer which to use.
For the suggestion in [the thread in #9116], I can't see any feasible way to list potential candidates without addditional I/O checking file existences. This PR is the best effort I can think of at this time. Feel free to comment. Thanks!
[the thread in #9116]: https://github.com/rust-lang/cargo/pull/9116#discussion_r575712762
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.
Enhance for following scenarios:
1. Target without `path` specified and cannot be found.
2. Target without `path` specified and cannot be found, but a file
exists at the commonly wrong path, e.g. `example/a.rs`, `bench/b.rs`.
3. Found multiple candidate files and cannot infer which to use.
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
Include note about bug while building on macOS in mdbook
See https://github.com/rust-lang/rust/issues/90342. I can watch the thread and push another PR to delete this note once this bug is resolved.