Skip to content

Put the core unit tests in a separate coretests package#135937

Merged
bors merged 4 commits intorust-lang:masterfrom
bjorn3:separate_coretests_crate
Jan 27, 2025
Merged

Put the core unit tests in a separate coretests package#135937
bors merged 4 commits intorust-lang:masterfrom
bjorn3:separate_coretests_crate

Conversation

@bjorn3
Copy link
Copy Markdown
Member

@bjorn3 bjorn3 commented Jan 23, 2025

Having standard library tests in the same package as a standard library crate has bad side effects. It causes the test to have a dependency on a locally built standard library crate, while also indirectly depending on it through libtest. Currently this works out fine in the context of rust's build system as both copies are identical, but for example in cg_clif's tests I've found it basically impossible to compile both copies with the exact same compiler flags and thus the two copies would cause lang item conflicts.

This PR moves the tests of libcore to a separate package which doesn't depend on libcore, thus preventing the duplicate crates even when compiler flags don't exactly match between building the sysroot (for libtest) and building the test itself. The rest of the standard library crates do still have this issue however.

Loading
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 I-libs-nominated Nominated for discussion during a libs team meeting. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants