Building and installing the SGX SDK works in a nix-shell session, including when using the --pure option, but when building with nix-build it fails as it tries to apply an OpenMP patch with git, which is not available.
Thing to look for:
For use an already patched version of openmp and disable the check and git apply command invocation.
make[3]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/sdk/pthread'
make -C /tmp/nix-build-sgx.drv-0/source/external/openmp
make[3]: Entering directory '/tmp/nix-build-sgx.drv-0/source/external/openmp'
cd openmp_code && git apply ../0001-Enable-OpenMP-in-SGX.patch && cd ..
/nix/store/l6h4ya0wzb4b8mr0y58k2gh2nhfql4sn-bash-4.4-p23/bin/bash: git: command not found
make[3]: *** [Makefile:70: openmp_code/final/build/runtime/src/libomp.a] Error 127
make[3]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/external/openmp'
make[2]: *** [Makefile.source:201: openmp] Error 2
make[2]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/sdk'
make[1]: *** [Makefile:50: all] Error 2
make[1]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/sdk'
make: *** [Makefile:70: sdk] Error 2
builder for '/nix/store/vmwr9980q11idzyzzpbqhwfjapkf3zsv-sgx.drv' failed with exit code 2
error: build of '/nix/store/vmwr9980q11idzyzzpbqhwfjapkf3zsv-sgx.drv' failed
Building and installing the SGX SDK works in a
nix-shellsession, including when using the--pureoption, but when building withnix-buildit fails as it tries to apply an OpenMP patch withgit, which is not available.Thing to look for:
nix-build,nix-shellandnix-shell --pure. Why is--purenot "pure enough"?For use an already patched version of openmp and disable the check and
git applycommand invocation.