Skip to content

nix-build failing whereas nix-shell --pure works #11

Description

@sbellem

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:

  • Is git available in the nix shell session?
  • Find out if the patch is applied in nix shell session.
  • Understand differences between using nix-build, nix-shell and nix-shell --pure. Why is --pure not "pure enough"?
  • If patch is not applied in nix shell session, then just disable the trigger for when using nix-build. But try to understand what is causing the different behaviors.
  • temporary measure: try adding git as a dependency

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions