jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
9.59k stars 270 forks source link

`.tool-versions` has priority over `.rtx.toml` in mise, but the opposite was true with rtx #1376

Closed sgtsquiggs closed 9 months ago

sgtsquiggs commented 9 months ago

Describe the bug In rtx, .rtx.toml had priority over .tool-versions files.

In mise, .tool-versions seems to have priority.

To Reproduce Have .rtx.toml file:

[tools]
sqlc = "1.21.0"

Have .tool-versions file:

sqlc 1.20.0

Expected behavior which sqlc should point to 1.21.0

mise doctor output

mise version:
  2024.1.6 macos-arm64 (6adb088 2024-01-04)

build:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Thu, 4 Jan 2024 22:57:40 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21)
  Profile: release

shell:
  /opt/homebrew/bin/fish
  fish, version 3.6.1

mise data directory:
  /Users/mcrenshaw/.local/share/mise

mise environment variables:
  MISE_SHELL=fish

settings:
  {
    "experimental": true,
    "color": true,
    "always_keep_download": false,
    "always_keep_install": false,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "plugin_autoupdate_last_check_duration": "7d",
    "trusted_config_paths": [],
    "log_level": "info",
    "trace": false,
    "debug": false,
    "verbose": false,
    "quiet": false,
    "asdf_compat": false,
    "jobs": 4,
    "shorthands_file": null,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "raw": false,
    "yes": false,
    "task_output": null,
    "not_found_auto_install": true,
    "ci": false,
    "env_file": null,
    "cd": null
  }

config files:
  /Users/mcrenshaw/.config/mise/config.toml
  /Users/mcrenshaw/fleet/src/daedalus/.rtx.toml
  /Users/mcrenshaw/fleet/src/daedalus/.tool-versions

plugins:
  buf             https://github.com/truepay/asdf-buf.git#6c27312
  bun             (core)
  deno            (core)
  direnv          https://github.com/asdf-community/asdf-direnv.git#a2219c2
  erlang          (core)
  go              (core)
  golangci-lint   https://github.com/hypnoglow/asdf-golangci-lint.git#e968b13
  java            (core)
  just            https://github.com/olofvndrhr/asdf-just.git#93771e1
  k9s             https://github.com/looztra/asdf-k9s.git#2b3af87
  kubectl         https://github.com/asdf-community/asdf-kubectl.git#cbe6df4
  kubefwd         https://github.com/nklmilojevic/asdf-kubefwd.git#f341a66
  node            (core)
  pipx            https://github.com/yozachar/asdf-pipx.git#81cb547
  pnpm            https://github.com/jonathanmorley/asdf-pnpm.git#305baff
  poetry          https://github.com/rtx-plugins/rtx-poetry.git#916c061
  pre-commit      https://github.com/jonathanmorley/asdf-pre-commit.git#26bfc42
  python          (core)
  ruby            (core)
  rust            https://github.com/code-lever/asdf-rust.git#95acf4f
  sqlc            https://github.com/schmir/asdf-sqlc.git#9ad97b1
  teleport        https://github.com/gozer/asdf-teleport.git#7900506
  tilt            https://github.com/eaceaser/asdf-tilt.git#69eac7b
  yq              https://github.com/sudermanjr/asdf-yq.git#772992f

toolset:
  go@1.21.1, python@3.10.11, just@1.14.0, poetry@1.4.2, sqlc@1.20.0, golangci-lint@1.54.2, node@lts-hydrogen, pnpm@8, buf@latest, java@corretto-17, k9s@0.27.4, kubectl@1.28.1, kubefwd@1.22.4, pre-commit@2.21.0, rust@1.69.0, teleport@11.3.11, tilt@0.33.1, direnv@latest, yq@latest, pipx@latest

No problems found

Additional context Add any other context about the problem here.

jdx commented 9 months ago

yep, definitely a bug

jdx commented 9 months ago

this seems to do the right thing, but mind taking a glance and checking to make sure it looks right to you as well? https://github.com/jdx/mise/pull/1377

sgtsquiggs commented 9 months ago

I haven't touched rust before; it looks like greek to me!

You now have .tool-versions at the top of the filenames list - does that mean it will have priority? That seems wrong.

Maybe needs a unit test?

jdx commented 9 months ago

no the priority is in decreasing order. .tool-versions is the lowest