mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
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:
@@ -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": [
|
||||
{
|
||||
|
||||
@@ -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
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user