Description
Disclaimer: I'm not a TCL programmer, and I've never used TCL directly, but it's causing occasional build-problems for https://github.com/raspberrypi/pico-setup (where it's a dependency of openocd).
If there's a space in the filepath containing the jimtcl
folder, when you try to build you get an error like:
MKLDEXT _load-static-exts.c
/bin/sh: 1: /tmp/some: not found
Makefile:103: recipe for target '_load-static-exts.c' failed
make: *** [_load-static-exts.c] Error 1
because the full-path isn't being properly quoted in the Makefile.
When I tried reproducing this on my main Ubuntu laptop, I was surprised to discover that it built fine even when I had spaces in my filepath! But then when I looked at the Makefile I noticed that it was then using my system-installed tclsh
(which is in a path without any spaces), and that probably explains why this bug has been undiscovered for so long! Only after I'd uninstalled all my "system tcl" programs, was I able to reproduce the problem on my Ubuntu laptop.
So for now, the easiest way to reproduce is using something like Docker.
Fire up a Debian docker image using sudo docker run -it debian
and then within that docker image run the following sequence of commands:
apt update
apt install -y build-essential git
mkdir /tmp/some_path
cd /tmp/some_path
git clone https://github.com/msteveb/jimtcl.git
cd jimtcl
./configure
make
This shows that jimtcl is able to successfully build inside this Docker image in a path without spaces.
But if you then do:
mkdir '/tmp/some other path'
cd '/tmp/some other path'
git clone https://github.com/msteveb/jimtcl.git
cd jimtcl
./configure
make
it instantly fails with
MKLDEXT _load-static-exts.c
/bin/sh: 1: /tmp/some: not found
make: *** [Makefile:104: _load-static-exts.c] Error 1
I did have a quick go at fixing this myself (so that I could submit a PR), but I didn't have any idea what all the autosetup stuff was doing, which is why I'm submitting an issue instead 😉