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

FS#3442 - Build fails on WSL / WSL2 #8313

Open
openwrt-bot opened this issue Nov 11, 2020 · 3 comments
Open

FS#3442 - Build fails on WSL / WSL2 #8313

openwrt-bot opened this issue Nov 11, 2020 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

james-mcguire:

  • Install WSL2 on Windows 10
  • Install Ubuntu
  • Confirm $PATH has paths with spaces:
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2020.812.0_x64__79rhkp1fndgsc:/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/PuTTY/:/mnt/c/Users/Owner/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Owner/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin

Follow https://github.com/openwrt/openwrt/blob/master/README.md directions to prep environment and build openwrt

After many minutes/hours of building, observe make fails due to an issue with path:

This was the command:
find /home/ubuntu/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/ -mindepth 1 -execdir touch -hcd "@1587126718" "{}" +

The was the error:
find: The relative path 'Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_1804.2020.5.0_x64__79rhkp1fndgsc' is included in the PATH environment variable, which is insecure in combination with the -execdir action of find. Please remove that entry from $PATH

Workarounds:
Remove all paths from $PATH that have spaces

Other links:
microsoft/WSL#5099
microsoft/WSL#6208

@EvanTheB
Copy link

Something inside the build system is replacing spaces with colons: EG a path like

PATH="/mnt/c/Users/EvanBenn/AppData/Local/Programs/Microsoft VS Code/bin"

becomes

PATH="/mnt/c/Users/EvanBenn/AppData/Local/Programs/Microsoft:VS:Code/bin"

by the find -execdir line:

$(if $(SOURCE_DATE_EPOCH),find $(1)/ -mindepth 1 -execdir touch -hcd "@$(SOURCE_DATE_EPOCH)" "{}" +)

Introduced in dd53724, which claims to want to remove relative paths from PATH, I think meaning entries starting in . (it doesnt remove entries starting with characters other than /).

But I think fundamentally make does not support doing much with spaces in your paths; filenames or PATH. All the functions here: https://www.gnu.org/software/make/manual/make.html#Text-Functions first split on whitespace.

@66Ton99
Copy link

66Ton99 commented Feb 12, 2024

Has anyone tried building it inside a docker image like this one https://github.com/mwarning/docker-openwrt-build-env ?
It should work.

@66Ton99
Copy link

66Ton99 commented Feb 16, 2024

Yes, it works fine for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants