Space in path of imagebuilder folder causes make to fail

when I put imagebuilder in a folder that has space in its path (on linux) the make command prints error that it cant find files.

can this be fixed or it is impossible?

Absolutely

Presumably the above means it is absolutely impossible to fix. As to the issue, use the escape char?

was that sarcasm?

Certainly not wit.

What do you think ?

Spaces in folder names is a bad idea.

oh.
thank you for clarification.
I was gonna ask how windows users cope with the issue as windows user normal path has spaces in them then I remember that that the dev stuff happens on linux.

it was just really weird that I didn't get this issue (or maybe I have or forgot) before with many years of linux stuff.

maybe I always used space free paths.

https://openwrt.org/docs/guide-developer/toolchain/wsl dunno if this is what you're using..

been windows free for more than 15 years.

1 Like

Yes.
Rename the folder(s) with spaces in the name.

This is an example of what happens if you have spaces in a folder name:

root@meshnode-8ecb:/tmp/stuff# 
root@meshnode-8ecb:/tmp/stuff# mkdir "more stuff"
root@meshnode-8ecb:/tmp/stuff# ll
drwxr-xr-x    3 root     root            60 Feb  7 21:45 ./
drwxrwxrwt   19 root     root           480 Feb  7 21:46 ../
drwxr-xr-x    2 root     root            40 Feb  7 21:45 more stuff/
root@meshnode-8ecb:/tmp/stuff# 
root@meshnode-8ecb:/tmp/stuff# cd more stuff
-ash: cd: can't cd to more: No such file or directory
root@meshnode-8ecb:/tmp/stuff# 
root@meshnode-8ecb:/tmp/stuff# cd "more stuff"
root@meshnode-8ecb:/tmp/stuff/more stuff# 

This is normal parsing done by the shell (bash, or in my example, ash).
Parsing stops at a space unless the string is enclosed by quotes.

I meant more like this:

user@laptop:/home/user/New Folder/openwrt-imagebuilder-24.10.0-mvebu-cortexa9.Linux-x86_64  % make
rules.mk:12: Folder/openwrt-imagebuilder-24.10.0-mvebu-cortexa9.Linux-x86_64/include/debug.mk: No such file or directory
make: *** No rule to make target 'Folder/openwrt-imagebuilder-24.10.0-mvebu-cortexa9.Linux-x86_64/include/debug.mk'.  Stop.


kde by default creates new folders with names like "New Folder" with spaces.

kde windows emulator /s

If you want to talk GUIs - Gnome insists you add a folder name and does not generate a default. Sure you can create a name with a space in it, but expect potential issues using scripts.

Imagebuilder is NOT a GUI App, it is driven by shell scripts.

Rename your "New Folder" to "NewFolder" and all will be well.

3 Likes

Can it be fixed, probably - but not easily.
Will it be fixed, not that likely (as the efforts required far outpace the gains).

Should you decide to dive into it (and you will hit a lot of make and m4 fun along the way), there wouldn't be a reason not to merge your hypothetical patches, but this is a case of 'if it hurts, don't do it'.

1 Like