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

./x test library/core stopped working #137478

Closed
RalfJung opened this issue Feb 23, 2025 · 8 comments · Fixed by #137679
Closed

./x test library/core stopped working #137478

RalfJung opened this issue Feb 23, 2025 · 8 comments · Fixed by #137679
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

RalfJung commented Feb 23, 2025

This is a regression (for library contributors) caused by #135937: running ./x test library/core will no longer actually run most of the tests, it just runs doc tests. It looks like it is doing something, so it is quite easy to miss that it doesn't actually do what I asked it to do.

Cc @rust-lang/libs @bjorn3 @tgross35

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 23, 2025
@ChrisDenton ChrisDenton added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Feb 23, 2025
@jieyouxu jieyouxu added C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 23, 2025
@jieyouxu
Copy link
Member

Oh, this comes back to the iffy Crate step...

@jieyouxu
Copy link
Member

I'll take a look at this.

@jieyouxu jieyouxu self-assigned this Feb 23, 2025
@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 23, 2025
@RalfJung
Copy link
Member Author

Is it? The tests are literally not in library/core any more, they are in library/coretests now. But one has to somehow know that...

@jieyouxu
Copy link
Member

jieyouxu commented Feb 23, 2025

Is it? The tests are literally not in library/core any more, they are in library/coretests now. But one has to somehow know that...

I think what happened is that previously, ./x test library/core is matched against the Crate step via run.crate_or_deps("sysroot") in Crate::make_run, which resolves to a crates=["core"] that will get tested. This included the bits that are in coretests since they were previously in the same crate (which caused issues that motivated moving to coretests).

However, when core tests were moved to coretests, the resolution was handled via run.crate_or_deps("sysroot").crate_or_deps("coretests"), which:

  • Resolves still to crates=["core"] if the path filter is ./x test library/core.
  • Resolves now to crates=["coretests"] if the path filter is ./x test coretests.

On master

$ BOOTSTRAP_TRACING=bootstrap=debug ./x test library/core
Building bootstrap
 [...]
 bootstrap::Build::build
  [...]
     bootstrap::(2) executing actual run
       bootstrap::core::build_steps::test::Crate::make_run
        [...]
        DEBUG bootstrap::core::build_steps::test crates=["core"]
[...]
Testing  {core} (stage1 -> stage2, x86_64-unknown-linux-gnu)
$ BOOTSTRAP_TRACING=bootstrap=debug ./x test coretests
Building bootstrap
 [...]
 bootstrap::Build::build
   [...]
   bootstrap::executing real run
     [...]
     bootstrap::(2) executing actual run
       bootstrap::core::build_steps::test::Crate::make_run
        [...]
        DEBUG bootstrap::core::build_steps::test crates=["coretests"]
         [...]
[...]
Testing  {coretests} (stage1 -> stage2, x86_64-unknown-linux-gnu)

Before moving to coretests

$ BOOTSTRAP_TRACING=bootstrap=debug ./x test library/core
bootstrap::core::build_steps::test::Crate::make_run{}
  DEBUG bootstrap::core::build_steps::test crates=["core"]

@jieyouxu
Copy link
Member

I'll have to think about this a bit. Crate is a iffy step that's doing way too many things at once.

@jieyouxu
Copy link
Member

In a sense, what I'm trying to say that while ./x test library/core only testing library/core seems Technically Correct, it's not ideal because it feels like it should also run coretests...

@bjorn3
Copy link
Member

bjorn3 commented Feb 23, 2025

Once #136642 lands it should work again. The last commit in that PR replaces core with coretests and alloc with alloctests before calling cargo test.

@RalfJung
Copy link
Member Author

Does ./x test core then only execute coretests, or does it still also execute the doctests in libcore?

@jieyouxu jieyouxu removed their assignment Feb 24, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 4, 2025
…ieyouxu,onur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 5, 2025
…ieyouxu,onur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
@bors bors closed this as completed in 4aa61e7 Mar 5, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 5, 2025
Rollup merge of rust-lang#137679 - bjorn3:coretests_improvements, r=jieyouxu,onur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this issue Mar 6, 2025
…nur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang/rust#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang/rust#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Mar 6, 2025
…nur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang/rust#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang/rust#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Mar 10, 2025
…nur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang/rust#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang/rust#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this issue Mar 14, 2025
…ieyouxu,onur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants