jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
9.88k stars 284 forks source link

rtx manipulate path even when using shims #1015

Closed jylenhofdecat closed 11 months ago

jylenhofdecat commented 11 months ago

Describe the bug rtx seems to manipulate PATH even when using shims only... (no activate)

.bashrc extract : export PATH="$HOME/.local/share/rtx/shims:$PATH" source <(rtx completion bash) export RTX_ENV=contrib

I create a .venv with the python version designed by rtx source it with source .venv/bin/activate

my project use Makefile which call python pip tool

Expected behavior It failed because python version exist in the path before the .venv one

Adding PATH echo in the Makefile gives :

│ /home/z01jlenh/.local/share/rtx/installs/terraform/1.3.6/bin:/home/z01jlenh/.local/share/rtx/installs/terraform-docs/0.16.0/bin:/home/z01jlenh/.local/share/rtx/installs/kubectl/1.22.2/bin:/home/z01jlenh/.local/share/rtx/installs/editorconfig-checker/2.6.0/bin:/home/z01jlenh/.local/share/rtx/installs/shellcheck/0.8.0/bin:/home/z01jlenh/.local/share/rtx/installs/flux2/2.1.1/bin:/home/z01jlenh/.local/share/rtx/installs/kustomize/5.0.3/bin:/home/z01jlenh/.local/share/rtx/installs/stern/1.26.0/bin:/home/z01jlenh/.local/share/rtx/installs/github-cli/2.35.0/bin:/home/z01jlenh/.local/share/rtx/installs/helm/3.12.3/bin:/home/z01jlenh/.local/share/rtx/installs/k9s/0.27.4/bin:/home/z01jlenh/.local/share/rtx/installs/bats/1.6.0/bin:/home/z01jlenh/.local/share/rtx/installs/python/3.10.13/bin:/home/z01jlenh/github/cpe-application-provisioning-system/cpe-application-provisioning-system/.venv/bin:/home/z01jlenh/.local/share/rtx/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program
│ Files/dotnet/:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Users/Jean-Yves/AppData/Local/Microsoft/WindowsApps
│ ERROR: Could not find an activated virtualenv (required).

But in my prompt, it is OK :

echo $PATH
/home/z01jlenh/github/cpe-application-provisioning-system/cpe-application-provisioning-system/.venv/bin:/home/z01jlenh/.local/share/rtx/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Users/Jean-Yves/AppData/Local/Microsoft/WindowsApps

rtx doctor output

rtx version:
  2023.11.8 linux-x64 (268f481 2023-11-27)

build:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 27 Nov 2023 04:01:22 +0000
  Rust Version: rustc 1.73.0 (cc66ad468 2023-10-03)
  Profile: release

shell:
  /bin/bash
  GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
  Copyright (C) 2022 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

  This is free software; you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

rtx data directory:
  /home/z01jlenh/.local/share/rtx

rtx environment variables:
  RTX_ENV=contrib

settings:
  {"always_keep_download": "false", "always_keep_install": "false", "asdf_compat": "false", "disable_default_shorthands": "false", "disable_tools": "[]", "experimental": "true", "jobs": "4", "legacy_version_file": "true", "legacy_version_file_disable_tools": "[]", "log_level": "INFO", "missing_runtime_behavior": "warn", "plugin_autoupdate_last_check_duration": "10080", "raw": "false", "trusted_config_paths": "[]", "verbose": "true", "yes": "true"}

config files:
  /home/z01jlenh/.config/rtx/config.toml
  /home/z01jlenh/.tool-versions
  /home/z01jlenh/github/cpe-application-provisioning-system/cpe-application-provisioning-system/.python-version
  /home/z01jlenh/github/cpe-application-provisioning-system/cpe-application-provisioning-system/.tool-versions
  /home/z01jlenh/github/cpe-application-provisioning-system/cpe-application-provisioning-system/.rtx.contrib.toml

plugins:
  bats                   https://github.com/timgluz/asdf-bats.git#299551f
  bun                    (core)
  deno                   (core)
  editorconfig-checker   https://github.com/gabitchov/asdf-editorconfig-checker.git#9326459
  flux2                  https://github.com/tablexi/asdf-flux2.git#771755e
  github-cli             https://github.com/bartlomiejdanek/asdf-github-cli.git#e0605b7
  go                     (core)
  helm                   https://github.com/Antiarchitect/asdf-helm.git#a39e17b
  java                   (core)
  k9s                    https://github.com/looztra/asdf-k9s.git#2b3af87
  kubectl                https://github.com/asdf-community/asdf-kubectl.git#cbe6df4
  kustomize              https://github.com/Banno/asdf-kustomize.git#2c43c30
  node                   (core)
  python                 (core)
  ruby                   (core)
  shellcheck             https://github.com/luizm/asdf-shellcheck.git#b160a52
  shfmt                  https://github.com/luizm/asdf-shfmt.git#a42c5ff
  stern                  https://github.com/looztra/asdf-stern.git#e17efba
  terraform              https://github.com/asdf-community/asdf-hashicorp.git#197e3ec
  terraform-docs         https://github.com/looztra/asdf-terraform-docs.git#acfd01c

toolset:
  flux2@2.1.1, kustomize@5.0.3, stern@1.26.0, github-cli@2.35.0, helm@3.12.3, k9s@0.27.4, bats@1.6.0, terraform-docs@0.16.0, kubectl@1.22.2, terraform@1.3.6, editorconfig-checker@2.6.0, shellcheck@0.8.0, python@3.10

No problems found

I don't know where to look, but I didn't have this kind of problem if I use asdf

jdx commented 11 months ago

when you call a shim child processes will have a modified PATH—this is expected behavior