Skip to content

Commit

Permalink
feat(docs): #1296 add note about homeless-shelter
Browse files Browse the repository at this point in the history
- Add note about homeless-shelter in the python extension documentation
  to make sure that the user knows that we delete this directory and
  change the `HOME` variable to assure purity of builds without
  sandboxing.

Signed-off-by: Robin Quintero <rohaquinlop301@gmail.com>
  • Loading branch information
rohaquinlop committed Feb 19, 2024
1 parent 97e7d9c commit 5169a73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/src/api/extensions/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ Types:
For more information see [here](https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md).
Defaults to `(self: super: {})`.

Note:

- By default we override every python package deleting the
`homeless-shelter` directory and changing the `HOME` variable,
we make this to assure purity of builds without sandboxing. If
any build attribute is being override, please have this in mind
if any error related to `homeless-shelter` start to appear.
- We delete this directory in the `preUnpack` phase because this
is the first phase that will be executed and with that we make
sure that the `HOME` will be used during the execution of the
next phases.

Example:

=== "main.nix"
Expand All @@ -43,6 +55,12 @@ Example:
overrides = self: super: {
pygments = super.pygments.overridePythonAttrs (
old: {
preUnpack =
''
export HOME=$(mktemp -d)
rm -rf /homeless-shelter
''
+ (old.preUnpack or "");
buildInputs = [super.setuptools];
}
);
Expand Down

0 comments on commit 5169a73

Please sign in to comment.