Motivation and Developer Experience Improvement
This PR addresses issue #36239. Developers who use Guix to build Bitcoin Core locally may run into confusing dependency build failures, such as errors when compiling python-distlib or node, if their Guix daemon is running as an unprivileged user.
Recent unprivileged Guix installations use Linux user namespaces. These can cause some packages to fail when building locally without substitutes because the build environment has different permissions. For example, /etc may be unexpectedly writable, or builds may fail with UID/GID errors.
The problem is that developers only discover this after a long build has already failed, often with error messages that do not clearly point to the real cause.
This PR improves the developer experience by:
- Adding a check to
contrib/guix/guix-buildthat detects whenguix-daemonis running as a non-root user and shows a warning before the build starts. - Updating
contrib/guix/INSTALL.mdwith clear instructions for changing an unprivileged Guix daemon back to a privileged (root) configuration.
By catching this configuration issue before the build starts, we save developers hours of wasted compilation time and reduce the support burden on maintainers diagnosing environmental build failures.
Testing
Because this check depends on the local system environment, no new automated tests were added.
The changes to guix-build were tested manually on Ubuntu 26.04. The check correctly detects when the daemon is running as an unprivileged user and does not report false positives when the Guix daemon is running normally as root.