Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise global writes to ~/.config/mise/config.toml even if .tool-versions exists #1530

Closed
maciej-szlosarczyk opened this issue Jan 26, 2024 · 5 comments · Fixed by #1534
Closed
Labels
bug Something isn't working

Comments

@maciej-szlosarczyk
Copy link

Describe the bug

I have a tool-version file with some versions defined, but when I try to update it by running mise global elixir@1.16.0 it creates the config toml file.

To Reproduce

% mise -vvvv global elixir@1.16.0
[DEBUG] (1) mise::cli: [src/cli/mod.rs:214] ARGS: /opt/homebrew/bin/mise -vvvv global elixir@1.16.0
[TRACE] (1) mise::config: [src/config/mod.rs:67] Settings: Settings {
    activate_aggressive: false,
    all_compile: false,
    always_keep_download: false,
    always_keep_install: false,
    asdf_compat: false,
    cargo_binstall: true,
    color: true,
    disable_default_shorthands: false,
    disable_tools: {},
    experimental: false,
    jobs: 4,
    legacy_version_file: true,
    legacy_version_file_disable_tools: {},
    node_compile: false,
    not_found_auto_install: true,
    paranoid: false,
    plugin_autoupdate_last_check_duration: "7d",
    python_compile: false,
    python_default_packages_file: Some(
        "/Users/maciej/.default-python-packages",
    ),
    python_patch_url: None,
    python_precompiled_os: None,
    python_patches_directory: None,
    python_precompiled_arch: None,
    python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
    python_venv_auto_create: false,
    raw: false,
    shorthands_file: None,
    task_output: None,
    trusted_config_paths: {},
    quiet: false,
    verbose: true,
    yes: false,
    ci: false,
    cd: None,
    debug: true,
    env_file: None,
    trace: true,
    log_level: "trace",
}
[TRACE] (4) mise::cache: [src/cache.rs:80] reading ~/Library/Caches/mise/elixir/legacy_filenames.msgpack.z
[TRACE] (1) mise::config::config_file::tool_versions: [src/config/config_file/tool_versions.rs:52] parsing tool-versions: /Users/maciej/.tool-versions
[TRACE] (1) mise::file: [src/file.rs:80] cat ~/.tool-versions
[TRACE] (1) mise::config::config_file::tool_versions: [src/config/config_file/tool_versions.rs:74] ToolVersions(~/.tool-versions): python@3.11.5, erlang@26.2.1, elixir@1.15.6, node@18.17.1, ruby@3.2.2, go@1.21.5, gleam@0.30.5, java@temurin-17.0.9+9, kotlin@1.9.10, zig@0.11.0
[DEBUG] (1) mise::config: [src/config/mod.rs:95] Config {
    Config Files: [
        "~/.tool-versions",
    ],
}
mise ~/.config/mise/config.toml elixir@1.16.0
[TRACE] (1) mise::file: [src/file.rs:74] write ~/.config/mise/config.toml

Expected behavior
A clear and concise description of what you expected to happen.

mise doctor output

% mise doctor
mise version:
  2024.1.26 macos-arm64 (2024-01-25)

build:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Thu, 25 Jan 2024 18:30:56 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin22.0)

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

mise environment variables:
  MISE_SHELL=zsh
  MISE_USE_TOML=0

settings:
  {
    "activate_aggressive": false,
    "all_compile": false,
    "always_keep_download": false,
    "always_keep_install": false,
    "asdf_compat": false,
    "cargo_binstall": true,
    "color": true,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "experimental": false,
    "jobs": 4,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "node_compile": false,
    "not_found_auto_install": true,
    "paranoid": false,
    "plugin_autoupdate_last_check_duration": "7d",
    "python_compile": false,
    "python_default_packages_file": "/Users/maciej/.default-python-packages",
    "python_patch_url": null,
    "python_precompiled_os": null,
    "python_patches_directory": null,
    "python_precompiled_arch": null,
    "python_pyenv_repo": "https://github.com/pyenv/pyenv.git",
    "python_venv_auto_create": false,
    "raw": false,
    "shorthands_file": null,
    "task_output": null,
    "trusted_config_paths": [],
    "quiet": false,
    "verbose": false,
    "yes": false,
    "ci": false,
    "cd": null,
    "debug": false,
    "env_file": null,
    "trace": false,
    "log_level": "info"
  }

config files:
  ~/.tool-versions
  ~/.config/mise/config.toml

