Cannot build fossil if the path has spaces
(1) By anonymous on 2025-01-27 04:29:04 [source]
~ cd /dev/shm/
/dev/shm mkdir "s p a c e s"
/dev/shm cd "s p a c e s"
/dev/shm/s p a c e s fossil open ../fossil.fossil
.editorconfig
[... snip ...]
project-name: Fossil
repository: /dev/shm/fossil.fossil
local-root: /dev/shm/s p a c e s/
config-db: /home/me/.fossil
project-code: CE59BB9F186226D80E49D1FA2DB29F935CCA0333
checkout: e0c7e4181b042df4ebde74be4a8bedec3d53c71c 2025-01-24 00:29:36 UTC
parent: 277437dd59b0ec615da84539541371ade5929c25 2025-01-23 20:19:29 UTC
merged-into: 60353a962e0c8b09d99fccd1c2a193e790e3d463 2025-01-26 06:28:48 UTC
tags: trunk
comment: backoffice.c small typo. (user: brickviking)
check-ins: 19280
/dev/shm/s p a c e s ./configure --with-openssl=none
Host System...x86_64-pc-linux-gnu
[... snip ...]
Created autoconfig.h
/dev/shm/s p a c e s make
make: *** No rule to make target '{/dev/shm/s', needed by 'Makefile'. Stop.
This can't be worked around by creating a symlink. After clearing /dev/shm/
and creating anew in a symlinked folder:
/dev/shm ln -s "s p a c e s" nospaces
/dev/shm cd nospaces
/dev/shm/nospaces fossil open ../fossil.fossil
[... snip ...]
/dev/shm/nospaces ./configure --with-openssl=none
[... snip ...]
Created autoconfig.h
/dev/shm/nospaces make
make: *** No rule to make target '{/dev/shm/s', needed by 'Makefile'. Stop.
The configure script converts any symlinks into the canonical folder names. Inside Makefile
there is this:
Makefile: ./Makefile.in $(SRCDIR)/main.mk {/dev/shm/s p a c e s/autosetup/autosetup} {/dev/shm/s p a
c e s/autosetup/local.tcl} {/dev/shm/s p a c e s/auto.def} {/dev/shm/s p a c e s/autosetup/system.t
cl} {/dev/shm/s p a c e s/autosetup/cc.tcl} {/dev/shm/s p a c e s/autosetup/cc-lib.tcl}
(2) By Stephan Beal (stephan) on 2025-01-27 07:24:41 in reply to 1 [link] [source]
Cannot build fossil if the path has spaces
Correct. Spaces in paths are inherently problematic in Makefiles. The configure script embeds dir names into the Makefile in several places and POSIX Make offers no way to reliably/robustly express paths with spaces.
In fossil's history that's been reported as a problem precisely once and has a trivial workaround1, so it's unlikely to garner significant developer attention.
That said: patches to eliminate that corner case would be thoughtfully considered.
- ^ Namely "don't do that."
(3) By Richard Hipp (drh) on 2025-01-27 12:42:26 in reply to 2 [link] [source]
Do I understand correctly that this is a bug in @AUTODEP@ for autosetup? Does check-in da7092cc9312d72f correctly work around that autosetup bug?
(4) By anonymous on 2025-01-27 13:38:15 in reply to 3 [link] [source]
Does check-in da7092cc9312d72f correctly work around that autosetup bug?
Yes it does.
/dev/shm/s p a c e s make
mkdir bld
mkdir -p bld
[... snip ...]
cc -Wall -Wdeclaration-after-statement -DFOSSIL_DYNAMIC_BUILD=1 -g -Os -DHAVE_AUTOCONFIG_H -o fossil
[... snip ...]-lz
/dev/shm/s p a c e s echo $?
0
(5) By Richard Hipp (drh) on 2025-01-27 13:42:01 in reply to 4 [link] [source]
But does it break something else?
(6) By Stephan Beal (stephan) on 2025-01-27 14:53:25 in reply to 4 [link] [source]
/dev/shm/s p a c e s make
You'll still have problems doing an out-of-tree build with spaces, though:
[stephan@nuc:/tmp]$ cp -rp ~/f/fossil 'fos sil'
[stephan@nuc:/tmp]$ mkdir foo
[stephan@nuc:/tmp]$ cd foo
[stephan@nuc:/tmp/foo]$ /tmp/fos\ sil/configure
...
[stephan@nuc:/tmp/foo]$ make
Makefile:96: sil/src/main.mk: No such file or directory
make: *** No rule to make target 'sil/src/main.mk'. Stop.
Whereas that will work if the 4th line is changed to:
[stephan@nuc:/tmp/foo]$ ~/f/fossil/configure
There's no obvious fix for that. There are a handful of places where a SRCDIR=... with a space in it will cause the typical spaces-in-filenames type of confusion.