Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: adjust cargo_test_env to unblock rust submodule update #14803

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

weihanglo
Copy link
Member

What does this PR try to resolve?

[HOST_TARGET] from $CARGO was not replaced.
See each commit message for the detail.

How should we test and review this PR?

  • Run cargo t --test testsuite -- cargo_test_env
  • Apply the change to rust-lang/rust and run ./x.py test src/tools/cargo -- cargo_test_env.

Additional information

On non-Windows platform the redacted string became something like below,
which was valid but didn't make sense:

```
[EXE]/[EXE]U[EXE]s[EXE]e[EXE]r[EXE]s[EXE]/[EXE]w[EXE]h[EXE]l[EXE]o[EXE]/[EXE]d[EXE]e[EXE]v[EXE]/[EXE]r[EXE]u[EXE]s[EXE]t[EXE]/[EXE]b[EXE]u[EXE]i[EXE]l[EXE]d[EXE]/[EXE]a[EXE]a[EXE]r[EXE]c[EXE]h[EXE]6[EXE]4[EXE]-[EXE]a[EXE]p[EXE]p[EXE]l[EXE]e[EXE]-[EXE]d[EXE]a[EXE]r[EXE]w[EXE]i[EXE]n[EXE]/[EXE]s[EXE]t[EXE]a[EXE]g[EXE]e[EXE]2[EXE]-[EXE]t[EXE]o[EXE]o[EXE]l[EXE]s[EXE]/[EXE]a[EXE]a[EXE]r[EXE]c[EXE]h[EXE]6[EXE]4[EXE]-[EXE]a[EXE]p[EXE]p[EXE]l[EXE]e[EXE]-[EXE]d[EXE]a[EXE]r[EXE]w[EXE]i[EXE]n[EXE]/[EXE]r[EXE]e[EXE]l[EXE]e[EXE]a[EXE]s[EXE]e[EXE]/[EXE]c[EXE]a[EXE]r[EXE]g[EXE]o[EXE]
```

Here we simply remove the extension and append `[EXE]` at the end.
@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 9, 2024
This was found when updating git submodule in rust-lang/rust

```
---- test::cargo_test_env stdout ----
running `/Users/weihanglo/dev/rust/build/aarch64-apple-darwin/stage2-tools/aarch64-apple-darwin/release/cargo test --lib -- --nocapture`
thread 'test::cargo_test_env' panicked at tests/testsuite/test.rs:3904:10:

test failed running `/Users/weihanglo/dev/rust/build/aarch64-apple-darwin/stage2-tools/aarch64-apple-darwin/release/cargo test --lib -- --nocapture`
error: expected to find:
/Users/weihanglo/dev/rust/build/aarch64-apple-darwin/stage2-tools/aarch64-apple-darwin/release/cargo

did not find in output:
[COMPILING] foo v0.5.0 ([ROOT]/foo)
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[RUNNING] unittests src/lib.rs (target/debug/deps/foo-[HASH])
/Users/weihanglo/dev/rust/build/[HOST_TARGET]/stage2-tools/[HOST_TARGET]/release/cargo
```
@weihanglo
Copy link
Member Author

This is ready for another round of review. I've removed the switch to with_stderr_data as it caused churn of path normalization and may worth exploring separately.

@epage epage added this pull request to the merge queue Nov 9, 2024
Merged via the queue into rust-lang:master with commit 4a2d8dc Nov 9, 2024
20 checks passed
@weihanglo weihanglo deleted the test branch November 9, 2024 19:42
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 10, 2024
Update cargo

16 commits in 0310497822a7a673a330a5dd068b7aaa579a265e..4a2d8dc636445b276288543882e076f254b3ae95
2024-11-01 19:27:56 +0000 to 2024-11-09 19:10:33 +0000
- test: adjust `cargo_test_env` to unblock rust submodule update (rust-lang/cargo#14803)
- feat(warnings): add build.warnings option (rust-lang/cargo#14388)
- Revert "feat: Add `CARGO_RUSTC_CURRENT_DIR`" (rust-lang/cargo#14799)
- CI: make the `lint-docs` job required (rust-lang/cargo#14797)
- Switch CI from bors to merge queue (rust-lang/cargo#14718)
- docs(test):  Document Execs assertions based on port effort (rust-lang/cargo#14793)
- fix(test): Make redactions consistent with snapbox (rust-lang/cargo#14790)
- test(gc): Update remaining unordered tests to snapbox (rust-lang/cargo#14785)
- Normalize the `target` paths (rust-lang/cargo#14497)
- rustfix: replace special-case duplicate handling with error (rust-lang/cargo#14782)
- test: Update some emaining unordered tests to snapbox (rust-lang/cargo#14781)
- Change config paths to only check CARGO_HOME for cargo-script (rust-lang/cargo#14749)
- Enable transfer feature in triagebot (rust-lang/cargo#14777)
- Add transactional semantics to `rustfix` (rust-lang/cargo#14747)
- doc: fix `GlobalContext` reference (rust-lang/cargo#14773)
- chore: update handlebars to v6, fix build error (rust-lang/cargo#14772)
@rustbot rustbot added this to the 1.84.0 milestone Nov 10, 2024
mati865 pushed a commit to mati865/rust that referenced this pull request Nov 12, 2024
Update cargo

16 commits in 0310497822a7a673a330a5dd068b7aaa579a265e..4a2d8dc636445b276288543882e076f254b3ae95
2024-11-01 19:27:56 +0000 to 2024-11-09 19:10:33 +0000
- test: adjust `cargo_test_env` to unblock rust submodule update (rust-lang/cargo#14803)
- feat(warnings): add build.warnings option (rust-lang/cargo#14388)
- Revert "feat: Add `CARGO_RUSTC_CURRENT_DIR`" (rust-lang/cargo#14799)
- CI: make the `lint-docs` job required (rust-lang/cargo#14797)
- Switch CI from bors to merge queue (rust-lang/cargo#14718)
- docs(test):  Document Execs assertions based on port effort (rust-lang/cargo#14793)
- fix(test): Make redactions consistent with snapbox (rust-lang/cargo#14790)
- test(gc): Update remaining unordered tests to snapbox (rust-lang/cargo#14785)
- Normalize the `target` paths (rust-lang/cargo#14497)
- rustfix: replace special-case duplicate handling with error (rust-lang/cargo#14782)
- test: Update some emaining unordered tests to snapbox (rust-lang/cargo#14781)
- Change config paths to only check CARGO_HOME for cargo-script (rust-lang/cargo#14749)
- Enable transfer feature in triagebot (rust-lang/cargo#14777)
- Add transactional semantics to `rustfix` (rust-lang/cargo#14747)
- doc: fix `GlobalContext` reference (rust-lang/cargo#14773)
- chore: update handlebars to v6, fix build error (rust-lang/cargo#14772)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants