Skip to content

tests: copy generated-rust-toolchain.toml to test directories#1430

Merged
kkysen merged 2 commits intomasterfrom
kkysen/ci-fix-test_translator-syn-v2
Oct 23, 2025
Merged

tests: copy generated-rust-toolchain.toml to test directories#1430
kkysen merged 2 commits intomasterfrom
kkysen/ci-fix-test_translator-syn-v2

Conversation

@kkysen
Copy link
Contributor

@kkysen kkysen commented Oct 23, 2025

In test_translator.py, we c2rust-transpile *.c files individually, so --emit-build-files doesn't work as intended, since it'd be used per-file and emit in the wrong directory (in src/, not parallel to the Cargo.toml). We could change things to transpile all *.c files at once, but that'd be a more involved change. So we just link generated-rust-toolchain.toml to rust-toolchain.toml.

This should finally fully fix the CI errors due c2rust-bitfields-derive resolving syn v2.0.107, which can't build on our pinned nightly.

In `test_translator.py`, we `c2rust-transpile` `*.c` files individually,
so `--emit-build-files` doesn't work as intended, since it'd be used per-file
and emit in the wrong directory (in `src/`, not parallel to the `Cargo.toml`).
We could change things to transpile all `*.c` files at once,
but that'd be a more involved change.
So we just link `generated-rust-toolchain.toml` to `rust-toolchain.toml`.

This should finally fully fix the CI errors due `c2rust-bitfields-derive`
resolving `syn v2.0.107`, which can't build on our pinned nightly.
@kkysen kkysen requested a review from fw-immunant October 23, 2025 05:11
Copy link
Contributor Author

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

Yay it worked!

Copy link
Contributor

@fw-immunant fw-immunant left a comment

Choose a reason for hiding this comment

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

A couple comments inline. Only the TRANSPILE_CRATE_DIR one is blocking.

It would be nice to clearly document in the README what Rust version transpiled code targets, whether we state it concretely or point to the relevant rust-toolchain.toml.

Base automatically changed from kkysen/update-generated-rust-version to master October 23, 2025 19:19
@kkysen kkysen merged commit a8a1e50 into master Oct 23, 2025
5 checks passed
@kkysen kkysen deleted the kkysen/ci-fix-test_translator-syn-v2 branch October 23, 2025 19:35
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.

3 participants