Skip to content

Conversation

@kkysen
Copy link
Contributor

@kkysen kkysen commented Oct 19, 2025

The transpile.gen.shs generated by c2rust-testsuite use C2RUST_DIR to set dependencies in generated Cargo.tomls 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.

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
)
```
@kkysen kkysen force-pushed the kkysen/fix-stripped-whitespace-in-generated-Cargo.toml branch from 8380b74 to 0da8fb7 Compare October 20, 2025 21:28
@kkysen kkysen force-pushed the kkysen/ci-c2rust-testsuite-set-C2RUST_DIR branch from a4a4272 to 3bd9afb Compare October 20, 2025 21:28
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
)
```
@kkysen kkysen force-pushed the kkysen/fix-stripped-whitespace-in-generated-Cargo.toml branch from 0da8fb7 to 844fa4e Compare October 23, 2025 05:33
@kkysen kkysen force-pushed the kkysen/ci-c2rust-testsuite-set-C2RUST_DIR branch from 3bd9afb to cc3107d Compare October 23, 2025 05:33
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.
@kkysen kkysen force-pushed the kkysen/fix-stripped-whitespace-in-generated-Cargo.toml branch from 844fa4e to a33d486 Compare October 23, 2025 06:08
@kkysen kkysen force-pushed the kkysen/ci-c2rust-testsuite-set-C2RUST_DIR branch from cc3107d to f35d9d0 Compare October 23, 2025 06:09
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.
@kkysen kkysen force-pushed the kkysen/fix-stripped-whitespace-in-generated-Cargo.toml branch from a33d486 to 424a034 Compare October 23, 2025 07:02
@kkysen kkysen force-pushed the kkysen/ci-c2rust-testsuite-set-C2RUST_DIR branch from f35d9d0 to cb4ec12 Compare October 23, 2025 07:02
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.
@kkysen kkysen force-pushed the kkysen/fix-stripped-whitespace-in-generated-Cargo.toml branch from 424a034 to 4ed2d74 Compare October 23, 2025 19:10
@kkysen kkysen force-pushed the kkysen/ci-c2rust-testsuite-set-C2RUST_DIR branch from cb4ec12 to 02442bb Compare October 23, 2025 19:11
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.
Base automatically changed from kkysen/fix-stripped-whitespace-in-generated-Cargo.toml to master October 23, 2025 19:37
@kkysen kkysen merged commit f046e52 into master Oct 23, 2025
5 checks passed
@kkysen kkysen deleted the kkysen/ci-c2rust-testsuite-set-C2RUST_DIR branch October 23, 2025 19:38
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