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

Devenv python tool (uv) $PATH entry uses relative paths, causing things to break when changing to a subdirectory #1763

Open
xandaaah opened this issue Mar 9, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@xandaaah
Copy link

xandaaah commented Mar 9, 2025

Describe the bug
The built-in uv + python3 support adds relative paths to $PATH for tools, which breaks when changing to a subdirectory

To reproduce
Create a new devenv with python and uv support enabled, add a package providing tools (Panda3D for example with multify and obj2egg) and then create a subdirectory. Try running a tool provided by the package installed (multify for example.) Now change to the subdirectory and try to run the tool. It won't work.

xanderm@morgancore ~/forse> multify
Usage: multify -[c|r|u|t|x] -f <multifile_name> [options] <subfile_name> ...
xanderm@morgancore ~/forse [1]> cd wrench
xanderm@morgancore ~/f/wrench (master)> multify
error: flake 'flake:nixpkgs' does not provide attribute 'apps.x86_64-linux.multify', 'packages.x86_64-linux.multify', 'legacyPackages.x86_64-linux.multify' or 'multify'
       Did you mean one of justify or multiqc?
xanderm@morgancore ~/f/wrench (master) [127]> cd ..
xanderm@morgancore ~/forse> cd may_4th/
xanderm@morgancore ~/f/may_4th> multify
error: flake 'flake:nixpkgs' does not provide attribute 'apps.x86_64-linux.multify', 'packages.x86_64-linux.multify', 'legacyPackages.x86_64-linux.multify' or 'multify'
       Did you mean one of justify or multiqc?