plugins:
  bun      (core)
  deno     (core)
  elixir   https://github.com/mise-plugins/mise-elixir.git#7b06439
  erlang   https://github.com/asdf-vm/asdf-erlang.git#ef8f04b
  gleam    https://github.com/vic/asdf-gleam.git#b45a651
  go       (core)
  java     (core)
  kotlin   https://github.com/asdf-community/asdf-kotlin.git#909fd5c
  node     (core)
  python   (core)
  ruby     (core)
  zig      https://github.com/cheetah/asdf-zig.git#d88f6db

toolset:
  elixir@1.16.0, python@3.11.5, erlang@26.2.1, node@18.17.1, ruby@3.2.2, go@1.21.5, gleam@0.30.5, java@temurin-17.0.9+9, kotlin@1.9.10, zig@0.11.0

1 problem found:
shims are missing, run mise reshim to create them
@maciej-szlosarczyk maciej-szlosarczyk added the bug Something isn't working label Jan 26, 2024
@jdx
Copy link
Owner

jdx commented Jan 26, 2024

toml is the global config. Set asdf_compat if you want asdf behavior.

@jdx jdx closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
@maciej-szlosarczyk
Copy link
Author

I get exactly the same result with MISE_ASDF_COMPAT=1:

% mise -vvvv global elixir@1.16.0
[DEBUG] (1) mise::cli: [src/cli/mod.rs:214] ARGS: /opt/homebrew/bin/mise -vvvv global elixir@1.16.0
[TRACE] (1) mise::config: [src/config/mod.rs:67] Settings: Settings {
    activate_aggressive: false,
    all_compile: false,
    always_keep_download: false,
    always_keep_install: false,
    asdf_compat: true,
    cargo_binstall: true,
    color: true,
    disable_default_shorthands: false,
    disable_tools: {},
    experimental: false,
    jobs: 4,
    legacy_version_file: true,
    legacy_version_file_disable_tools: {},
    node_compile: false,
    not_found_auto_install: true,
    paranoid: false,
    plugin_autoupdate_last_check_duration: "7d",
    python_compile: false,
    python_default_packages_file: Some(
        "/Users/maciej/.default-python-packages",
    ),
    python_patch_url: None,
    python_precompiled_os: None,
    python_patches_directory: None,
    python_precompiled_arch: None,
    python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
    python_venv_auto_create: false,
    raw: false,
    shorthands_file: None,
    task_output: None,
    trusted_config_paths: {},
    quiet: false,
    verbose: true,
    yes: false,
    ci: false,
    cd: None,
    debug: true,
    env_file: None,
    trace: true,
    log_level: "trace",
}
[TRACE] (7) mise::cache: [src/cache.rs:80] reading ~/Library/Caches/mise/elixir/legacy_filenames.msgpack.z
[TRACE] (1) mise::config::config_file::tool_versions: [src/config/config_file/tool_versions.rs:52] parsing tool-versions: /Users/maciej/.tool-versions
[TRACE] (1) mise::file: [src/file.rs:80] cat ~/.tool-versions
[TRACE] (1) mise::config::config_file::tool_versions: [src/config/config_file/tool_versions.rs:74] ToolVersions(~/.tool-versions): python@3.11.5, erlang@26.2.1, elixir@1.15.6, node@18.17.1, ruby@3.2.2, go@1.21.5, gleam@0.30.5, java@temurin-17.0.9+9, kotlin@1.9.10, zig@0.11.0
[DEBUG] (1) mise::config: [src/config/mod.rs:95] Config {
    Config Files: [
        "~/.tool-versions",
    ],
}
mise ~/.config/mise/config.toml elixir@1.16.0
[TRACE] (1) mise::file: [src/file.rs:74] write ~/.config/mise/config.toml
% mise doctor
mise version:
  2024.1.26 macos-arm64 (2024-01-25)

build:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Thu, 25 Jan 2024 18:30:56 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin22.0)

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

mise environment variables:
  MISE_SHELL=zsh
  MISE_USE_TOML=0
  MISE_ASDF_COMPAT=1

settings:
  {
    "activate_aggressive": false,
    "all_compile": false,
    "always_keep_download": false,
    "always_keep_install": false,
    "asdf_compat": true,
    "cargo_binstall": true,
    "color": true,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "experimental": false,
    "jobs": 4,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "node_compile": false,
    "not_found_auto_install": true,
    "paranoid": false,
    "plugin_autoupdate_last_check_duration": "7d",
    "python_compile": false,
    "python_default_packages_file": "/Users/maciej/.default-python-packages",
    "python_patch_url": null,
    "python_precompiled_os": null,
    "python_patches_directory": null,
    "python_precompiled_arch": null,
    "python_pyenv_repo": "https://github.com/pyenv/pyenv.git",
    "python_venv_auto_create": false,
    "raw": false,
    "shorthands_file": null,
    "task_output": null,
    "trusted_config_paths": [],
    "quiet": false,
    "verbose": false,
    "yes": false,
    "ci": false,
    "cd": null,
    "debug": false,
    "env_file": null,
    "trace": false,
    "log_level": "info"
  }

