guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Document /homeless-shelter?


From: Leo Famulari
Subject: Re: Document /homeless-shelter?
Date: Sun, 16 Jan 2022 13:25:57 -0500

On Sun, Jan 16, 2022 at 12:38:52PM -0500, Matt wrote:
> Subject: [PATCH] Document /homeless-shelter

I pushed a simpler addition to the manual:

https://git.savannah.gnu.org/cgit/guix.git/tree/doc/guix.texi#n1181

Of course I made a silly typo and so this change takes place over two
commits.

> +The @env{HOME} environment variable is set to @file{/homeless-shelter}
> +during the build process.  This ensures builds are determistic and
> +highlights all uses of @env{HOME}.  Packages should not depend on the
> +pathname of a home directory.  Instead, modify the build phase to set
> +@env{HOME} to @file{/tmp}:
> +
> +@lisp
> +(modify-phases %standard-phases
> +  (add-before 'check 'fix-home-directory
> +    (lambda _
> +      (setenv "HOME" "/tmp"))))
> +@end lisp

This text is basically correct but we have to balance verbosity with
readability.

The important thing was to document /homeless-shelter, so that packagers
understand it comes from Guix, and to explain its rationale.

It's not 100% true that setting HOME=homeless-shelter ensures that
builds are deterministic and highlights all uses of $HOME, although it
does help with those goals.

I don't think we want to document the use of /tmp, or recommend it as an
authoritative workaround.

Rather, it's a common solution, but packagers must seek to understand
how the package build scripts are trying to use $HOME and make a
judgement.

Additionally, I don't think that Build Environment Setup is the right
place to document workarounds.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]