Commit graph

12575 commits

Author SHA1 Message Date
Jon Gjengset
ed78e6b747 Bump snapbox to 0.3
0.3 has a small number of [breaking changes], but makes diffs much
easier to visually parse by eliding large sections of unchanged content.

[breaking changes]: https://github.com/assert-rs/trycmd/blob/main/crates/snapbox/CHANGELOG.md#030---2022-08-01
2022-08-17 22:07:20 +00:00
bors
3b4df5a54a Auto merge of #11001 - Muscraft:fix-unstable-docs, r=weihanglo
remove missed reference to workspace inheritance in unstable.md

Currently on the nightly docs, workspace inheritance is [under the  stable table](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#workspace-inheritance-1)  and the [unstable table](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#workspace-inheritance). It looks like I forgot to remove it from the unstable table when working on stabilization.

I am not sure if it is worth a beta backport but I will happily open a PR for it if needed.
2022-08-17 20:18:30 +00:00
Scott Schafer
a5a98f6c7c remove missed reference to workspace inheritance in unstable.md 2022-08-17 14:15:50 -05:00
bors
9e1b4577ce Auto merge of #10988 - hi-rustin:rustin-patch-warn, r=epage
Warning when precise or aggressive without -p flag

### What does this PR try to resolve?

ref https://github.com/rust-lang/cargo/issues/10919.

Warning when precise or aggressive without -p flag. It will be a hard error in future.

### How should we test and review this PR?

- Unit test.
2022-08-17 14:36:56 +00:00
hi-rustin
a58489dfbb Add test for aggressive update
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-08-17 21:53:12 +08:00
hi-rustin
f95deaafeb Warning when precise or aggressive without -p flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-08-17 21:53:07 +08:00
bors
9809f8ff33 Auto merge of #10944 - kcrimson-ar:master, r=epage
Improve error message for an array value in the manifest

Fixes https://github.com/rust-lang/cargo/issues/10942

The error message will be:

```
error: failed to parse manifest at `/Users/..`

Caused by:
  invalid type: string "Ky", expected an array for key `package.authors`
```
2022-08-16 22:10:06 +00:00
bors
5a7ba9cdfb Auto merge of #10975 - theCapypara:flock-enosys-android, r=weihanglo
Fix file locking being not supported on Android raising an error

This PR fixes #10972 by not failing Cargo operations when the `target_os` is Android and file locking is being reported as not being implemented by the kernel.

I am sadly unable to actually test this at the moment, since despite my best efforts I am not able to get Cargo actually cross-compiled for Android (aarch64-linux-android).

I however don't see any reason why this wouldn't work. `target_os` is "android" on Android and not "linux".
2022-08-16 12:29:32 +00:00
Marco Köpcke
b0c9586f4c No longer gate unsupported file locking behind Linux as OS 2022-08-16 12:46:47 +02:00
bors
84941490fd Auto merge of #10983 - ehuss:version-bump, r=weihanglo
Bump to 0.66.0, update changelog
2022-08-12 21:14:11 +00:00
Eric Huss
aae4c84a09 Also mention build.target being an array. 2022-08-12 14:12:22 -07:00
Eric Huss
b1f49c9737 Update changelog for 1.64 2022-08-12 13:22:37 -07:00
Eric Huss
34632c5925 Bump to 0.66.0 2022-08-12 12:22:05 -07:00
bors
efd4ca3dc0 Auto merge of #10977 - weihanglo:std-thread-scope, r=epage
Use `std:🧵:scope` to replace crossbeam

Drop one dependency as `std:🧵:Scope` got stabilized in 1.63.

Haven't done any benchmark. (Should we?)
2022-08-12 01:28:28 +00:00
bors
4fe9b13276 Auto merge of #10978 - andrewpollack:docs-removing-excess-in, r=weihanglo
[docs] Remove extra "in" from `cargo-test.md`

Removes an extra "in" from doc src/doc/src/commands/cargo-test.md

Successor to #10971 without bungled merge
2022-08-11 23:57:19 +00:00
andrewpollack
195b1e0e50 Removing excess in 2022-08-11 16:47:52 -07:00
Weihang Lo
33497512a8
Use std:🧵:scope to replace crossbeam 2022-08-12 00:09:54 +01:00
bors
34cba461f2 Auto merge of #10930 - ehuss:enable-windows-tests, r=weihanglo
Enable two windows tests

These two tests were disabled on Windows a long time ago. AFAICT, the reasons are no longer relevant, and it should be safe to enable these tests. See each commit for a more detailed exposition.
2022-08-11 22:30:26 +00:00
Marco Capypara Köpcke
585cf31990 Fix flock being not supported on Android raising an error 2022-08-11 15:47:09 +02:00
bors
1ac43cf649 Auto merge of #10968 - hi-rustin:rustin-patch-msg, r=ehuss
Improve error msg for get target runner

Actually, we'll get this config from three places. So this msg may be confusing when you set it up in `.cargo/config.toml` or pass it by `--config`.
We already printed the location of the config, so I think it's OK to change it to `configurations`.
2022-08-11 03:23:09 +00:00
bors
a120cfe08e Auto merge of #10962 - Nemo157:override-target-dir, r=ehuss
Ensure rustc-echo-wrapper works with an overridden build.target-dir

Without this when running with an overridden target-dir there are about a dozen test failures like

```console
> mkdir .cargo
> echo '[build]\ntarget-dir = "not-target"' > .cargo/config
> cargo test -- fix::does_not_crash
---- fix::does_not_crash_with_rustc_wrapper stdout ----
running `/home/nemo157/sources/cargo/not-target/debug/cargo build`
running `/home/nemo157/sources/cargo/not-target/debug/cargo fix --allow-no-vcs`
thread 'fix::does_not_crash_with_rustc_wrapper' panicked at '
test failed running `/home/nemo157/sources/cargo/not-target/debug/cargo fix --allow-no-vcs`
error: process exited with code 101 (expected 0)
--- stdout

--- stderr
error: failed to run `rustc` to learn about target-specific information

Caused by:
  could not execute process `/home/nemo157/sources/cargo/not-target/tmp/cit/rustc-echo-wrapper/target/debug/rustc-echo-wrapper rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (never executed)

Caused by:
  No such file or directory (os error 2)
', tests/testsuite/fix.rs:1228:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Because the `rustc-echo-wrapper` is compiled to `not-target/debug/rustc-echo-wrapper`.

This is resolved by forcing the target-dir to be a manifest-relative one for this specific build.
2022-08-10 21:55:46 +00:00
bors
3a17953664 Auto merge of #10969 - joshtriplett:available-parallelism, r=epage
Switch back to `available_parallelism`

This reverts commit 8345cf5037 now that https://github.com/rust-lang/rust/pull/97925 is merged.

Since that
time, there are now multiple calls to get the number of CPUs, to handle
the `-j -NUM` case, so factor out a helper function.
2022-08-10 17:52:21 +00:00
Josh Triplett
86163845a5 Switch back to available_parallelism
This reverts commit 8345cf5037. Since that
time, there are now multiple calls to get the number of CPUs, to handle
the `-j -NUM` case, so factor out a helper function.
2022-08-10 17:49:24 +02:00
Wim Looman
61c4b11eae
Ensure rustc-echo-wrapper works with an overridden build.target-dir 2022-08-10 17:37:40 +02:00
hi-rustin
6bb4050552 Fix test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-08-10 23:19:35 +08:00
hi-rustin
f11d9a1852 Improve error msg for get target runner
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-08-10 22:43:00 +08:00
bors
1fcbca84ee Auto merge of #10961 - Nemo157:skip-implicit-override, r=epage
Only override published resolver when the workspace is different

### What does this PR try to resolve?

Ensures when publishing a package that uses an implicit `resolver = "1"` to maintain an MSRV before the `resolver` key was stabilized the implicitness is retained rather than being turned into an explicit setting.

fixes #10954 (assuming that the workspace and its packages are configured with a consistent resolver)
2022-08-10 14:30:11 +00:00
bors
fcf3281ec7 Auto merge of #10967 - hi-rustin:rustin-patch-docs, r=epage
Add `CARGO_LOG` to "Environment variables Cargo reads"

### What does this PR try to resolve?
close https://github.com/rust-lang/cargo/issues/10947
2022-08-10 13:47:46 +00:00
hi-rustin
ccf81aee3a Add CARGO_LOG to Environment variables Cargo reads
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-08-10 20:51:28 +08:00
Wim Looman
492358a19f
Only override published resolver when the workspace is different 2022-08-10 09:26:50 +02:00
bors
ce40690a5e Auto merge of #10891 - joshtriplett:rust-version-recommend-precise, r=ehuss
Make the `rust-version` error recommend `cargo update --precise -p crate@ver`

People encountering a dependency with a newer `rust-version` requirement
may not know about `cargo update --precise`, or may consider alternate
approaches that may be harmful (such as pinning with a `=` dependency).

Provide specific guidance in the error message.
2022-08-09 22:32:17 +00:00
Wim Looman
df0c64ebc1
Have Edition know what its default resolver behaviour is 2022-08-09 22:07:12 +02:00
Josh Triplett
934e79072a Only show advice to use cargo update --precise for non-local packages
Packages in the local workspace can't get updated this way; the user
just needs to point to a different source, or otherwise update the
package themselves.
2022-08-08 10:37:15 -07:00
Josh Triplett
dcbb433340 Make the rust-version error recommend cargo update -p crate@ver --precise ...
People encountering a dependency with a newer `rust-version` requirement
may not know about `cargo update --precise`, or may consider alternate
approaches that may be harmful (such as pinning with a `=` dependency).

Provide specific guidance in the error message.

If the user is using `cargo install`, suggest `cargo install --locked` instead.
2022-08-08 10:37:15 -07:00
Ky Phan
8f1a75d584 Add unit test for invalid authors, refactor name 2022-08-08 22:05:43 +07:00
bors
e6827eee9b Auto merge of #10946 - RalfJung:docs, r=epage
resolver docs: link to version requirements syntax full explanation

Staring at https://doc.rust-lang.org/cargo/reference/resolver.html#semver-compatibility, I was confused was this is a "refresher" for. Let's add a link to the main documentation this summarizes.
2022-08-06 22:45:31 +00:00
Ralf Jung
99f279bb9d resolver docs: link to version requirements syntax full explanation 2022-08-06 17:01:59 -04:00
bors
0ced33b165 Auto merge of #10943 - hi-rustin:rustin-patch-bump, r=epage
Bump os_info to 3.5.0

close https://github.com/rust-lang/cargo/issues/10940
2022-08-06 15:14:30 +00:00
Ky Phan
ee1d688da4 Improve error message for an array 2022-08-06 13:52:39 +07:00
hi-rustin
df8f33b4f2 Bump os_info to 3.5.0
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-08-06 13:12:20 +08:00
bors
40d71af13a Auto merge of #10941 - hi-rustin:rustin-patch-docs, r=weihanglo
Mark --timings=html unstable in the document

### What does this PR try to resolve?

Mark -timings=html unstable in the document. The document was confusing because if you try `--timings=html` it still requires the unstable flag.

### How should we test and review this PR?

Check out the document.

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
2022-08-05 23:46:48 +00:00
hi-rustin
a6e6b89d71 Mark -timings=html unstable in the document
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-08-05 19:39:13 +08:00
bors
5ac9be2eea Auto merge of #10935 - har7an:patch-1, r=epage
Mention that aliases are recursive

Instead of duplicating portions of commands that are used identically across many aliases, the user can instead reuse any previously defined aliases.

### What does this PR try to resolve?

Today I started working with [`xtask`](https://github.com/matklad/cargo-xtask/), which is a build system based on a simple cargo alias:

```toml
[alias]
xtask = "run --package xtask --"
```

Since the word "xtask" is rather difficult to type in my opinion (at least my left hand struggles quite a bit) I wanted to add another alias, `x` as a shorthand (similar to what `build`, `run`, etc. have by default). Thereby I discovered that I needn't replicate the whole alias, because aliases are recursive. I consulted the docs and couldn't find a mention of this, hence I'm adding it as part of this PR so other users can discover it.

### How should we test and review this PR?

I don't think this requires a separate test, it's a minor change to the documentation only.

### Additional information
2022-08-04 13:59:45 +00:00
har7an
e8cd6f4bcf Mention that aliases are recursive
Instead of duplicating portions of commands that are used identically
across many aliases, the user can instead reuse any previously defined
aliases.
2022-08-04 09:20:40 +02:00
bors
7259757dc6 Auto merge of #10322 - eholk:reserved-windows-name, r=ehuss
Test if reserved filenames are allowed in Windows

Recent versions of Windows have removed the limitation on filenames like `aux` or `con`. This change allows the `package::reserved_windows_name` to still pass by first trying to create a file with a reserved name to see if Windows supports it. If so, it skips the rest of the test. Otherwise, we keep the same behavior as before.
2022-08-04 00:32:49 +00:00
Eric Holk
8de9adfb0d Use old Windows path handling on CI 2022-08-03 16:09:06 -07:00
Eric Holk
e9c7544c19 Move Windows path test function to test code 2022-08-03 15:59:59 -07:00
Eric Holk
d03530f261 Update comment 2022-08-03 15:59:58 -07:00
Eric Holk
f122dbbd41 Use GetFullPathNameW to test restricted names
The previous commit tests whether the current machine supports Windows
restricted names by creating a file and checking whether that succeeds.
This commit reworks this testto use GetFullPathNameW, which can be done
without having to create and remove new files.
2022-08-03 15:59:58 -07:00
Eric Holk
0adcc183bc Test if reserved filenames are allowed in Windows
Recent versions of Windows have removed the limitation on filenames like
`aux` or `con`. This change allows the `package::reserved_windows_name`
to still pass by first trying to create a file with a reserved name to
see if Windows supports it. If so, it skips the rest of the test.
Otherwise, we keep the same behavior as before.
2022-08-03 15:59:58 -07:00