feat(mise): support Rust idiomatic version files (#676)

* feat(mise): support rust-toolchain.toml idiomatic version file

Generated-by: aiautocommit

* docs(rust): update rust-toolchain.toml support and resolution order

Generated-by: aiautocommit

* feat(generate): add rust support to mise toolchain settings and build plan

Generated-by: aiautocommit
This commit is contained in:
Michael Bianco
2026-08-02 06:58:58 -06:00
committed by GitHub
parent 565a802012
commit 9f75d7542a
6 changed files with 14 additions and 5 deletions
@@ -43,6 +43,10 @@
{
"path": "/mise/shims"
},
{
"dest": "rust-toolchain.toml",
"src": "rust-toolchain.toml"
},
{
"customName": "create mise config",
"name": "generated-mise-toml",
@@ -22,7 +22,7 @@
"steps": [
{
"assets": {
"generated-mise-toml": "[tools]\n go = \"1.23.5\"\n node = \"20.18.2\"\n python = \"3.13.1\"\n\n[settings]\n idiomatic_version_file_enable_tools = [\"python\", \"node\", \"ruby\", \"elixir\", \"go\", \"java\", \"yarn\", \"bun\", \"deno\", \"dotnet\"]\n minimum_release_age = \"14d\"\n paranoid = true\n trusted_config_paths = [\"/app\"]\n [settings.node]\n verify = false\n"
"generated-mise-toml": "[tools]\n go = \"1.23.5\"\n node = \"20.18.2\"\n python = \"3.13.1\"\n\n[settings]\n idiomatic_version_file_enable_tools = [\"python\", \"node\", \"ruby\", \"elixir\", \"go\", \"java\", \"yarn\", \"bun\", \"deno\", \"dotnet\", \"rust\"]\n minimum_release_age = \"14d\"\n paranoid = true\n trusted_config_paths = [\"/app\"]\n [settings.node]\n verify = false\n"
},
"commands": [
{
+1
View File
@@ -364,6 +364,7 @@ var miseIdiomaticFiles = []string{
".sdkmanrc",
".exenv-version",
".deno-version",
"rust-toolchain.toml",
// .bun-version is a community convention, not officially supported by Bun
".bun-version",
".yvmrc",
+1 -1
View File
@@ -21,7 +21,7 @@ import (
const (
InstallDir = "/tmp/railpack/mise"
TestInstallDir = "/tmp/railpack/mise-test"
IdiomaticVersionFileTools = "python,node,ruby,elixir,go,java,yarn,bun,deno,dotnet"
IdiomaticVersionFileTools = "python,node,ruby,elixir,go,java,yarn,bun,deno,dotnet,rust"
// applied only to the first GetLatestVersion check to skip very recent releases
MinimumReleaseAge = "14d"
)
+2 -1
View File
@@ -48,7 +48,8 @@ into the build. This includes:
`.config/mise/conf.d/*.toml`
- **Idiomatic version files**: `.ruby-version`, `.python-version`,
`.python-versions`, `.node-version`, `.nvmrc`, `.go-version`,
`.java-version`, `.sdkmanrc`, `.bun-version`, `.yvmrc`, `global.json`
`.java-version`, `.sdkmanrc`, `.deno-version`, `rust-toolchain.toml`,
`.bun-version`, `.yvmrc`, `global.json`
- **Lock files**: `mise.lock` files co-located with any detected
`*.toml` config
+5 -2
View File
@@ -16,13 +16,16 @@ Your project will be detected as a Rust application if any of these conditions a
The Rust version is determined in the following order:
- Any mise-supported version file (`mise.toml`, `.tool-versions`, etc).
- Read from the `toolchain.channel` field in the `rust-toolchain.toml` file
- Read from the `package.rust-version` field in the `Cargo.toml` file
- Read from the `.rust-version` or `rust-version.txt` file
- Set via the `RAILPACK_RUST_VERSION` environment variable
- Set via the `package.edition` field in the `Cargo.toml` file
- Defaults to `1.89`
Mise treats `rust-toolchain.toml` as an idiomatic version file. Its
`toolchain.channel` field selects the Rust version, while `profile`,
`components`, and `targets` are passed to rustup as installation options.
## Runtime Variables
These variables are available at runtime:
@@ -53,4 +56,4 @@ The start command is:
## BuildKit Caching
The Rust provider will cache `~/.cargo/registry` under the key `cargo_registry`, `~/.cargo/git` under `cargo_git`, and `target` under `cargo_target`.
The Rust provider will cache `~/.cargo/registry` under the key `cargo_registry`, `~/.cargo/git` under `cargo_git`, and `target` under `cargo_target`.