Skip to content

Commit d61052b

Browse files
committed
permit entering the shell when not testing
1 parent 5cb809c commit d61052b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

unikernel.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ includeos.stdenv.mkDerivation rec {
103103
runHook postCheck
104104
'';
105105

106-
# this is a hack
106+
# the doCheck shell is a hack
107107
# some tests need to be run through a shell because of net_cap_raw+ep and net_cap_admin+ep
108108
# replace nix-build with nix-shell to test without dropping capabilities
109109
packages = [
110110
(includeos.pkgs.python3.withPackages (p: [
111111
vmrunnerPkg
112112
]))
113113
];
114-
shellHook = ''
114+
shellHook = if doCheck then ''
115115
set -eu
116116
pkg="$(nix-build ./unikernel.nix --arg doCheck false --arg unikernel ${unikernel})"
117117
@@ -120,6 +120,11 @@ includeos.stdenv.mkDerivation rec {
120120
"$testPath" || exit 1
121121
122122
exit 0
123+
'' else ''
124+
echo "entering unikernel build shell."
125+
echo "if you want to run tests, you can do so with:"
126+
echo " --arg doCheck true"
127+
cd result/
123128
'';
124129

125130
}

0 commit comments

Comments
 (0)