Commit graph

11617 commits

Author SHA1 Message Date
bors 451a0430c9 Auto merge of #10141 - ehuss:note-rustflags-removal, r=alexcrichton
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.
2021-11-30 17:47:34 +00:00
Eric Huss cfee33e8b0 Add note about RUSTFLAGS removal from build scripts. 2021-11-30 09:33:59 -08:00
bors 2ad6cb7f5d Auto merge of #10139 - hi-rustin:rustin-patch-clippy, r=Eh2406
Make clippy happy

This expression borrows a reference (`&core::registry::PackageRegistry`) that is immediately dereferenced by the compiler.
2021-11-30 15:01:06 +00:00
hi-rustin de5efea8b6 Make clippy happy
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-30 21:26:56 +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 26105a45e9 Auto merge of #10109 - hi-rustin:rustin-patch-docs-profile, r=ehuss
Description of the targets that can be applied

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

Adds a description of the targets to which the default profile can be applied.
2021-11-29 18:27:56 +00: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
bors 533512008a Auto merge of #10132 - ehuss:doctest-xcompile-note, r=alexcrichton
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?
2021-11-29 15:48:33 +00:00
Eric Huss ca3356a25c Add a note about doctest xcompile. 2021-11-28 17:32:11 -08:00
bors 8032ac5ef0 Auto merge of #10124 - matklad:edit-template-url, r=ehuss
book: add edit links to specific pages
2021-11-28 17:03:18 +00:00
Aleksey Kladov 3028bbac25 book: add edit links to specific pages 2021-11-28 11:41:17 +03:00
hi-rustin c066a2384f Description of the targets that can be applied
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-28 14:00:05 +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
bors 7f08ace4f1 Auto merge of #10117 - estebank:update-test-for-emoji, r=ehuss
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:54:39 +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 137f9bc3d1 Add crate-type unstable doc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-23 23:21:39 +08: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
bors 934bc6143e Auto merge of #10106 - russweas:master, r=ehuss
Update curl dependency, remove M1 macOS build error note

Curl subversion 41 includes a workaround for the m1 macOS build error.
See https://github.com/rust-lang/rust/issues/90342#issuecomment-974698158
2021-11-21 15:31:50 +00:00
bors fa107dda36 Auto merge of #10105 - hi-rustin:rustin-patch-clippy, r=ehuss
Make clippy happy

Make clippy happy. Remove redundant clone.
2021-11-21 14:45:20 +00:00
hi-rustin 0c5f348bc2 Add crate type flag to rustc command
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 12:31:00 +08:00
hi-rustin 890b0e888b Update install doc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 12:22:02 +08: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
Russ Weas 22ff7ac47c Update curl dependency, remove M1 macOS build error note 2021-11-20 22:04:58 -06: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 5907635259 Auto merge of #10097 - Eh2406:silly, r=alexcrichton
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.
2021-11-18 23:00:05 +00:00
Jacob Finkelman 2f7009f52a silly fix 2021-11-18 22:46:28 +00: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
bors aed972396c Auto merge of #10090 - weihanglo:issue-9014, r=alexcrichton
Enhance error message for target auto-discovery

resolves #9014
resolves #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
2021-11-17 14:31:16 +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
Weihang Lo 74390a4ad7
Enhance error message for target auto-discovery
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.
2021-11-17 18:14:14 +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
bors e475fe4a17 Auto merge of #10073 - russweas:patch-1, r=alexcrichton
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.
2021-11-15 20:47:26 +00:00
Russ Weas d98590ab98
Update working-on-cargo.md 2021-11-15 12:42:37 -06:00
bors 83bd9f6a1d Auto merge of #10080 - hi-rustin:rustin-patch-quiet, r=alexcrichton
Improve the help text of the --quiet args for all commands

close https://github.com/rust-lang/cargo/issues/8928
2021-11-15 15:13:28 +00:00
bors d2cc298079 Auto merge of #10024 - dswij:9960, r=ehuss
`future-incompat-report` checks both stdout and stderr for color support

Closes #9960
2021-11-15 14:32:52 +00:00
Dharma Saputra Wijaya 622b43aaec future-incompat-report checks both stdout and stderr for color support 2021-11-15 10:29:45 +08:00