-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
clone-path fails to update $PATH #201
Comments
I was able to drop the following into my .bashrc as a workaround: if [ -f /run/genie.path ]; then
export PATH=$PATH:$(cat /run/genie.path)
fi |
This is probably a variant of #137 . Try the diagnosis/fix described here? #137 (comment) |
Im having the same problem, and the #137 solution didnt help. ❯ cat /run/genie.env
INSIDE_GENIE=true
WSL_DISTRO_NAME=Ubuntu
WSL_INTEROP=/run/WSL/9_interop
WSLENV=WT_SESSION::WT_PROFILE_ID
❯ cat /run/genie.path
/mnt/c/Windows/System32%
❯ ls /usr/lib/systemd/system-environment-generators
80-genie-envar.sh
❯ echo $PATH
/home/yulian/.bin:/home/yulian/.cargo/bin:/home/yulian/.poetry/bin:/home/yulian/.local/bin:/home/yulian/.yarn/bin:/home/yulian/.nvm/versions/node/v14.17.0/bin:/home/yulian/.npmlocal/bin:/home/yulian/.go/bin:/home/yulian/.go/current/bin:/home/yulian/tools/dotnet:/usr/lib/dart/bin:/home/yulian/.go/bin:/home/yulian/.go/current/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/yulian/.rbenv/bin Adn this is my path outside of genie: PATH=/home/yulian/.bin:/home/yulian/.cargo/bin:/home/yulian/.poetry/bin:/home/yulian/.local/bin:/home/yulian/.yarn/bin:/home/yulian/.nvm/versions/node/v14.17.0/bin:/home/yulian/.npmlocal/bin:/home/yulian/.go/bin:/home/yulian/.go/current/bin:/home/yulian/tools/dotnet:/usr/lib/dart/bin:/home/yulian/.go/bin:/home/yulian/.go/current/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/VMware/VMware Player/bin/:/mnt/c/Program Files/AdoptOpenJDK/jdk-11.0.11.9-hotspot/bin:/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/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/PowerShell/7/:/mnt/c/opscode/chef/bin/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Android:/mnt/c/Windows/System32:/mnt/c/Program Files (x86)/Tailscale IPN:/mnt/c/Users/yulian/scoop/apps/python/current/Scripts:/mnt/c/Users/yulian/scoop/apps/python/current:/mnt/c/Users/yulian/scoop/shims:/mnt/c/Users/yulian/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/yulian/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.3.2/bin:/mnt/c/Users/yulian/AppData/Local/Programs/Rancher Desktop/resources/resources/win32/bin:/mnt/c/Users/yulian/AppData/Local/Programs/Rancher Desktop/resources/resources/linux/bin:/home/yulian/.rbenv/bin |
Same with Ubuntu-21.04. But in my case #201 (comment) solves the issue. I adapted it slightly to my usecase # This is a temporary hack until the following bug is fixed:
# https://github.com/arkane-systems/genie/issues/201
if \
[[ -v INSIDE_GENIE ]] \
&& cat /etc/genie.ini | grep --quiet '^clone-path=true' \
&& ! echo "$PATH" | grep --quiet '/WINDOWS/system32' \
&& [ -f /run/genie.path ]
then
echo "[DEBUG] Add content of '/run/genie.path' to PATH."
PATH="$PATH:$(cat /run/genie.path)"
fi |
There has been no activity on this issue for over 60 days. If there is no further activity within 7 days from this message, it will be automatically closed. |
What do you see if you run |
Weirdly my path in the bottle is incorrect, but both the
On Windows 10. Edit: If I add |
There has been no activity on this issue for over 60 days. If there is no further activity within 7 days from this message, it will be automatically closed. |
Followed the above for checking if |
Same as above - sourcing the results of |
The general cause for this problem, unfortunately, is variable. The path (and other environment variables) you end up with in the user session is the result of first, all the environment generators from /usr/lib/systemd/user-environment-generators run in asciibetical order from first to last. (Most of these have numbers proxied to them to set the order they run in; genie's is 80, so it should run after anything that's not explicitly trying to be last.) Also, they should append to the existing path (as 80-genie-envar.sh) does, but they can overwrite them, so that's something you need to check for. These files produce the environment block you can see when you run
If your path looks correct in the results from running that , you don't need to worry about the environment generators, 'cause they're working fine. This block should be inherited as-is by your shell when it starts up. While there may be other things that try and fiddle with your environment block, the odds are about 95% good that one of your shell profiles (see your shell's documentation for details of these) is overwriting the existing PATH. These are the only means I have found to repro this behavior. Unfortunately, there are multiple places either could be done, so I'm going to have to leave finding the specific places on your systems where PATH gets overwritten to y'all. |
I have a weirder edge-case. For every other command the sourcing of
Any other incantation I have tried doesn't work (and I've tried lots!) - can anyone else confirm this oddity, or even better explain the underlying cause? Note if system32 is on the PATH then you can get away with just using the cmd.exe and passing netsh.exe into that, but for some reason I cannot call netsh.exe directly. |
Windows version (build number):
Version 20H2 OS Build 19042.1165
Linux distribution:
Ubuntu-20.04
Genie version:
1.44
Describe the bug
genie -s
does not clone my path, despite clone-path set to trueConfirm that you are running inside the bottle:
inside
To Reproduce
Steps to reproduce the behavior:
wsl.exe genie -s
echo $PATH
Expected behavior
See a full list of directories, including Windows paths.
Screenshots
Additional context
/run/genie.path is populated correctly, as in, I see my full Windows Path as well as other paths I would normally expect to see in my WSL Distro.
I confirm that I have read the ENTIRE supplied readme file and checked for relevant information on the repository wiki before raising this issue, and that if the solution to this issue is found in either location, it will be closed without further comment:
The text was updated successfully, but these errors were encountered: