gramineproject / graphene

Graphene / Graphene-SGX - a library OS for Linux multi-process applications, with Intel SGX support
https://grapheneproject.io
GNU Lesser General Public License v3.0
771 stars 261 forks source link

gsc sign-image fails #2436

Closed mythi closed 3 years ago

mythi commented 3 years ago

Description of the problem

gsc started failing after b8b867096ed288f3d55abc2ace30148f8bfeaa9f

Steps to reproduce

https://graphene.readthedocs.io/en/latest/manpages/gsc.html

Expected results

./gsc sign-image python enclave-key.pem succeeds without failures

Actual results

The build fails because the python tools are copied from the repo and not properly installed:

Traceback (most recent call last):
  File "/graphene/python/graphene-sgx-sign", line 4, in <module>
    from graphenelibos.sgx_sign import main
  File "/graphene/python/graphenelibos/__init__.py", line 9, in <module>
    raise RuntimeError(
RuntimeError: You are attempting to run the tools from repo, without installing. Please install graphene before running Python tools. See https://graphene.readthedocs.io/en/latest/building.html.
kenplusplus commented 3 years ago

I also meet with this issue, sound like need both "make and meson" build now, and ninja will install the file to system directories like below. Then need use /usr/loca/bin/graphene-sgx-sign

ninja: Entering directory `build' [0/1] Installing files. Installing subdir /graphene/Runtime/../Pal/src/host/Linux-SGX/gdb_integration to /usr/local/lib/x86_64-linux-gnu/graphene/sgx/gdb_integration Installing subdir /graphene/Runtime/../Pal/gdb_integration to /usr/local/lib/x86_64-linux-gnu/graphene/sgx/gdb_integration/common Installing LibOS/shim/src/libsysdb.so to /usr/local/lib/x86_64-linux-gnu/graphene/libsysdb.so Installing /graphene/LibOS/glibc-build/csu/crt1.o to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/csu/crti.o to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/csu/crtn.o to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/dlfcn/libdl.so.2 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/libc.so to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/libc.so.6 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/login/libutil.so.1 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/math/libm.so.6 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/mathvec/libmvec.so.1 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/nis/libnsl.so.1 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/nptl/libpthread.so.0 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/nptl_db/libthread_db.so.1 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/nss/libnss_compat.so.2 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/nss/libnss_db.so.2 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/nss/libnss_files.so.2 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/resolv/libanl.so.1 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/resolv/libnss_dns.so.2 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/resolv/libresolv.so.2 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/rt/librt.so.1 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/LibOS/glibc-build/elf/ld-linux-x86-64.so.2 to /usr/local/lib/x86_64-linux-gnu/graphene/runtime/glibc Installing /graphene/Runtime/../Pal/src/host/Linux-SGX/pal-sgx to /usr/local/lib/x86_64-linux-gnu/graphene/sgx Installing /graphene/Runtime/../Pal/src/host/Linux-SGX/libpal.so to /usr/local/lib/x86_64-linux-gnu/graphene/sgx Installing /graphene/build/Runtime/graphene-sgx to /usr/local/bin Installing /graphene/build/python/graphenelibos/init.py to /usr/local/lib/python3.8/dist-packages/graphenelibos Installing /graphene/python/graphenelibos/manifest.py to /usr/local/lib/python3.8/dist-packages/graphenelibos Installing /graphene/build/python/graphenelibos/_offsets.py to /usr/local/lib/python3.8/dist-packages/graphenelibos Installing /graphene/python/graphenelibos/_aesm_pb2.py to /usr/local/lib/python3.8/dist-packages/graphenelibos Installing /graphene/python/graphenelibos/sgx_get_token.py to /usr/local/lib/python3.8/dist-packages/graphenelibos Installing /graphene/python/graphenelibos/sgx_sign.py to /usr/local/lib/python3.8/dist-packages/graphenelibos Installing /graphene/python/graphene-manifest to /usr/local/bin Installing /graphene/python/graphene-sgx-get-token to /usr/local/bin Installing /graphene/python/graphene-sgx-sign to /usr/local/bin

dimakuv commented 3 years ago

Sorry, GSC is currently broken. We're moving to a new build/deployment system in core Graphene, which breaks GSC. We'll fix GSC as soon as this migration to the new build system is done.

mythi commented 3 years ago

We're moving to a new build/deployment system in core Graphene

@dimakuv what would be a good/safe commit in master that still has gsc working?

dimakuv commented 3 years ago

https://github.com/oscarlab/graphene/pull/2457 -- this PR will be merged very soon (maybe today). So GSC on master branch will work again.

Inside this PR, you can observe that GSC uses commit 2e737e69f076c60918f87d6829bb769925e75fec.

mkow commented 3 years ago

@mythi: #2457 was just merged, could you check if it works for you now?

mkow commented 3 years ago

No reply from the reporter and seems to be already fixed, closing.