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

Win11 Ubuntu WSL2 fails, maybe spaces in paths #346

Closed
ptr727 opened this issue Jan 24, 2022 · 2 comments
Closed

Win11 Ubuntu WSL2 fails, maybe spaces in paths #346

ptr727 opened this issue Jan 24, 2022 · 2 comments

Comments

@ptr727
Copy link

ptr727 commented Jan 24, 2022

The issue tracker is for reporting product deficiencies. How do I questions should be posted to the discussion forum at https://groups.google.com/group/got-your-back. When in doubt, start at the discussion forum and return here only when instructed to do so.

Please confirm the following:

Full steps to reproduce the issue:

  1. Install Ubuntu from Windows Store on Win11, update as of today 24 Jan 2022
  2. Run Ubuntu Shell, follow Linux install instructions, install 1.54.
  3. At end of setup, exit shell when prompted, re-run shell

Expected outcome (what are you trying to do?):
No error

Actual outcome (what errors or bad behavior do you see instead?):

-bash: export: `Files/dotnet/:/mnt/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/130/Tools/Binn/:/mnt/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/Client': not a valid identifier
-bash: export: `SDK/ODBC/170/Tools/Binn/:/mnt/c/Program': not a valid identifier
-bash: export: `Files/Git/cmd:/mnt/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/140/Tools/Binn/:/mnt/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/150/Tools/Binn/:/mnt/c/Program': not a valid identifier
-bash: export: `Files/PowerShell/7/:/mnt/c/Program': not a valid identifier
-bash: export: `Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/piete/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/piete/.dotnet/tools:/mnt/c/Users/piete/AppData/Local/Programs/Microsoft': not a valid identifier
-bash: export: `Insiders/bin:/mnt/c/Program': not a valid identifier
-bash: export: `Files/JetBrains/JetBrains': not a valid identifier
-bash: export: `2020.3.3/bin:/snap/bin:/home/pieter/bin/gyb': not a valid identifier
pieter@DESKTOP-2IL0UKA:/mnt/c/Users/piete$

I suspect the install is not quoting paths and failing when encountering paths with spaces in names, as is very common on Windows.

@ptr727
Copy link
Author

ptr727 commented Jan 26, 2022

On a "clean" WSL2 Ubuntu, or Ubuntu LTS, or Debian, there is no path in cat ~/.bashrc.
After installing GYB the PATH environment is expanded without quotes and a GYB appended as the last entry.

cat ~/.bashrc
...
export PATH=/home/pieter/.local/bin:/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 SQL Server/130/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Microsoft SQL Server/140/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/150/Tools/Binn/:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/piete/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/piete/.dotnet/tools:/mnt/c/Users/piete/AppData/Local/Programs/Microsoft VS Code Insiders/bin:/mnt/c/Program Files/JetBrains/JetBrains Rider 2020.3.3/bin:/snap/bin:/home/pieter/bin/gyb

See here for append:
https://github.com/GAM-team/got-your-back/blob/main/install-gyb.sh#L235

See here for possible alternative expansion:
https://unix.stackexchange.com/questions/79658/not-a-valid-identifier-when-i-do-export-path

See here for similar issues in WSL:
microsoft/WSL#1640

Maybe ignore the path and just register the alias?:
echo "alias gyb='~/bin/gyb/gyb'" >> ~/.bash_aliases

@ptr727
Copy link
Author

ptr727 commented Apr 26, 2024

Abandon

@ptr727 ptr727 closed this as completed Apr 26, 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

No branches or pull requests

1 participant