macOS: buildroot configure failure due to running as root
Running shrinkwrap build buildroot.yaml
on macOS fails with this error:
...
checking whether mknod can create fifo without root privileges... configure: error: in `/Volumes/kinu/shrinkwrap-workspace/build/buildroot/buildroot/build/host-tar-1.35':
configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
See `config.log' for more details
make: *** [package/pkg-generic.mk:273: /Volumes/kinu/shrinkwrap-workspace/build/buildroot/buildroot/build/host-tar-1.35/.stamp_configured] Error 1
System: macOS 15.5 on MBP M3 Max
Runtime: Docker
Docker version: 4.43.2, using the beta Docker VMM
Volume is case-sensitive
This does work under Ubuntu on an x86 machine.
A workaround is to create an overlay that sets FORCE_UNSAFE_CONFIGURE
to 1.
force_unsafe.yaml
:
build:
buildroot:
prebuild:
- export FORCE_UNSAFE_CONFIGURE=1
Now, building with shrinkwrap build buildroot.yaml --overlay force_unsafe.yaml
will succeed.
Automatically setting FORCE_UNSAFE_CONFIGURE
when building on macOS with the Docker runtime is probably a good idea.