Skip to content

Commit e5d5712

Browse files
authored
let's use mise and nushell (#90)
1 parent a159452 commit e5d5712

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

etc/rust/ensure-miri.nu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
let components = (rustup component list --toolchain nightly)
3+
if ($components | str contains "miri (installed)" or $components | str contains "miri-x86_64") {
4+
print "Miri is already installed and ready!"
5+
} else {
6+
print "Miri component not found on nightly. Installing..."
7+
rustup component add miri --toolchain nightly
8+
cargo +nightly miri setup
9+
}

etc/rust/ensure-nightly.nu

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 1. Check if the nightly toolchain is installed
2+
let toolchains = (rustup toolchain list)
3+
if ($toolchains | str contains "nightly") {
4+
print "Nightly toolchain is already installed."
5+
} else {
6+
print "Nightly toolchain not found. Installing..."
7+
rustup toolchain install nightly --profile minimal
8+
}

mise.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[tools]
2+
"aqua:nushell/nushell" = "0.101.0"
3+
4+
[tasks.install-tools]
5+
hide = true
6+
run = "mise install"
7+
8+
[tasks.init]
9+
description = "Initialize env for oscars development"
10+
depends = ["install-tools", "miri:setup"]
11+
12+
[tasks."cargo:nightly"]
13+
description = "Check and install nightly toolchain"
14+
run = "nu {{config_root}}/etc/rust/ensure-nightly.nu"
15+
16+
[tasks."miri:setup"]
17+
depends = ["cargo:nightly"]
18+
description = "Check and install Miri if missing"
19+
run = "nu {{config_root}}/etc/rust/ensure-miri.nu"
20+
21+
[tasks."test"]
22+
description = "Run tests with Miri"
23+
depends = ["miri:setup"]
24+
run = "cargo +nightly miri test"

0 commit comments

Comments
 (0)