-
Notifications
You must be signed in to change notification settings - Fork 291
transpile: remove ~ in Cargo.toml.hbs causing trailing whitespace to be removed
#1419
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
Merged
kkysen
merged 1 commit into
master
from
kkysen/fix-stripped-whitespace-in-generated-Cargo.toml
Oct 23, 2025
Merged
transpile: remove ~ in Cargo.toml.hbs causing trailing whitespace to be removed
#1419
kkysen
merged 1 commit into
master
from
kkysen/fix-stripped-whitespace-in-generated-Cargo.toml
Oct 23, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kkysen
added a commit
that referenced
this pull request
Oct 20, 2025
…t 1.65 Our workspace `Cargo.toml` uses workspace inheritance, which was stabilized in Rust 1.64, so is fine with our pinned nightly of Rust 1.65. But `c2rust-refactor` was using `cargo v0.62` (corresponding to Rust 1.62), so when `c2rust-refactor` was run on a `Cargo.toml` that referenced `c2rust-bitfields` with a relative path to our repo, it broke on this (which #1419 and #1420 fix/enable). Thus, we need to update to at least `cargo v0.64`, and preferably `v0.65`. `cargo v0.65` depends on `toml_edit v0.14.3`, which depends on `kstring v2.0.0`. By default, `kstring v2.0.1` is selected (since Rust 1.65 doesn't support the MSRV-aware resolver), but it has an MSRV of Rust 1.73, too new. Luckily, though, `kstring v2.0.0` has an MSRV of Rust 1.59, so we pin it.
kkysen
added a commit
that referenced
this pull request
Oct 20, 2025
…t 1.65 Our workspace `Cargo.toml` uses workspace inheritance, which was stabilized in Rust 1.64, so is fine with our pinned nightly of Rust 1.65. But `c2rust-refactor` was using `cargo v0.62` (corresponding to Rust 1.62), so when `c2rust-refactor` was run on a `Cargo.toml` that referenced `c2rust-bitfields` with a relative path to our repo, it broke on this (which #1419 and #1420 fix/enable). Thus, we need to update to at least `cargo v0.64`, and preferably `v0.65`. `cargo v0.65` depends on `toml_edit v0.14.3`, which depends on `kstring v2.0.0`. By default, `kstring v2.0.1` is selected (since Rust 1.65 doesn't support the MSRV-aware resolver), but it has an MSRV of Rust 1.73, too new. Luckily, though, `kstring v2.0.0` has an MSRV of Rust 1.59, so we pin it. `cargo-util` is then also updated to match `cargo v0.65`'s dependency.
kkysen
added a commit
that referenced
this pull request
Oct 20, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry `c2rust-bitfields-derive` depends on `syn v2.0`. Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself), this will resolve to `syn v2.0.107`, which requires Rust 1.68, but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly). This is currently breaking CI for the `c2rust-instrument` tests, and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix). Furthermore, the old git-based registry fetching is extremely slow in CI, so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry. Due to stable crates now building on stable but testing their output on nightly, it is very difficult to correctly cache. Updating the nightly of their output to the earliest to have the sparse registry should fix this. The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`: ```sh cargo build --release (cd ../c2rust-testsuite/tests/libxml2/repo/ && $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions )
kkysen
added a commit
that referenced
this pull request
Oct 20, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry `c2rust-bitfields-derive` depends on `syn v2.0`. Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself), this will resolve to `syn v2.0.107`, which requires Rust 1.68, but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly). This is currently breaking CI for the `c2rust-instrument` tests, and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix). Furthermore, the old git-based registry fetching is extremely slow in CI, so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry. Due to stable crates now building on stable but testing their output on nightly, it is very difficult to correctly cache. Updating the nightly of their output to the earliest to have the sparse registry should fix this. The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`: ```sh cargo build --release (cd ../c2rust-testsuite/tests/libxml2/repo/ && $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions )
kkysen
added a commit
that referenced
this pull request
Oct 20, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry `c2rust-bitfields-derive` depends on `syn v2.0`. Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself), this will resolve to `syn v2.0.107`, which requires Rust 1.68, but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly). This is currently breaking CI for the `c2rust-instrument` tests, and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix). Furthermore, the old git-based registry fetching is extremely slow in CI, so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry. Due to stable crates now building on stable but testing their output on nightly, it is very difficult to correctly cache. Updating the nightly of their output to the earliest to have the sparse registry should fix this. The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`: ```sh cargo build --release (cd ../c2rust-testsuite/tests/libxml2/repo/ && $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions ) ```
8380b74 to
0da8fb7
Compare
ahomescu
reviewed
Oct 21, 2025
kkysen
added a commit
that referenced
this pull request
Oct 23, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry `c2rust-bitfields-derive` depends on `syn v2.0`. Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself), this will resolve to `syn v2.0.107`, which requires Rust 1.68, but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly). This is currently breaking CI for the `c2rust-instrument` tests, and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix). Furthermore, the old git-based registry fetching is extremely slow in CI, so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry. Due to stable crates now building on stable but testing their output on nightly, it is very difficult to correctly cache. Updating the nightly of their output to the earliest to have the sparse registry should fix this. The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`: ```sh cargo build --release (cd ../c2rust-testsuite/tests/libxml2/repo/ && $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions ) ```
34a4213 to
ad39c04
Compare
0da8fb7 to
844fa4e
Compare
ahomescu
approved these changes
Oct 23, 2025
kkysen
added a commit
that referenced
this pull request
Oct 23, 2025
…t 1.65 Our workspace `Cargo.toml` uses workspace inheritance, which was stabilized in Rust 1.64, so is fine with our pinned nightly of Rust 1.65. But `c2rust-refactor` was using `cargo v0.62` (corresponding to Rust 1.62), so when `c2rust-refactor` was run on a `Cargo.toml` that referenced `c2rust-bitfields` with a relative path to our repo, it broke on this (which #1419 and #1420 fix/enable). Thus, we need to update to at least `cargo v0.64`, and preferably `v0.65`. `cargo v0.65` depends on `toml_edit v0.14.3`, which depends on `kstring v2.0.0`. By default, `kstring v2.0.1` is selected (since Rust 1.65 doesn't support the MSRV-aware resolver), but it has an MSRV of Rust 1.73, too new. Luckily, though, `kstring v2.0.0` has an MSRV of Rust 1.59, so we pin it. `cargo-util` is then also updated to match `cargo v0.65`'s dependency.
844fa4e to
a33d486
Compare
kkysen
added a commit
that referenced
this pull request
Oct 23, 2025
…t 1.65 Our workspace `Cargo.toml` uses workspace inheritance, which was stabilized in Rust 1.64, so is fine with our pinned nightly of Rust 1.65. But `c2rust-refactor` was using `cargo v0.62` (corresponding to Rust 1.62), so when `c2rust-refactor` was run on a `Cargo.toml` that referenced `c2rust-bitfields` with a relative path to our repo, it broke on this (which #1419 and #1420 fix/enable). Thus, we need to update to at least `cargo v0.64`, and preferably `v0.65`. `cargo v0.65` depends on `toml_edit v0.14.3`, which depends on `kstring v2.0.0`. By default, `kstring v2.0.1` is selected (since Rust 1.65 doesn't support the MSRV-aware resolver), but it has an MSRV of Rust 1.73, too new. Luckily, though, `kstring v2.0.0` has an MSRV of Rust 1.59, so we pin it. `cargo-util` is then also updated to match `cargo v0.65`'s dependency.
420523f to
236bc08
Compare
a33d486 to
424a034
Compare
kkysen
added a commit
that referenced
this pull request
Oct 23, 2025
…t 1.65 Our workspace `Cargo.toml` uses workspace inheritance, which was stabilized in Rust 1.64, so is fine with our pinned nightly of Rust 1.65. But `c2rust-refactor` was using `cargo v0.62` (corresponding to Rust 1.62), so when `c2rust-refactor` was run on a `Cargo.toml` that referenced `c2rust-bitfields` with a relative path to our repo, it broke on this (which #1419 and #1420 fix/enable). Thus, we need to update to at least `cargo v0.64`, and preferably `v0.65`. `cargo v0.65` depends on `toml_edit v0.14.3`, which depends on `kstring v2.0.0`. By default, `kstring v2.0.1` is selected (since Rust 1.65 doesn't support the MSRV-aware resolver), but it has an MSRV of Rust 1.73, too new. Luckily, though, `kstring v2.0.0` has an MSRV of Rust 1.59, so we pin it. `cargo-util` is then also updated to match `cargo v0.65`'s dependency.
236bc08 to
e9b95e6
Compare
424a034 to
4ed2d74
Compare
kkysen
added a commit
that referenced
this pull request
Oct 23, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry (#1422) `c2rust-bitfields-derive` depends on `syn v2.0`. Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself), this will resolve to `syn v2.0.107`, which requires Rust 1.68, but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly). This is currently breaking CI for the `c2rust-instrument` tests, and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix). Furthermore, the old git-based registry fetching is extremely slow in CI, so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry. Due to stable crates now building on stable but testing their output on nightly, it is very difficult to correctly cache. Updating the nightly of their output to the earliest to have the sparse registry should fix this. The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`: ```sh cargo build --release (cd ../c2rust-testsuite/tests/libxml2/repo/ && $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions ) ```
kkysen
added a commit
that referenced
this pull request
Oct 23, 2025
…t 1.65 (#1421) Our workspace `Cargo.toml` uses workspace inheritance, which was stabilized in Rust 1.64, so is fine with our pinned nightly of Rust 1.65. But `c2rust-refactor` was using `cargo v0.62` (corresponding to Rust 1.62), so when `c2rust-refactor` was run on a `Cargo.toml` that referenced `c2rust-bitfields` with a relative path to our repo, it broke on this (which #1419 and #1420 fix/enable). Thus, we need to update to at least `cargo v0.64`, and preferably `v0.65`. `cargo v0.65` depends on `toml_edit v0.14.3`, which depends on `kstring v2.0.0`. By default, `kstring v2.0.1` is selected (since Rust 1.65 doesn't support the MSRV-aware resolver), but it has an MSRV of Rust 1.73, too new. Luckily, though, `kstring v2.0.0` has an MSRV of Rust 1.59, so we pin it.
kkysen
commented
Oct 23, 2025
Contributor
Author
kkysen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kkysen
added a commit
that referenced
this pull request
Oct 23, 2025
…of c2rust crates are used (#1420) The `transpile.gen.sh`s generated by `c2rust-testsuite` use `C2RUST_DIR` to set dependencies in generated `Cargo.toml`s to point to the current `c2rust` directory, allowing it to test with the current version of `c2rust-bitfields` and `c2rust-asm-casts`. This needs #1419 fixed first, and it should unblock #1408, which depends on the `c2rust-bitfields-derive` fix in #1411.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think this was probably a typo in the
Cargo.toml.hbstemplate. The~means strip trailing whitespace, causing us to emit things likec2rust-bitfields= "0.3"instead ofc2rust-bitfields = "0.3", which is whatc2rust-testsuitematches on:https://github.com/immunant/c2rust-testsuite/blob/5b5a098a39d5431383f46410b838e24321a4cb25/tests/templates.py#L31-L32