apache / incubator-teaclave

Apache Teaclave (incubating) is an open source universal secure computing platform, making computation on privacy-sensitive data safe and simple.
https://teaclave.apache.org
Apache License 2.0
763 stars 158 forks source link

Failed to build the Teaclave platform using docker with the -DSGX_SIM_MODE=ON option #499

Closed AdamsLee closed 3 years ago

AdamsLee commented 3 years ago

I tried to build the Teaclave platform using docker with the -DSGX_SIM_MODE=ON option

$ git clone https://github.com/apache/incubator-teaclave.git
$ cd incubator-teaclave
$ docker run --rm -v $(pwd):/teaclave -w /teaclave \
  -it teaclave/teaclave-build-ubuntu-1804-sgx-2.9.1:latest \
   bash -c ". /root/.cargo/env && \
     . /opt/sgxsdk/environment && \
     mkdir -p build && cd build && \
     cmake -DTEST_MODE=ON -DSGX_SIM_MODE=ON .. && \
     make"

I expected to see this happen: platform was built successfully

Instead, this happened: error occurred: failed to select a version for the requirement sgx_rand = "^1.1.2"

[ 3%] Building teaclave_client_sdk as dynamic and static libraries Updating git repository https://github.com/apache/teaclave-sgx-sdk Updating git submodule https://github.com/WebAssembly/testsuite Updating crates.io index Updating git repository https://github.com/SergioBenitez/Rocket error: failed to select a version for the requirement sgx_rand = "^1.1.2" candidate versions found which didn't match: 1.1.1, 1.1.0, 1.0.9, ... location searched: crates.io index required by package teaclave_attestation v0.2.0 (/teaclave/build/cmake_tomls/unix_app/attestation) cp: cannot stat '/teaclave/build/target/unix/debug/libteaclave_client_sdk.so': No such file or directory cp: cannot stat '/teaclave/build/target/unix/debug/libteaclave_client_sdk.a': No such file or directory CMakeFiles/teaclave_client_sdk.dir/build.make:57: recipe for target 'CMakeFiles/teaclave_client_sdk' failed make[2]: [CMakeFiles/teaclave_client_sdk] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/teaclave_client_sdk.dir/all' failed make[1]: [CMakeFiles/teaclave_client_sdk.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

mssun commented 3 years ago

Hi, thanks for your report. I cannot reproduce your issue.

Basically, I followed your steps and built Teaclave successfully.

AdamsLee commented 3 years ago

Hi, thanks for your report. I cannot reproduce your issue.

Basically, I followed your steps and built Teaclave successfully.

hi, thanks for your response. I checked https://crates.io/crates/sgx_rand/versions and found that there is no 1.1.2 version and the latest version is 1.1.1. Looks like that's the reason why it failed. Isn't it?

mssun commented 3 years ago

We only use vendored third-party crates. Therefore, any upstream changes/updates won't affect our build process.

Did you change anything with the building system?

AdamsLee commented 3 years ago

After investigation, I think I find the root cause. This isn't the code bug. It should be caused by the GitHub network connection issue within mainland in China. The vendored third-party crates failed to be fully updated.