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 build.rs cfgs using rustversion crate #850

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Feb 8, 2024

In order to test code which is conditionally-compiled on different versions of the Rust toolchain, we previously relied on the same infrastructure as the runtime code - --cfg arguments emitted by our build.rs file. This, however, is using a feature to test itself. In this change, we switch to using the rustversion crate so that bugs in build.rs can't hide themselves by silently disabling the relevant tests.

@joshlf joshlf requested a review from jswrenn February 8, 2024 16:54
@joshlf joshlf enabled auto-merge February 8, 2024 16:55
Copy link
Collaborator

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever!

In order to test code which is conditionally-compiled on different versions of the Rust toolchain, we previously relied on the same infrastructure as the runtime code - `--cfg` arguments emitted by our `build.rs` file. This, however, is using a feature to test itself. In this change, we switch to using the `rustversion` crate so that bugs in `build.rs` can't hide themselves by silently disabling the relevant tests.
auto-merge was automatically disabled March 3, 2024 17:27

Merge queue setting changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants