Search code examples
ubunturaspberry-piwindows-subsystem-for-linuxbuildroottoolchain

Unable to build toolchain because PATH contains spaces, TABs, and/or newline (\n) characters


I'm working on a Buildroot project on Raspberry 4. I wanted to start by building a cross-compilation toolchain :

make toolchain

but I'm stuck on this error output:

Your PATH contains spaces, TABs, and/or newline (\n) characters.                                                                                          
This doesn't work. Fix you PATH.                                                                                                                               
make: *** [support/dependencies/dependencies.mk:27: dependencies] Error 1 

Could the problem be linked to the $PATH variable? If so, how can I fix it?

I specify that I am using windows-subsystem-for-Linux, and I choose Ubuntu 22.04.2 LTS


Solution

  • Create a build script and override the PATH variable:

    setlocal
    set PATH=/bin;/usr/local/bin;/usr/bin
    make toolchain
    endlocal
    

    I included setlocal to make the environment changes only apply for the batch file execution. You'll probably need to add additional paths if those I've included aren't sufficient.