Need to debug a #guix PACKAGE definition with errors ? Build it with the --keep-failed flag.
Then, go to /tmp/guix-build-PACKAGE and run a Guix shell container with
$GUIX/pre-inst-en guix shell --no-grafts -CN -D PACKAGE --writable-root # coreutils which
source ./environment-variables
rm /bin/sh
cd PACKAGE
These steps reproduce the exact context where the build error arises, and allows debugging it.