xanderm@morgancore ~/f/may_4th [127]> cd ..
xanderm@morgancore ~/f/may_4th [1]> echo $PATH | grep devenv
/nix/store/k2jfczwb32bjpglrzinylpb4mpdabrqr-python3-3.12.7-env/bin /nix/store/w7cs06nn9vvk8a59nv48y4biv9zzv43x-uv-0.4.30/bin /nix/store/zv1kaq7f1q20x62kbjv6pfjygw5jmwl6-python3-3.12.7/bin /nix/store/1zgzrsbq3b0f06k76pha0r8hmfwvjvc0-git-2.47.0/bin /nix/store/4isn1fcxvlnw54yfknm23lh73b45krks-libcap-2.70/bin /nix/store/16h31npnbgpkhxp1041dsifiklbw4mpr-pkg-config-wrapper-0.29.2/bin /nix/store/9q63d382x7k2h6cc2pfsb39ar3n6f9wg-patchelf-0.15.0/bin /nix/store/4apajimszc47rxwcpvc3g3rj2icinl71-gcc-wrapper-13.3.0/bin /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/bin /nix/store/zw5haplzbwjgbp3yykhm6iprkpfppzxb-glibc-2.40-36-bin/bin /nix/store/b1wvkjx96i3s7wblz38ya0zr8i93zbc5-coreutils-9.5/bin /nix/store/x9as7x6f7cdgcskvvn3yp02m662krr7y-binutils-wrapper-2.43.1/bin /nix/store/bwkb907myixfzzykp21m9iczkhrq5pfy-binutils-2.43.1/bin /nix/store/b1wvkjx96i3s7wblz38ya0zr8i93zbc5-coreutils-9.5/bin /nix/store/w8pnfazxqwmrqmwkb5zrz1bifsd8abxl-findutils-4.10.0/bin /nix/store/cxwsmlr3xh1ml4r0kgdjrknw7504b9f8-diffutils-3.10/bin /nix/store/vmby25zqxnx94awvj0k7zn0rsd0zyrwg-gnused-4.9/bin /nix/store/85amyk92rg19l4fy0qmy7wr4jmq8p5z0-gnugrep-3.11/bin /nix/store/nnin69nrnrrmnv2scbwyfkgh1rf51gh1-gawk-5.3.1/bin /nix/store/zhaypw0znkjnymg0rk1599zn21rr0l50-gnutar-1.35/bin /nix/store/a7pimibppfw2m3ryijnwwzx76i780bw2-gzip-1.13/bin /nix/store/vqjygx23hkim1kpidik5xcs9whayf3sr-bzip2-1.0.8-bin/bin /nix/store/9y5kd90fdbrq3r4yc9mpqn82f93zdgyq-gnumake-4.4.1/bin /nix/store/p6k7xp1lsfmbdd731mlglrdj2d66mr82-bash-5.2p37/bin /nix/store/mdmansf6zkzsnrcf4h3yav5kz93rh03y-patch-2.7.6/bin /nix/store/5180mi672sl6ikiwyhvgnxasz6iqxws0-xz-5.6.3-bin/bin /nix/store/g4lksqp6l8qiab4a0as21s6556xh4gyp-file-5.45/bin /home/xanderm/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/python_files/deactivate/fish ./.devenv/state/venv/bin /nix/store/sbrd3cb3y0v7m1s5g91967lbngnl7rxh-glib-2.82.1-bin/bin /nix/store/95im22i65wnsgnj7lw1vsl5iy62lypv9-kitty-0.37.0/bin /nix/store/9dnll67932lkqjh31nw6k9kim2prah85-imagemagick-7.1.1-40/bin /nix/store/69v6c64pn1ay26207b0cmzi40qpr9q0w-ncurses-6.4.20221231-dev/bin /run/wrappers/bin /home/xanderm/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin /home/xanderm/.nix-profile/bin /nix/profile/bin /home/xanderm/.local/state/nix/profile/bin /etc/profiles/per-user/xanderm/bin /nix/var/nix/profiles/default/bin /run/current-system/sw/bin /home/xanderm/.local/bin /home/xanderm/go/bin /nix/store/qlzvmgr8w9prdlyys7irqf86p7bndf5b-binutils-wrapper-2.43.1/bin /nix/store/s9ikyj8vv30dmn36iw3nbsl1dh2az1jz-pciutils-3.13.0/bin /nix/store/b7ixmgw7i326h9w6qmvbmayglj8jakdx-pkgconf-wrapper-2.3.0/bin /home/xanderm/.local/bin /home/xanderm/go/bin /home/xanderm/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/python_files/deactivate/fish ./.devenv/state/venv/bin /nix/store/sbrd3cb3y0v7m1s5g91967lbngnl7rxh-glib-2.82.1-bin/bin /nix/store/95im22i65wnsgnj7lw1vsl5iy62lypv9-kitty-0.37.0/bin /nix/store/9dnll67932lkqjh31nw6k9kim2prah85-imagemagick-7.1.1-40/bin /nix/store/69v6c64pn1ay26207b0cmzi40qpr9q0w-ncurses-6.4.20221231-dev/bin /run/wrappers/bin /home/xanderm/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin /home/xanderm/.nix-profile/bin /nix/profile/bin /home/xanderm/.local/state/nix/profile/bin /etc/profiles/per-user/xanderm/bin /nix/var/nix/profiles/default/bin /run/current-system/sw/bin /home/xanderm/.local/bin /home/xanderm/go/bin /nix/store/qlzvmgr8w9prdlyys7irqf86p7bndf5b-binutils-wrapper-2.43.1/bin /nix/store/s9ikyj8vv30dmn36iw3nbsl1dh2az1jz-pciutils-3.13.0/bin /nix/store/b7ixmgw7i326h9w6qmvbmayglj8jakdx-pkgconf-wrapper-2.3.0/bin /home/xanderm/.local/bin /home/xanderm/go/bin /nix/store/sbrd3cb3y0v7m1s5g91967lbngnl7rxh-glib-2.82.1-bin/bin /nix/store/95im22i65wnsgnj7lw1vsl5iy62lypv9-kitty-0.37.0/bin /nix/store/9dnll67932lkqjh31nw6k9kim2prah85-imagemagick-7.1.1-40/bin /nix/store/69v6c64pn1ay26207b0cmzi40qpr9q0w-ncurses-6.4.20221231-dev/bin /run/wrappers/bin /home/xanderm/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin /home/xanderm/.nix-profile/bin /nix/profile/bin /home/xanderm/.local/state/nix/profile/bin /etc/profiles/per-user/xanderm/bin /nix/var/nix/profiles/default/bin /run/current-system/sw/bin /home/xanderm/.local/bin /home/xanderm/go/bin /nix/store/qlzvmgr8w9prdlyys7irqf86p7bndf5b-binutils-wrapper-2.43.1/bin /nix/store/s9ikyj8vv30dmn36iw3nbsl1dh2az1jz-pciutils-3.13.0/bin /nix/store/b7ixmgw7i326h9w6qmvbmayglj8jakdx-pkgconf-wrapper-2.3.0/bin /home/xanderm/.local/bin /home/xanderm/go/bin /home/xanderm/.local/bin /home/xanderm/go/bin

As you can see above, ./.devenv/state/venv/bin is added to the PATH, instead of an absolute path.

Version

xanderm@morgancore ~/forse> devenv version
devenv 1.3.1 (x86_64-linux)

I'm using the version from nixpkgs. I'd be happy to send over my configs if that's needed.

@xandaaah xandaaah added the bug Something isn't working label Mar 9, 2025
@xandaaah xandaaah changed the title Devenv python (uv) $PATH uses relative paths, causing things to break when changing to a subdirectory Devenv python tool (uv) $PATH entry uses relative paths, causing things to break when changing to a subdirectory Mar 9, 2025
@domenkozar
Copy link
Member

That's an interesting one, I think the $PATH is added by bin/activate. IIRC there's a flag to venv to use absolute paths.

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