6712 Commits

Author SHA1 Message Date
Dacian Pascu
43a5dee2a8
fix(git): added extra error context for a revision that doesn't exist
See issue rust-lang#14621
2024-11-17 22:49:36 +02:00
Dacian Pascu
f3edba9197
test(git): added tests for issue rust-lang#14621 2024-11-17 21:14:48 +02:00
Arlo Siemsen
d8cb5fb7f8
Merge pull request #14388 from arlosi/warnings2
feat(warnings): add build.warnings option
2024-11-09 00:29:19 +00:00
Arlo Siemsen
2274a1a946 feat: add build.warnings config option to control rustc warnings 2024-11-08 15:27:33 -06:00
Arlo Siemsen
cfa1873d4e Add tests that show existing behavior 2024-11-08 15:27:30 -06:00
Ed Page
cada441a16 Revert "feat: Add CARGO_RUSTC_CURRENT_DIR"
This reverts commit e81d84cc17d7df6a249e60cbc620f25edbe782db.

Fixes #14798
2024-11-08 14:36:21 -06:00
Ed Page
af3cfd5abe fix(test): Un-deprecate contains assertions 2024-11-07 15:55:35 -06:00
Ed Page
a03adcf6e2 fix(test): Make redactions consistent with snapbox
I'm unsure how we should be replacing these use cases, so I'm exploring
keeping them but making them use snapbox under the hood.
Part of the intent of snapbox is that it provides you the building
blocks to make what you need.
2024-11-06 20:03:53 -06:00
bors
be87c96b23 Auto merge of #14785 - epage:test-unordered, r=ehuss
test(gc): Update remaining unordered tests to snapbox

### What does this PR try to resolve?

This gets rid of the last unordered tests and removes the functions from `cargo-test-support` as part of #14039

Some tests are being less specific than they were before but in talking to ehuss, it sounded like that was ok.

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

### Additional information
2024-11-06 18:06:06 +00:00
bors
d050945fe4 Auto merge of #14497 - linyihai:issue-14227, r=epage
Normalize the `target` paths

### What does this PR try to resolve?

The `targets` path of the `normalized_toml` could be relative,   which isn't user-friendly.

What is this PR doing?

This PR applys the `paths::normalize_path` to remove the relative part.

Fixes #14227

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

Add a test originted from the issue,  and fixing it in the next commit.

### Additional information
2024-11-06 17:10:46 +00:00
Lin Yihai
a456c22531 fix: Apply path::normalize_path to targets in toml::normalize_toml phase 2024-11-06 15:05:11 +08:00
bors
91809c45b1 Auto merge of #14781 - epage:to, r=weihanglo
test: Update some emaining unordered tests to snapbox

### What does this PR try to resolve?

This is part of #14039

This leaves `global_cache_tracker.rs` as it requires some more thinking.

As for the flakiness in `freshness.rs`  that was seen in #14161, `compare.rs` would prioritize expected lines according to their length (assuming its more specific).  Currently, snapbox prioritizes according to the line order.  So we just need to put the proc-macro line before the other one to ensure it gets precedence.

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

### Additional information
2024-11-05 04:15:40 +00:00
Ed Page
f7f7abccf3 test(gc): Update remaining unordered tests to snapbox 2024-11-04 16:05:49 -06:00
Ed Page
6ba83152e5 test(freshness): Update remaining unordered tests to snapbox
`compare.rs` gives priority based on expected-line length.
`snapbox` gives priority according to the expected line order.
2024-11-04 16:03:39 -06:00
Ed Page
99090694dc test(clean): Update remaining unordered test to snapbox 2024-11-04 16:03:32 -06:00
bors
ad3cdb4575 Auto merge of #14749 - Rustin170506:rustin-patch-cargo-script, r=epage
Change config paths to only check CARGO_HOME for cargo-script
2024-11-04 16:34:55 +00:00
Rustin170506
bd47da1ab1 Change config paths to only check CARGO_HOME for cargo-script
Signed-off-by: Rustin170506 <29879298+Rustin170506@users.noreply.github.com>
2024-11-03 18:11:52 +08:00
Lin Yihai
f8df39b133 test: Add a test for issue #14227 2024-11-01 14:39:15 +08:00
Weihang Lo
8aec0a40f5
test(rustfix): switch to a simpler case for dedup-suggestions
This case also emits an insert-only suggestions (span start == end),
and doesn't rely on any lint behavior.

