oasisprotocol / oasis-core

Performant and Confidentiality-Preserving Smart Contracts + Blockchains
https://oasisprotocol.org
Apache License 2.0
338 stars 112 forks source link

build token contract failed #276

Closed GuanhuaWang closed 6 years ago

GuanhuaWang commented 6 years ago

I just went through the read.me file on Ekiden. when I do cargo ekiden build-contract, it fails.

root@578ee67c5a9f:/code/contracts/token# cargo ekiden build-contract Preparing token Building token Compiling core v0.0.0 (file:///root/.rustup/toolchains/nightly-2018-02-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore) Compiling std_unicode v0.0.0 (file:///root/.rustup/toolchains/nightly-2018-02-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd_unicode) Compiling alloc v0.0.0 (file:///root/.rustup/toolchains/nightly-2018-02-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc) Finished release [optimized] target(s) in 18.27 secs Compiling libc v0.0.0 (file:///root/.rustup/toolchains/nightly-2018-02-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/rustc/libc_shim) Compiling panic_abort v0.0.0 (file:///root/.rustup/toolchains/nightly-2018-02-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libpanic_abort) Finished release [optimized] target(s) in 0.90 secs Compiling unwind v0.0.0 (file:///root/.rustup/toolchains/nightly-2018-02-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libunwind) Compiling panic_unwind v0.0.0 (file:///root/.rustup/toolchains/nightly-2018-02-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libpanic_unwind) Finished release [optimized] target(s) in 1.15 secs Updating git repository https://github.com/rust-lang-nursery/compiler-builtins Updating registry https://github.com/rust-lang/crates.io-index
Compiling cc v1.0.15
Compiling compiler_builtins v0.1.0 (https://github.com/rust-lang-nursery/compiler-builtins#28daccd9) Finished release [optimized] target(s) in 7.81 secs Updating git repository https://github.com/ekiden/rust-sgx-sdk Updating registry https://github.com/rust-lang/crates.io-index
Downloading filetime v0.1.15 Compiling libc v0.2.41
Compiling sgx_types v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling cfg-if v0.1.3 Compiling sgx_tkey_exchange v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling sgx_trts v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling sgx_tse v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling sgx_tservice v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling sgx_tcrypto v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling filetime v0.1.15 Compiling sgx_tprotected_fs v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling sgx_alloc v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling sgx_tdh v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling sgx_tseal v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling build_helper v0.1.0 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling std v0.0.0 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Finished release [optimized] target(s) in 13.81 secs Updating git repository https://github.com/ekiden/rust-sgx-sdk Compiling xargo_sgx_rand v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Finished release [optimized] target(s) in 1.39 secs Compiling xargo_sgx_serialize v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Finished release [optimized] target(s) in 2.55 secs Compiling xargo_sgx_tunittest v0.9.8 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Finished release [optimized] target(s) in 0.37 secs Updating registry https://github.com/rust-lang/crates.io-index Updating git repository https://github.com/ekiden/ring Updating git repository https://github.com/ekiden/futures-rs
Updating git repository https://github.com/ekiden/rust-sgx-sdk
Updating git repository https://github.com/ekiden/webpki
Downloading serde_cbor v0.8.2
Downloading rustc-hex v1.0.0
Downloading bigint v4.3.0
Downloading chrono v0.4.2
Downloading untrusted v0.5.1
Downloading byteorder v1.2.3
Downloading crunchy v0.1.6
Downloading time v0.1.40
Downloading num-integer v0.1.38
Downloading num-traits v0.2.4
Downloading spin v0.4.8
Downloading rayon v0.8.2
Downloading gcc v0.3.54
Downloading rayon-core v1.4.0
Downloading crossbeam-deque v0.2.0
Downloading num_cpus v1.8.0
Downloading crossbeam-utils v0.2.2
Downloading crossbeam-epoch v0.3.1
Downloading memoffset v0.2.1
Downloading nodrop v0.1.12
Downloading arrayvec v0.4.7
Downloading scopeguard v0.3.3
Downloading sodalite v0.3.0
Downloading index-fixed v0.3.0
Downloading percent-encoding v1.0.1
Downloading pem-iterator v0.2.0
Downloading base64 v0.9.1
Downloading serde_json v1.0.17
Downloading safemem v0.2.0
Downloading protoc-grpcio v0.1.1
Downloading grpcio-compiler v0.2.0
Downloading failure v0.1.1
Downloading failure_derive v0.1.1
Downloading synstructure v0.6.1
Downloading syn v0.11.11
Downloading quote v0.3.15
Downloading synom v0.11.3
Downloading unicode-xid v0.0.4
Downloading lazy_static v0.2.11
Compiling libc v0.2.41
Compiling gcc v0.3.54 Compiling futures-sgx v0.1.18 (https://github.com/ekiden/futures-rs#9780549e) Compiling unicode-xid v0.1.0 Compiling cfg-if v0.1.3 Compiling rustc-serialize v0.3.24 Compiling vec_map v0.8.1 Compiling rustc-demangle v0.1.8 Compiling untrusted v0.5.1 Compiling scopeguard v0.3.3 Compiling num-integer v0.1.38 Compiling utf8-ranges v1.0.0 Compiling protobuf v1.4.5 Compiling quote v0.3.15 Compiling spin v0.4.8 Compiling memoffset v0.2.1 Compiling itoa v0.4.1 Compiling rustc-hex v1.0.0 Compiling nodrop v0.1.12 Compiling sgx_edl v0.9.7 (https://github.com/ekiden/rust-sgx-sdk?tag=v0.9.8-ekiden1#d65ed33d) Compiling unicode-xid v0.0.4 Compiling index-fixed v0.3.0 Compiling num-traits v0.2.4 Compiling strsim v0.7.0 Compiling serde v1.0.59 Compiling ucd-util v0.1.1 Compiling bitflags v1.0.3 Compiling regex v1.0.0 Compiling byteorder v1.2.3 Compiling crunchy v0.1.6 Compiling ansi_term v0.11.0 Compiling bigint v4.3.0 Compiling void v1.0.2 Compiling safemem v0.2.0 Compiling dtoa v0.4.2 Compiling lazy_static v0.2.11 Compiling unicode-width v0.1.5 Compiling cc v1.0.15 Compiling rayon-core v1.4.0 Compiling pem-iterator v0.2.0 Compiling remove_dir_all v0.5.1 Compiling percent-encoding v1.0.1 Compiling proc-macro2 v0.4.3 Compiling crossbeam-utils v0.2.2 Compiling log v0.4.1 Compiling time v0.1.40 Compiling lazy_static v1.0.0 Compiling arrayvec v0.4.7 Compiling synom v0.11.3 Compiling sodalite v0.3.0 Compiling filebuffer v0.3.0 Compiling num_cpus v1.8.0 Compiling atty v0.2.10 Compiling rand v0.4.2 Compiling memchr v2.0.1 Compiling regex-syntax v0.6.0 Compiling grpcio-compiler v0.2.0 Compiling unreachable v1.0.0 Compiling base64 v0.9.1 Compiling textwrap v0.9.0 Compiling backtrace-sys v0.1.17 Compiling protoc v1.4.5 Compiling quote v0.6.2 Compiling crossbeam-epoch v0.3.1 Compiling syn v0.11.11 Compiling aho-corasick v0.6.4 Compiling thread_local v0.3.5 Compiling rand v0.3.22 Compiling tempdir v0.3.7 Compiling clap v2.31.2 Compiling syn v0.14.0 Compiling crossbeam-deque v0.2.0 Compiling synstructure v0.6.1 Compiling uuid v0.1.18 Compiling protoc-rust v1.4.5 Compiling serde_cbor v0.8.2 Compiling serde_json v1.0.17 Compiling chrono v0.4.2 Compiling toml v0.4.6 Compiling serde_derive v1.0.59 Compiling mktemp v0.3.1 Compiling failure_derive v0.1.1 Compiling rayon v0.8.2 Compiling ring v0.12.1 (https://github.com/ekiden/ring?branch=0.12.1-ekiden#d4e0eea2) Compiling backtrace v0.3.8 Compiling error-chain v0.11.0 Compiling failure v0.1.1 Compiling protoc-grpcio v0.1.1 Compiling webpki v0.17.0 (https://github.com/ekiden/webpki?branch=0.17.0-ekiden#31a6a8aa) Compiling ekiden-tools v0.1.0-alpha.4 (file:///code/tools) Compiling ekiden-db-edl v0.1.0-alpha.4 (file:///code/db/edl) Compiling ekiden-contract-edl v0.1.0-alpha.4 (file:///code/contract/edl) Compiling token-api v0.1.0-alpha.4 (file:///code/contracts/token/api) Compiling ekiden-rpc-edl v0.1.0-alpha.4 (file:///code/rpc/edl) Compiling ekiden-key-manager-api v0.1.0-alpha.4 (file:///code/contracts/key-manager/api) Compiling ekiden-enclave-edl v0.1.0-alpha.4 (file:///code/enclave/edl) Compiling ekiden-rpc-common v0.1.0-alpha.4 (file:///code/rpc/common) Compiling ekiden-enclave-common v0.1.0-alpha.4 (file:///code/enclave/common) Compiling ekiden-common-api v0.1.0-alpha.4 (file:///code/common/api) Compiling ekiden-edl v0.1.0-alpha.4 (file:///code/core/edl) Compiling token v0.1.0-alpha.4 (file:///code/contracts/token) error: failed to run custom build command for token v0.1.0-alpha.4 (file:///code/contracts/token) process didn't exit successfully: /code/target/debug/build/token-c84bf3b40bf6d03c/build-script-build (exit code: 101) --- stdout cargo:rerun-if-env-changed=SGX_MODE cargo:rerun-if-env-changed=INTEL_SGX_SDK TARGET = Some("x86_64-unknown-linux-sgx") OPT_LEVEL = Some("0") TARGET = Some("x86_64-unknown-linux-sgx") HOST = Some("x86_64-unknown-linux-gnu") TARGET = Some("x86_64-unknown-linux-sgx") TARGET = Some("x86_64-unknown-linux-sgx") HOST = Some("x86_64-unknown-linux-gnu") CC_x86_64-unknown-linux-sgx = None CC_x86_64_unknown_linux_sgx = None TARGET_CC = None CC = None HOST = Some("x86_64-unknown-linux-gnu") CROSS_COMPILE = None TARGET = Some("x86_64-unknown-linux-sgx") HOST = Some("x86_64-unknown-linux-gnu") CFLAGS_x86_64-unknown-linux-sgx = None CFLAGS_x86_64_unknown_linux_sgx = None TARGET_CFLAGS = None CFLAGS = None DEBUG = Some("true") TARGET = Some("x86_64-unknown-linux-sgx") CC_x86_64-unknown-linux-sgx = None CC_x86_64_unknown_linux_sgx = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-sgx = None CFLAGS_x86_64_unknown_linux_sgx = None HOST_CFLAGS = None CFLAGS = None TARGET = Some("x86_64-unknown-linux-sgx") CC_x86_64-unknown-linux-sgx = None CC_x86_64_unknown_linux_sgx = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-sgx = None CFLAGS_x86_64_unknown_linux_sgx = None HOST_CFLAGS = None CFLAGS = None TARGET = Some("x86_64-unknown-linux-sgx") CC_x86_64-unknown-linux-sgx = None CC_x86_64_unknown_linux_sgx = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-sgx = None CFLAGS_x86_64_unknown_linux_sgx = None HOST_CFLAGS = None CFLAGS = None TARGET = Some("x86_64-unknown-linux-sgx") CC_x86_64-unknown-linux-sgx = None CC_x86_64_unknown_linux_sgx = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-sgx = None CFLAGS_x86_64_unknown_linux_sgx = None HOST_CFLAGS = None CFLAGS = None TARGET = Some("x86_64-unknown-linux-sgx") CC_x86_64-unknown-linux-sgx = None CC_x86_64_unknown_linux_sgx = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-sgx = None CFLAGS_x86_64_unknown_linux_sgx = None HOST_CFLAGS = None CFLAGS = None TARGET = Some("x86_64-unknown-linux-sgx") CC_x86_64-unknown-linux-sgx = None CC_x86_64_unknown_linux_sgx = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-sgx = None CFLAGS_x86_64_unknown_linux_sgx = None HOST_CFLAGS = None CFLAGS = None running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "/opt/sgxsdk/include" "-I" "/opt/sgxsdk/include/tlibc" "-I" "/opt/sgxsdk/include/stlport" "-I" "/opt/sgxsdk/include/epid" "-I" "/tmp/a63ed5f3704e427a9882140637eca1ca" "-Wall" "-Wextra" "-m64" "-O2" "-nostdinc" "-fvisibility=hidden" "-fpie" "-fstack-protector" "-o" "/code/target/x86_64-unknown-linux-sgx/debug/build/token-cbe5eaab29b5986e/out/enclave_t.o" "-c" "/tmp/a63ed5f3704e427a9882140637eca1ca/enclave_t.c" exit code: 0 TARGET = Some("x86_64-unknown-linux-sgx") TARGET = Some("x86_64-unknown-linux-sgx") HOST = Some("x86_64-unknown-linux-gnu") AR_x86_64-unknown-linux-sgx = None AR_x86_64_unknown_linux_sgx = None TARGET_AR = None AR = None TARGET = Some("x86_64-unknown-linux-sgx") TARGET = Some("x86_64-unknown-linux-sgx") running: "ar" "crs" "/code/target/x86_64-unknown-linux-sgx/debug/build/token-cbe5eaab29b5986e/out/libenclave_t.a" "/code/target/x86_64-unknown-linux-sgx/debug/build/token-cbe5eaab29b5986e/out/enclave_t.o" exit code: 0 TARGET = Some("x86_64-unknown-linux-sgx") cargo:rustc-link-lib=static=enclave_t cargo:rustc-link-search=native=/code/target/x86_64-unknown-linux-sgx/debug/build/token-cbe5eaab29b5986e/out cargo:rustc-link-lib=static=enclave_t

--- stderr warning: ekiden-enclave-edl_enclave.edl: file short name ekiden-enclave-edl_enclave' is not a valid C identifier warning: ekiden-enclave-edl_identity.edl: file short nameekiden-enclave-edl_identity' is not a valid C identifier warning: ekiden-rpc-edl_rpc.edl: file short name ekiden-rpc-edl_rpc' is not a valid C identifier warning: ekiden-db-edl_db.edl: file short nameekiden-db-edl_db' is not a valid C identifier warning: ekiden-contract-edl_contract.edl: file short name ekiden-contract-edl_contract' is not a valid C identifier warning: ekiden-edl_core.edl: file short nameekiden-edl_core' is not a valid C identifier thread 'main' panicked at 'Failed to get contract identity: Error(Io(Os { code: 2, kind: NotFound, message: "No such file or directory" }), State { next_error: None, backtrace: None })', libcore/result.rs:945:5 note: Run with RUST_BACKTRACE=1 for a backtrace.

warning: build failed, waiting for other jobs to finish... error: build failed error: failed to build, xargo exited with status 101!

willscott commented 6 years ago

I think this may be because you don't have the key manager contract built.

can you try running the command in contracts/key-manager first? per: https://github.com/oasislabs/ekiden/blob/master/.circleci/config.yml#L62

GuanhuaWang commented 6 years ago

yeah it works, thx will.