Skip to content

Commit

Permalink
Make Emacs Lisp packages work in sandbox
Browse files Browse the repository at this point in the history
Eldev likes to do a lot of things that don't get along with Nix. In this case,
because there are checks that can't run in the sandbox, it's easy to overlook
sandbox violations until garnix catches them.

Without `--external`, Eldev will try to download various packages when linting
and testing. This restores the `--external` that used to be there and still
needs to be.

Just one more instance of sellout/project-manager#53.
  • Loading branch information
sellout committed Dec 2, 2023
1 parent 1f60873 commit 882abb7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nix/lib/elisp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ in {
export HOME="$PWD/fake-home"
mkdir -p "$HOME"
## Need `--external` here so that we don’t try to download any
## package archives (which would break the sandbox).
## TODO: I'm not sure why this needs `EMACSNATIVELOADPATH`, but it
## does.
EMACSNATIVELOADPATH= eldev lint --required
EMACSNATIVELOADPATH= eldev --external lint --required
runHook postBuild
'';

Expand Down Expand Up @@ -140,15 +142,19 @@ in {
## `eldev--create-internal-pseudoarchive-descriptor`.
export HOME="$PWD/fake-home"
mkdir -p "$HOME"
eldev test
## Need `--external` here so that we don’t try to download any
## package archives (which would break the sandbox).
eldev --external test
runHook postCheck
'';

doInstallCheck = true;

installCheckPhase = ''
runHook preInstallCheck
eldev --packaged test
## Need `--external` here so that we don’t try to download any
## package archives (which would break the sandbox).
eldev --external --packaged test
runHook postInstallCheck
'';
});
Expand Down

0 comments on commit 882abb7

Please sign in to comment.