See also

* https://github.com/rust-lang/cargo/pull/13728
* https://github.com/rust-lang/cargo/issues/13027
2024-10-31 22:05:24 -04:00
bors
7421ccf915 Auto merge of #14760 - epage:test-flake, r=ehuss
test(doc): Resolve flaky test

Saw this failure on #14759
2024-10-31 22:39:12 +00:00
Ed Page
35baa734ff test(doc): Resolve flaky test
Saw this failure on #14759
2024-10-31 16:26:37 -05:00
bors
40d804ba5d Auto merge of #14752 - RalfJung:rustc-root-path, r=epage
add unstable -Zroot-dir flag to configure the path from which rustc should be invoked

This implements the proposal described [here](https://github.com/rust-lang/cargo/issues/9887#issuecomment-2273742881): we add a new flag, for now called `-Zroot-dir`, that configures the directory relative to which rustc is given the crate root filenames to build. (Files outside this directory are passed absolutely.)

This is necessary to be able to fix (no github don't close that issue yet) https://github.com/rust-lang/rust/issues/128726: in multi-workspace repositories that use scripts to manage a whole bunch of cargo invocations, currently the output cargo+rustc produce is often hard or even impossible to interpret for both human and machine consumption. This is because directories in the output are always relative to the workspace root, but when cargo is invoked many times for different workspaces, it is quite unclear what the workspace root is for the invocation that failed.

So I suggest we should have a new flag that the build script in such a repo can set to the consistent "root dir" that the user would recognize as such (e.g., the root of the rustc source tree), and all paths emitted by cargo and rustc should be relative to that directory.

I don't know all the places that cargo itself emits paths (if any), but this PR changes the way we invoke rustc to honor the new flag, so all paths emitted by rustc will be relative to the `-Zroot-dir`.

See https://github.com/rust-lang/rust/pull/132390 for the changes needed in rustc bootstrap to wire this up; together, that suffices to finally properly show errors in RA for all parts of the rustc src tree. :)
2024-10-31 21:16:35 +00:00
Ralf Jung
c2be327042 add unstable -Zroot-path flag to configure the path from which rustc should be invoked 2024-10-31 21:35:57 +01:00
Ralf Jung
573ff00fe6 add tests in preparation for root-dir flag that changes their behavior 2024-10-31 21:34:48 +01:00
bors
5f9257e685 Auto merge of #14748 - epage:msrv-policy, r=Rustin170506
test: Remove unused msrv-policy

### What does this PR try to resolve?

Missed this in #14639

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

### Additional information
2024-10-30 23:04:29 +00:00
Ed Page
d125262545 download transitive deps of artifact deps on target platform 2024-10-30 16:26:17 -04:00
elchc
7ec86a118c un-ignore test: proc_macro_in_artifact_dep with a network error 2024-10-30 15:46:40 -04:00
Ed Page
51f634b3bd test: Remove unused msrv-policy
Missed this in #14639
2024-10-30 09:57:01 -05:00
bors
9abcaefd51 Auto merge of #14317 - harmou01:dev/harmou01/remove-target-flag-req, r=ehuss
Remove requirement for --target when invoking Cargo with -Zbuild-std

This PR addresses [this issue](https://github.com/rust-lang/wg-cargo-std-aware/issues/25) re: build-std stabilization. We believe the requirement for --target to be specified when invoking cargo with -Zbuild-std, from our testing, is no longer needed. Now, with this change, by default Cargo will use the Host CompileKind, rather than a manually specified CompileTarget. We propose removing this restriction in order to test this more widely. Our own testing is detailed below.

This change has been tested in the following manner:
* Building crates depending on proc_macro, std, and build scripts (which themselves depend on proc_macro)
* Various RUSTFLAGS, such as `-Zsanitizer=cfi`, `-Cembed-bitcode=yes`, `-Cforce-frame-pointers`, `-Cforce-unwind-tables=yes`, `-Csoft-float=yes`, `-Zbranch-protection=pac-ret`.
2024-10-30 13:54:02 +00:00
bors
4f74477679 Auto merge of #14743 - ehuss:build-script-errors, r=epage
Allow build scripts to report error messages through `cargo::error`

Adds the `cargo::error` build script directive. It is similar to `cargo::warning`, but it emits an error message and it also fails the build.

This is a repost of #14435 with the tests updated, a note added to the documentation about using this in a library, and updating the MSRV.

Closes #10159
2024-10-29 16:36:58 +00:00
bors
92f94a54ac Auto merge of #14742 - epage:publish, r=ehuss
fix(publish): Downgrade version-exists error to warning on dry-run

### What does this PR try to resolve?

Especially for beta, this was the most conservative, minimal change.

Fixes #14721

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

### Additional information

This will get cherry-picked to beta
2024-10-29 16:04:22 +00:00
Ed Page
947e1ffe3f fix(publish): Downgrade version-exists error to warning on dry-run
This will get cherry-picked to beta

Fixes #14721
2024-10-29 10:21:52 -05:00
Ed Page
ae6b279277 test(publish): Verify version-exists error in dry-run 2024-10-29 10:14:22 -05:00
Eric Huss
9ce30a6ca3 Update tests to resolve recent changes
Upstream changed these messages slightly.
2024-10-29 08:12:43 -07:00
Tor Hovland
032bc29bb8 feat: cargo::error build script directive. 2024-10-29 08:02:55 -07:00
Tor Hovland
3fade07a0b test: cargo::error build script directive. 2024-10-29 08:02:55 -07:00
Tor Hovland
3e59d08f9d test: Update to snapshot style. 2024-10-29 08:02:54 -07:00
Weihang Lo
886e55b572
fix: make deprecated cmds more obvious in help and --list 2024-10-28 14:19:22 -04:00
MoskalykA
7a517af7ea Deprecate cargo verify-project 2024-10-28 01:30:18 +01:00
bors
28274d0a51 Auto merge of #14724 - epage:resolver, r=weihanglo
test(install): Verify 2024 edition / resolver=3 doesn't affect resolution

### What does this PR try to resolve?

I was worried there might be bugs related to this.  With this out of the way, I think we'll be ready to stabilize `resolver = "3"`.

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

### Additional information
2024-10-25 13:41:40 +00:00
bors
8315873f5a Auto merge of #14701 - linyihai:trace-env-table, r=weihanglo
Fix: trace `config` `[env]` table in dep-info.

### What does this PR try to resolve?

The `env` defined in `config.toml` or `--config env`  are stripped before recording in the dep-info file.  The absence of the env table doesn't rebuild when env changed

By tracing the `env` table into the `dep-info` file, If the envs changed then the rebuild can be triggered.

Fixes #13280

### How should we test and review this PR?
One commit add the test, the latter commit update the test through the fixes.

### Additional information
The PR only fixed the `env` table changes can't trigger a rebuild, other `CARGO-like` envs
 doesn't take into account.
2024-10-25 04:05:40 +00:00
Lin Yihai
668d82e3f0 fix: trace [env] config table into fingerprint. 2024-10-25 11:21:52 +08:00
Lin Yihai
02d2c77d87 test: add test to describe the issue#13280
Cargo fails to detect environment variable is newly set and rebuild if the environment variable is set in `config.toml`
2024-10-25 11:01:31 +08:00
todd
11f84a964c fix: use Registry::describe_source to fix error message and related test cases
`Registry::describe_source` will be used as default error message, but if the message
come from `Registry::describe_source` is empty, then it uses `SourceId` message
2024-10-25 00:35:30 +08:00
Ed Page
487bbc813f test(install): Verify edition=2024 is ignored 2024-10-23 15:15:02 -05:00
Ed Page
49f096edaf test(install): Verify resolver=3 is ignored 2024-10-23 15:14:08 -05:00
todd
c84799257f test: add test case to check replace-with error message
The test is used to duplicate #14697
2024-10-23 20:30:12 +08:00
Ed Page
5b84fc99c5 feat(test): Snapshot .crate validation 2024-10-17 06:26:47 +08:00
Arlo Siemsen
8db2192bba fix: block_until_ready can return early when there is still pending work 2024-10-15 12:58:38 -05:00
Arlo Siemsen
b0b6b16278 add test to show existing behavior of block_until_ready 2024-10-15 12:58:38 -05:00