mise icon indicating copy to clipboard operation
mise copied to clipboard

`mise deactivate` should delete environment variables

Open yggdr opened this issue 1 year ago • 2 comments

Describe the bug mise deactivate leaves around various environment variables like MISE_*_VERSION, but esp. __MISE_DIFF and __MISE_WATCH. These are tested for by mise's build system in cargo test, which then complains that it "cannot run tests when mise is activated".

To Reproduce

  1. Have mise activated
  2. mise deactivate
  3. env | grep -i mise will output several mise-related variables
  4. cd $mise_code_repo
  5. cargo test will complain

Expected behavior mise deactivate should be enough to satisfy its own test system

mise doctor output


version: 2024.4.0 freebsd-x64 (5963167 2024-04-06)
activated: yes
shims_on_path: no

build_info: 
  Target: x86_64-unknown-freebsd
  Features: DEFAULT, NATIVE_TLS
  Built: Sat, 6 Apr 2024 15:17:20 +0000
  Rust Version: rustc 1.77.0 (aedd173a2 2024-03-17) (built from a source tarball)
  Profile: release

shell: 
  xonsh
  xonsh/0.15.1

dirs: 
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files: 
  ~/.config/mise/config.toml

plugins: 
  atlas        https://github.com/pbr0ck3r/asdf-atlas.git#a2ed8f1
  bun          (core)
  cidr-merger  https://github.com/ORCID/asdf-cidr-merger.git#5522711
  deno         (core)
  go           (core)
  java         (core)
  node         (core)
  python       (core)
  ruby         (core)
  rust         https://github.com/code-lever/asdf-rust.git#95acf4f
  semgrep      https://github.com/brentjanderson/asdf-semgrep.git#13ff78b
  zig          https://github.com/cheetah/asdf-zig.git#4c6cb6f

toolset: 
  [email protected]  

env_vars: 
  MISE_PYTHON_VERSION=2.7.18
  MISE_SHELL=xonsh

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
  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
  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 = "/home/yggdrasil/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

1 problem found:

1. shims are missing, run mise reshim to create them
   Missing shims: python3.11, atlas, pydoc, pip2, pydoc3, pip3.9, python3.9-config, idle, pip, python2, python3-config, pydoc3.11, easy_install, python3, python2-config, 2to3-3.11, 2to3-3.9, pip3, go, python3.9-gdb.py, python, idle3.11, python3.9, 2to3, python3.11-config, python-config, idle3.9, pip3.11, zig, idle3, python2.7-gdb.py, easy_install-2.7, gofmt, python3.11-gdb.py, python2.7-config, smtpd.py, cidr-merger, pip2.7, python2.7, pydoc3.9


yggdr avatar Apr 06 '24 15:04 yggdr

in terms of __MISE_DIFF and __MISE_WATCH I agree. However MISE_*_VERSION might not be possible to remove since we have no way of knowing if those were added by mise or not.

jdx avatar Apr 06 '24 16:04 jdx

I definitely see an argument to be made for keeping the VERSION-variables; maybe those could be deleted via a -c|--completely flag to deactivate, otherwise keep them.

yggdr avatar Apr 06 '24 19:04 yggdr