In the IRC, someone asked about an error message:

PermissionError: [Errno 13] Permission denied: '/homeless-shelter'

This error happened when trying to build a Python package, python-libpysal.

The solution was to set HOME to /tmp:

    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'check 'fix-home-directory
           (lambda _
             ;; Tests fail with "Permission denied: '/homeless-shelter'".
             (setenv "HOME" "/tmp"))))

Basically, some projects expect a $HOME to be defined and will fail because 
Guix sets $HOME to /homeless-shelter, which doesn't exist in the build 
environment.

As I understand it, $HOME is set to /homeless-shelter during build because 
that's how Nix does/did it and "there’s no home
directory in build environments, and perhaps Eelco Dolstra and others back then 
found that setting ‘HOME’ to a non-existing directory broke
fewer builds that leaving it unset."

Is my understanding correct?

Is this something that should be documented, and if so, where?

IRC log:
https://logs.guix.gnu.org/guix/2022-01-16.log#003312

Previous Guix discussion: 
https://lists.gnu.org/archive/html/guix-devel/2019-11/msg00311.html

Reply via email to