Skip to content

Commit f2d2c5e

Browse files
Add rust-toolchain.toml (#959)
When I was doing some testing I noticed that if I have a different rust version installed and attempt to rebuild the `stable-mir-json` artefacts that they were error on changed MIR data structures. Adding a `rust-toolchain.toml` means that the correct version will always be active for the repo. ``` daniel@daniel-MS-7E06 mir-semantics$ rustup show active-toolchain -v nightly-2024-11-29-x86_64-unknown-linux-gnu active because: overridden by '/home/daniel/Applications/mir-semantics/rust-toolchain.toml' ``` I also updated the github workflow so that it if `stable-mir-json` is updated it will update the channel to the new one. --------- Co-authored-by: automergerpr-permission-manager[bot] <190534181+automergerpr-permission-manager[bot]@users.noreply.github.com>
1 parent a7c87bc commit f2d2c5e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/update-dependencies.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ jobs:
5050
git checkout "${VERSION}"
5151
cd ../..
5252
sed -i 's!__smir_version__: Final = '"'[0-9a-f]*'"'!__smir_version__: Final = '"'${VERSION}'"'!' kmir/src/kmir/__init__.py
53-
git add deps/stable-mir-json kmir/src/kmir/__init__.py
53+
CHANNEL=$(grep '^channel' deps/stable-mir-json/rust-toolchain.toml | sed 's!channel = "\(.*\)"!\1!')
54+
sed -i 's!^channel = ".*"!channel = "'"${CHANNEL}"'"!' rust-toolchain.toml
55+
git add deps/stable-mir-json kmir/src/kmir/__init__.py rust-toolchain.toml
5456
git commit -m "deps/stable-mir-json: sync submodule ${VERSION}" || true
5557
- name: 'Update Nix flake inputs'
5658
run: |

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "nightly-2024-11-29"
3+
components = ["llvm-tools", "rustc-dev", "rust-src", "rust-analyzer"]

0 commit comments

Comments
 (0)