Skip to content

Fixes to rust-toolchain.toml handling #1225

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
merged 3 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/internal-testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
~/.rustup/toolchains
~/.rustup/update-hashes
~/.rustup/settings.toml
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain') }}
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('**/*rust-toolchain.toml') }}

- name: Cache Rust artifacts
uses: actions/cache@v4
Expand Down
3 changes: 2 additions & 1 deletion analysis/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.bc
rust-toolchain
# Sometimes generated by c2rust
rust-toolchain.toml

instrument.out.log
instrument.err.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "nightly-2022-08-08"
components = ["rustfmt"]
2 changes: 1 addition & 1 deletion c2rust-transpile/src/build_files/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ fn emit_lib_rs(
/// on a nightly toolchain until the `c_variadics` feature is stable.
fn emit_rust_toolchain(tcfg: &TranspilerConfig, build_dir: &Path) {
let output_path = build_dir.join("rust-toolchain.toml");
let output = include_str!("../../rust-toolchain.toml").to_string();
let output = include_str!("generated-rust-toolchain.toml").to_string();
maybe_write_to_file(&output_path, output, tcfg.overwrite_existing);
}

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2022-08-08"
components = ["rustfmt-preview", "rustc-dev", "rust-src", "miri", "rust-analyzer"]
components = ["rustfmt", "rustc-dev", "rust-src", "miri", "rust-analyzer"]
2 changes: 1 addition & 1 deletion tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ c2rust-lib.rs
!build.rs

# sometimes generated by `c2rust`
rust-toolchain
rust-toolchain.toml

# sometimes generated by `c2rust`, but only in `src/`
**/src/Cargo.toml
Expand Down
Loading