scrtlabs / enigma-core

Enigma Core library. The domain: Trusted and Untrusted App in Rust.
https://enigma.co
GNU Affero General Public License v3.0
94 stars 21 forks source link

error: 'rustfmt' is not installed for the toolchain 'nightly-2019-05-20-x86_64-unknown-linux-gnu' #183

Closed lacabra closed 5 years ago

lacabra commented 5 years ago

Describe the bug When trying to build the docker core image, the build fails with the following error:

error: 'rustfmt' is not installed for the toolchain 'nightly-2019-05-20-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustfmt --toolchain nightly-2019-05-20-x86_64-unknown-linux-gnu`

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/enigmampc/discovery-docker-network
  2. cd enigma-core
  3. docker build --build-arg GIT_BRANCH_CORE=develop --build-arg SGX_MODE=HW --no-cache .

Expected behavior The build should succeed

Backtrace

Step 9/14 : RUN . /opt/sgxsdk/environment && . /root/.cargo/env && SGX_MODE=$SGX_MODE RUSTFLAGS=-Awarnings RUST_BACKTRACE=1 make DEBUG=1 || echo "\n\n**** This is a known error. Ignore for now. Will succeed upon retry ***\n" && rm -rf /root/.cargo/git/checkouts/rust-sgx-sdk-fc8771c5c45bde9a/212d9f4/xargo && SGX_MODE=$SGX_MODE RUSTFLAGS=-Awarnings RUST_BACKTRACE=1 make DEBUG=1 || true
---> Running in 1973eb637576
/opt/sgxsdk/bin/x64/sgx_edger8r --trusted enclave/Enclave.edl --search-path /opt/sgxsdk/include --search-path /root/sgx/edl --trusted-dir enclave
/opt/sgxsdk/bin/x64/sgx_edger8r --untrusted enclave/Enclave.edl --search-path /opt/sgxsdk/include --search-path /root/sgx/edl --untrusted-dir app
GEN => enclave/Enclave_t.c enclave/Enclave_t.h app/Enclave_u.c app/Enclave_u.h
mkdir -p ./lib
make -C ./enclave/ CARGO_FLAGS= Rust_target_dir=debug
make[1]: Entering directory '/root/enigma-core/enigma-core/enclave'
cargo build -p enigma-types # Meant to make sure `enigma-types.h` already exists and can be included.
Updating git repository `https://github.com/enigmampc/error-chain.git`
Updating crates.io index
Updating git repository `https://github.com/enigmampc/ethabi.git`
Updating git repository `https://github.com/enigmampc/parity-wasm.git`
Updating git repository `https://github.com/enigmampc/wasm-utils.git`
Updating git repository `https://github.com/enigmampc/serde-json-sgx.git`
Updating git repository `https://github.com/baidu/rust-sgx-sdk.git`
Updating git repository `https://github.com/enigmampc/sputnikvm.git`
Updating git repository `https://github.com/enigmampc/wasmi`
Updating git repository `https://github.com/elichai/ring.git`
Updating git repository `https://github.com/enigmampc/json-patch.git`
Updating git repository `https://github.com/enigmampc/msgpack-rust.git`
Updating git repository `https://github.com/mesalock-linux/serde-sgx.git`
Updating git repository `https://github.com/enigmampc/primitives.git`
Updating git repository `https://github.com/enigmampc/rustc-hex.git`
Updating git repository `https://github.com/mesalock-linux/itoa-sgx.git`
Updating git repository `https://github.com/enigmampc/treediff-rs.git`
Updating git repository `https://github.com/mesalock-linux/byteorder-sgx`
Updating git repository `https://github.com/mesalock-linux/num-traits-sgx`
Downloading crates ...
Downloaded arrayvec v0.4.10
Downloaded rustc-hex v2.0.1
Downloaded syn v0.15.39
Downloaded proc-macro2 v0.4.30
Downloaded quote v0.6.12
Downloaded serde v1.0.94
Downloaded cbindgen v0.8.7
Downloaded nodrop v0.1.13
Downloaded unicode-xid v0.1.0
Downloaded serde_derive v1.0.94
Downloaded log v0.4.6
Downloaded clap v2.33.0
Downloaded tempfile v3.1.0
Downloaded serde_json v1.0.40
Downloaded toml v0.4.10
Downloaded ansi_term v0.11.0
Downloaded cfg-if v0.1.9
Downloaded strsim v0.8.0
Downloaded atty v0.2.11
Downloaded vec_map v0.8.1
Downloaded bitflags v1.1.0
Downloaded textwrap v0.11.0
Downloaded ryu v1.0.0
Downloaded libc v0.2.58
Downloaded remove_dir_all v0.5.2
Downloaded itoa v0.4.4
Downloaded unicode-width v0.1.5
Downloaded rand v0.7.0
Downloaded getrandom v0.1.6
Downloaded rand_chacha v0.2.0
Downloaded rand_core v0.5.0
Downloaded lazy_static v1.3.0
Downloaded c2-chacha v0.2.2
Downloaded autocfg v0.1.4
Downloaded spin v0.5.0
Downloaded ppv-lite86 v0.2.5
Compiling proc-macro2 v0.4.30
Compiling libc v0.2.58
Compiling unicode-xid v0.1.0
Compiling spin v0.5.0
Compiling autocfg v0.1.4
Compiling syn v0.15.39
Compiling ppv-lite86 v0.2.5
Compiling ryu v1.0.0
Compiling bitflags v1.1.0
Compiling serde v1.0.94
Compiling sgx_types v1.0.8 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling unicode-width v0.1.5
Compiling sgx_build_helper v0.1.0 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling cbindgen v0.8.7
Compiling remove_dir_all v0.5.2
Compiling vec_map v0.8.1
Compiling strsim v0.8.0
Compiling cfg-if v0.1.9
Compiling sgx_unwind v0.0.1 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling ansi_term v0.11.0
Compiling itoa v0.4.4
Compiling serde v1.0.91 (https://github.com/mesalock-linux/serde-sgx.git?rev=407aaaa2558dda5c2367d57ba40324c52cf9acc2#407aaaa2)
Compiling arrayvec v0.4.10
Compiling nodrop v0.1.13
Compiling rustc-hex v2.0.1
Compiling lazy_static v1.3.0
Compiling textwrap v0.11.0
Compiling log v0.4.6
Compiling rand_chacha v0.2.0
Compiling sgx_libc v1.0.8 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling sgx_tstd v1.0.8 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling c2-chacha v0.2.2
Compiling sgx_trts v1.0.8 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling sgx_tprotected_fs v1.0.8 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling sgx_alloc v1.0.8 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.8#bc2d7e24)
Compiling getrandom v0.1.6
Compiling atty v0.2.11
Compiling quote v0.6.12
Compiling clap v2.33.0
Compiling rand_core v0.5.0
Compiling rand v0.7.0
Compiling tempfile v3.1.0
Compiling serde_derive v1.0.94
Compiling serde_derive v1.0.91 (https://github.com/mesalock-linux/serde-sgx.git?rev=407aaaa2558dda5c2367d57ba40324c52cf9acc2#407aaaa2)
Compiling toml v0.4.10
Compiling serde_json v1.0.40
Compiling enigma-types v0.1.0 (/root/enigma-core/enigma-types)
Finished dev [unoptimized + debuginfo] target(s) in 1m 25s
bindgen Enclave_t.h --default-enum-style=rust --rust-target=nightly --no-recursive-whitelist --use-array-pointers-in-arguments --whitelist-function ocall_.* --raw-line "#![allow(dead_code)] use enigma_types::*; use sgx_types::*;" -- -I/opt/sgxsdk/include -I/root/sgx/edl > src/auto_ffi.rs
error: 'rustfmt' is not installed for the toolchain 'nightly-2019-05-20-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustfmt --toolchain nightly-2019-05-20-x86_64-unknown-linux-gnu`
info: backtrace:
Failed to run rustfmt: Internal rustfmt error (non-fatal, continuing)
rustfmt src/auto_ffi.rs
error: 'rustfmt' is not installed for the toolchain 'nightly-2019-05-20-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustfmt --toolchain nightly-2019-05-20-x86_64-unknown-linux-gnu`
info: backtrace:
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized::hb54f29b396d07e37 (0x562851370696)
1: backtrace::capture::Backtrace::new_unresolved::h289025d81070896f (0x562851370ad4)
2: error_chain::backtrace::imp::InternalBacktrace::new::h3f2b269fb36b9812 (0x56285136dc3e)
3: rustup::toolchain::Toolchain::create_command::ha0c90c42e934eb77 (0x5628512090e3)
4: rustup_init::main::hdd6ba4bb1a10ff0c (0x5628510d00bd)
5: std::rt::lang_start::{{closure}}::h85cf35c15cccdb2c (0x56285106a7e2)
6: main (0x5628510d1abd)
7: __libc_start_main (0x7fe2fb923b96)
8: <unknown> (0x562851065028)
Makefile:30: recipe for target 'bindgen' failed
make[1]: Leaving directory '/root/enigma-core/enigma-core/enclave'
make[1]: *** [bindgen] Error 1
Makefile:176: recipe for target 'enclave' failed
make: *** [enclave] Error 2
**** This is a known error. Ignore for now. Will succeed upon retry ***
mkdir -p ./lib
make -C ./enclave/ CARGO_FLAGS= Rust_target_dir=debug
make[1]: Entering directory '/root/enigma-core/enigma-core/enclave'
cargo build -p enigma-types # Meant to make sure `enigma-types.h` already exists and can be included.
Finished dev [unoptimized + debuginfo] target(s) in 0.11s
bindgen Enclave_t.h --default-enum-style=rust --rust-target=nightly --no-recursive-whitelist --use-array-pointers-in-arguments --whitelist-function ocall_.* --raw-line "#![allow(dead_code)] use enigma_types::*; use sgx_types::*;" -- -I/opt/sgxsdk/include -I/root/sgx/edl > src/auto_ffi.rs
error: 'rustfmt' is not installed for the toolchain 'nightly-2019-05-20-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustfmt --toolchain nightly-2019-05-20-x86_64-unknown-linux-gnu`
info: backtrace:
Failed to run rustfmt: Internal rustfmt error (non-fatal, continuing)
rustfmt src/auto_ffi.rs
error: 'rustfmt' is not installed for the toolchain 'nightly-2019-05-20-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustfmt --toolchain nightly-2019-05-20-x86_64-unknown-linux-gnu`
info: backtrace:
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized::hb54f29b396d07e37 (0x55dd44948696)
1: backtrace::capture::Backtrace::new_unresolved::h289025d81070896f (0x55dd44948ad4)
2: error_chain::backtrace::imp::InternalBacktrace::new::h3f2b269fb36b9812 (0x55dd44945c3e)
3: rustup::toolchain::Toolchain::create_command::ha0c90c42e934eb77 (0x55dd447e10e3)
4: rustup_init::main::hdd6ba4bb1a10ff0c (0x55dd446a80bd)
5: std::rt::lang_start::{{closure}}::h85cf35c15cccdb2c (0x55dd446427e2)
6: main (0x55dd446a9abd)
7: __libc_start_main (0x7fb91a60eb96)
8: <unknown> (0x55dd4463d028)
Makefile:30: recipe for target 'bindgen' failed
make[1]: Leaving directory '/root/enigma-core/enigma-core/enclave'
make[1]: *** [bindgen] Error 1
Makefile:176: recipe for target 'enclave' failed
make: *** [enclave] Error 2
lacabra commented 5 years ago

Got repos mixed up, this issue belongs to enigmampc/discovery-docker-network and is fixed in enigmampc/discovery-docker-network#26