config files:
  ~/.tool-versions
  ~/.config/mise/config.toml

plugins:
  bun      (core)
  deno     (core)
  elixir   https://github.com/mise-plugins/mise-elixir.git#7b06439
  erlang   https://github.com/asdf-vm/asdf-erlang.git#ef8f04b
  gleam    https://github.com/vic/asdf-gleam.git#b45a651
  go       (core)
  java     (core)
  kotlin   https://github.com/asdf-community/asdf-kotlin.git#909fd5c
  node     (core)
  python   (core)
  ruby     (core)
  zig      https://github.com/cheetah/asdf-zig.git#d88f6db

toolset:
  elixir@1.16.0, python@3.11.5, erlang@26.2.1, node@18.17.1, ruby@3.2.2, go@1.21.5, gleam@0.30.5, java@temurin-17.0.9+9, kotlin@1.9.10, zig@0.11.0

1 problem found:
shims are missing, run mise reshim to create them
```

@jdx
Copy link
Owner

jdx commented Jan 26, 2024

Sorry, set MISE_GLOBAL_CONFIG_FILE

@maciej-szlosarczyk
Copy link
Author

Unfortunately none of this works. When I set MISE_GLOBAL_CONFIG_FILE to point to my .tool-versions, it tries to parse it as a toml file. So then I also use MISE_USE_TOML=0, and that also doesn't work:

% mise doctor
Error loading settings file: TOML parse error at line 1, column 8
  |
1 | python 3.11.5
  |        ^
expected `.`, `=`

mise version:
  2024.1.26 macos-arm64 (2024-01-25)

build:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Thu, 25 Jan 2024 18:30:56 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin22.0)

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

mise environment variables:
  MISE_SHELL=zsh
  MISE_ASDF_COMPAT=1
  MISE_USE_TOML=0
  MISE_GLOBAL_CONFIG_FILE=/Users/maciej/.tool-versions

settings:
  {
    "activate_aggressive": false,
    "all_compile": false,
    "always_keep_download": false,
    "always_keep_install": false,
    "asdf_compat": true,
    "cargo_binstall": true,
    "color": true,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "experimental": false,
    "jobs": 4,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "node_compile": false,
    "not_found_auto_install": true,
    "paranoid": false,
    "plugin_autoupdate_last_check_duration": "7d",
    "python_compile": false,
    "python_default_packages_file": "/Users/maciej/.default-python-packages",
    "python_patch_url": null,
    "python_precompiled_os": null,
    "python_patches_directory": null,
    "python_precompiled_arch": null,
    "python_pyenv_repo": "https://github.com/pyenv/pyenv.git",
    "python_venv_auto_create": false,
    "raw": false,
    "shorthands_file": null,
    "task_output": null,
    "trusted_config_paths": [],
    "quiet": false,
    "verbose": false,
    "yes": false,
    "ci": false,
    "cd": null,
    "debug": false,
    "env_file": null,
    "trace": false,
    "log_level": "info"
  }

config files:
  ~/.tool-versions

plugins:
  bun      (core)
  deno     (core)
  elixir   https://github.com/mise-plugins/mise-elixir.git#7b06439
  erlang   https://github.com/asdf-vm/asdf-erlang.git#ef8f04b
  gleam    https://github.com/vic/asdf-gleam.git#b45a651
  go       (core)
  java     (core)
  kotlin   https://github.com/asdf-community/asdf-kotlin.git#909fd5c
  node     (core)
  python   (core)
  ruby     (core)
  zig      https://github.com/cheetah/asdf-zig.git#d88f6db

toolset:
  python@3.11.5, erlang@26.2.1, elixir@1.16.0, node@18.17.1, ruby@3.2.2, go@1.21.5, gleam@0.30.5, java@temurin-17.0.9+9, kotlin@1.9.10, zig@0.11.0

1 problem found:
shims are missing, run mise reshim to create them

Error loading settings file: TOML parse error at line 1, column 8
  |
1 | python 3.11.5
  |        ^
expected `.`, `=`

@jdx
Copy link
Owner

jdx commented Jan 26, 2024

ok I'll fix both of these

@jdx jdx reopened this Jan 26, 2024
jdx added a commit that referenced this issue Jan 26, 2024
jdx added a commit that referenced this issue Jan 26, 2024
@jdx jdx closed this as completed in #1534 Jan 26, 2024
jdx added a commit that referenced this issue Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants