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 adds a root environment variable #3883

Closed
jdx opened this issue Dec 30, 2024 Discussed in #3882 · 1 comment · Fixed by #3884
Closed

Mise adds a root environment variable #3883

jdx opened this issue Dec 30, 2024 Discussed in #3882 · 1 comment · Fixed by #3884

Comments

@jdx
Copy link
Owner

jdx commented Dec 30, 2024

Discussed in #3882

Originally posted by orf December 30, 2024
When using a mise task, there seems to be a mysterious root environment variable that is added:

[tasks.test]
shell = "bash -c" # same with all other shells
run = "env | grep root"
❯ env | rg root | wc -l
       0
❯ mise run test
[test] $ env | rg root
root=/Users/tomforbes/PycharmProjects/project/path/here/

This unfortunately causes a third-party library in a tool we use to explode. Because... of course it would 😭 😭

This isn't documented anywhere, and I can't see anywhere in the code that it is added. It doesn't seem to be my shell config/profile. It also happens with file-based tasks, and with this the environment variable is not set.

Mise versions:

version: 2024.12.22 macos-arm64 (2024-12-30)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Mon, 30 Dec 2024 00:20:47 +0000
  Rust Version: rustc 1.83.0 (90b35a623 2024-11-26) (Homebrew)
  Profile: release

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

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

env_vars:
  MISE_SHELL=fish

settings:
  cache_prune_age       "7d"    ~/.config/mise/config.toml
  jobs                  1       ~/.config/mise/config.toml
  pipx.uvx              true    ~/.config/mise/config.toml
  status.missing_tools  "never" ~/.config/mise/config.toml
  status.show_tools     false   ~/.config/mise/config.toml
```</div>
@jdx
Copy link
Owner Author

jdx commented Dec 30, 2024

I think this was supposed to just be in templates but for some reason it got snuck in as an env var too

jdx added a commit that referenced this issue Dec 30, 2024
I believe the intention here was for templates but for some reason this was added to env vars. Removing as it can obviously conflict with other env vars.

Fixes #3883

BREAKING CHANGE: you will need to use `{{root}}` or MISE_PROJECT_ROOT after this change.
jdx added a commit that referenced this issue Dec 30, 2024
I believe the intention here was for templates but for some reason this was added to env vars. Removing as it can obviously conflict with other env vars.

Fixes #3883

BREAKING CHANGE: you will need to use `{{root}}` or MISE_PROJECT_ROOT after this change.
@jdx jdx closed this as completed in #3884 Dec 30, 2024
@jdx jdx closed this as completed in e306720 Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant