mise icon indicating copy to clipboard operation
mise copied to clipboard

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

Open sgtsquiggs opened this issue 1 year ago • 2 comments

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:
  [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], node@lts-hydrogen, pnpm@8, buf@latest, java@corretto-17, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], direnv@latest, yq@latest, pipx@latest

No problems found

Additional context Add any other context about the problem here.

sgtsquiggs avatar Jan 05 '24 16:01 sgtsquiggs

yep, definitely a bug

jdx avatar Jan 05 '24 19:01 jdx

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

jdx avatar Jan 05 '24 19:01 jdx

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?

sgtsquiggs avatar Jan 06 '24 20:01 sgtsquiggs

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

jdx avatar Jan 06 '24 21:01 jdx