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_CONFIG_DIR}/mise.{MISE_ENV}.toml not used by mise #2774

Closed
Drew-Daniels opened this issue Oct 17, 2024 · 2 comments
Closed

{MISE_CONFIG_DIR}/mise.{MISE_ENV}.toml not used by mise #2774

Drew-Daniels opened this issue Oct 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Drew-Daniels
Copy link

Drew-Daniels commented Oct 17, 2024

Describe the bug
I have a mise config file, located in $MISE_CONFIG_DIR, mise.toml.

I am using mise.toml to store global mise settings that I do not want to track with git

However, I see that the env vars I am setting in mise.toml are not getting loaded into my shell, and that when I run mise doctor, this config file isn't listed as having been loaded.

To Reproduce

  • Set the MISE_CONFIG_DIR env to a local directory in your shell profile (I'm using zsh)
  • Create a mise.toml in the MISE_CONFIG_DIR with some settings, env vars, etc

Expected behavior
I see that {MISE_CONFIG_DIR}/mise.{MISE_ENV}.toml is listed as on the file lookup path for mise profiles based on the docs, but it looks like this file is not getting loaded for some reason.

mise doctor output

❯ mise doctor
version: 2024.10.7 macos-arm64 (2024-10-14)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Mon, 14 Oct 2024 22:13:17 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04) (Homebrew)
  Profile: release

shell:
  fish
  fish, version 3.7.1

dirs:
  data: ~/.local/share/mise
  config: ~/projects/dotfiles/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  node  https://github.com/asdf-vm/asdf-nodejs#c36e6f0

toolset:

env_vars:
  MISE_PYTHON_DEFAULT_PACKAGES_FILE=~/projects/dotfiles/mise/default-python-packages
  MISE_NODE_DEFAULT_PACKAGES_FILE=~/projects/dotfiles/mise/default-npm-packages
  MISE_CONFIG_DIR=~/projects/dotfiles/mise
  MISE_ENV=development
  MISE_RUBY_DEFAULT_PACKAGES_FILE=~/projects/dotfiles/mise/default-gems
  MISE_SHELL=fish

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cache_prune_age = "30d"
  ci = false
  color = true
  debug = false
  disable_backends = []
  disable_default_registry = false
  disable_hints = []
  disable_tools = []
  experimental = false
  fetch_remote_versions_cache = "1h"
  fetch_remote_versions_timeout = "10s"
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = "30s"
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  log_level = "info"
  not_found_auto_install = true
  paranoid = false
  pin = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = []
  use_versions_host = true
  verbose = false
  yes = false

  [cargo]
  binstall = true

  [node]

  [pipx]
  uvx = false

  [python]
  default_packages_file = "~/.default-python-packages"
  pyenv_repo = "https://github.com/pyenv/pyenv.git"
  venv_auto_create = false
  venv_stdlib = false

  [ruby]
  default_packages_file = "~/projects/dotfiles/mise/default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false
1 warning found:

1. plugin node overrides a core plugin

1 problem found:

1. shims are missing, run mise reshim to create them
   Missing shims: ks

Additional context

.zshrc:

export XDG_CONFIG_HOME=~/projects/dotfiles

# mise
export MISE_CONFIG_DIR="$XDG_CONFIG_HOME/mise"
# development, testing, production
export MISE_ENV="development"
eval "$(/opt/homebrew/opt/mise/bin/mise activate zsh)"

export MISE_RUBY_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/mise/.default-gems"
export MISE_NODE_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/mise/.default-npm-packages"
export MISE_PYTHON_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/mise/.default-python-packages"

$MISE_CONFIG_HOME/mise.toml:

[env]
MACHINE='work'

TLDR

mise can find $MISE_CONFIG_DIR/config.{MISE_ENV}.toml but not $MISE_CONFIG_DIR/mise.{MISE_ENV}.toml

@Drew-Daniels Drew-Daniels added the bug Something isn't working label Oct 17, 2024
@roele
Copy link
Contributor

roele commented Oct 19, 2024

The docs mention $MISE_CONFIG_DIR/mise.{MISE_ENV}.toml, with MISE_ENV="development" that translates to a file named $MISE_CONFIG_DIR/mise.development.toml. A file $MISE_CONFIG_DIR/mise.toml is currently not supported in this location.

@Drew-Daniels
Copy link
Author

I see thanks for clarifying that for me, I'll close this since I thought the {MISE_ENV} in the filename was optional

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

No branches or pull requests

2 participants