summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Haupert <mail@vincent-haupert.de>2021-11-15 13:48:23 +0100
committerVincent Haupert <mail@vincent-haupert.de>2021-11-15 15:08:22 +0100
commite74ffcd3665dd61965f6040e6ced86b6f9804389 (patch)
treeff157f5a7a6c61888fee57a87a780911083e8171
parentcd057031317107f327c5080bc41923c510a38c15 (diff)
downloadnixpkgs-e74ffcd3665dd61965f6040e6ced86b6f9804389.tar
nixpkgs-e74ffcd3665dd61965f6040e6ced86b6f9804389.tar.gz
nixpkgs-e74ffcd3665dd61965f6040e6ced86b6f9804389.tar.bz2
nixpkgs-e74ffcd3665dd61965f6040e6ced86b6f9804389.tar.lz
nixpkgs-e74ffcd3665dd61965f6040e6ced86b6f9804389.tar.xz
nixpkgs-e74ffcd3665dd61965f6040e6ced86b6f9804389.tar.zst
nixpkgs-e74ffcd3665dd61965f6040e6ced86b6f9804389.zip
sgx-sdk: rework `installCheckPhase`
-rw-r--r--pkgs/os-specific/linux/sgx-sdk/default.nix31
1 files changed, 18 insertions, 13 deletions
diff --git a/pkgs/os-specific/linux/sgx-sdk/default.nix b/pkgs/os-specific/linux/sgx-sdk/default.nix
index 3cda94c7386..28af8a32a64 100644
--- a/pkgs/os-specific/linux/sgx-sdk/default.nix
+++ b/pkgs/os-specific/linux/sgx-sdk/default.nix
@@ -228,25 +228,30 @@ stdenv.mkDerivation rec {
   installCheckPhase = ''
     runHook preInstallCheck
 
+    header "Building and running SGX samples"
+
     source $out/share/bin/environment
 
-    TESTDIR=`mktemp -d`
-    cp -r $out/share/SampleCode $TESTDIR/
+    TESTDIR=$(mktemp -d)
+    pushd $TESTDIR
 
-    for dir in "Cxx11SGXDemo" "SampleEnclave" "SampleEnclavePCL" "SealUnseal" "Switchless"; do
-      cd $TESTDIR/SampleCode/$dir/
-      make SGX_MODE=SIM
-      ./app
-    done
+    cp -r $out/share/SampleCode/. ./
 
-    cd $TESTDIR/SampleCode/LocalAttestation
-    make SGX_MODE=SIM
-    cd bin/
-    ./app
+    for dir in "Cxx11SGXDemo" "LocalAttestation" "SampleEnclave" "SampleEnclavePCL" "SealUnseal" "Switchless"; do
+      pushd "$dir/"
+      make -j $NIX_BUILD_CORES SGX_MODE=SIM
+      ./app || ./bin/app
+      popd
+    done
 
-    cd $TESTDIR/SampleCode/RemoteAttestation
-    make SGX_MODE=SIM
+    pushd "RemoteAttestation"
+    make -j $NIX_BUILD_CORES SGX_MODE=SIM
     echo "a" | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/sample_libcrypto ./app
+    popd
+
+    popd
+
+    header "Checking symlink targets"
 
     # Make sure all symlinks are valid
     output=$(find "$out" -type l -exec test ! -e {} \; -print)