Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Build core fails due to dependency error #119

Closed
lacabra opened this issue Apr 12, 2019 · 4 comments · Fixed by #120
Closed

Build core fails due to dependency error #119

lacabra opened this issue Apr 12, 2019 · 4 comments · Fixed by #120

Comments

@lacabra
Copy link
Contributor

lacabra commented Apr 12, 2019

Describe the bug
Seemingly out of the blue, trying to build core on the develop branch now fails with the following error:

error: failed to parse manifest at `/root/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-demangle-0.1.14/Cargo.toml`                                                 

Caused by:
  feature `rename-dependency` is required

consider adding `cargo-features = ["rename-dependency"]` to the manifest

To Reproduce
Steps to reproduce the behavior:

  1. In the discovery-integration-tests, try to build the core container with:
docker-compose build core

which essentially runs the following commands on core.

cd enigma-core/enigma-core
make full-clean
make DEBUG=1

Expected behavior
The build should succeed.

Backtrace

root@core:~/enigma-core# cd enigma-core
root@core:~/enigma-core/enigma-core# . /opt/sgxsdk/environment && . /root/.cargo/env 
root@core:~/enigma-core/enigma-core# make full-clean
root@core:~/enigma-core/enigma-core# make DEBUG=1
mkdir -p ./lib
make -C ./enclave/ CARGO_FLAGS=  Rust_target_dir=debug
make[1]: Entering directory '/root/enigma-core/enigma-core/enclave'
cargo build 
    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/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/enigmampc/primitives.git`                                                                                                   
    Updating git repository `https://github.com/enigmampc/rustc-hex.git`                                                                                                    
    Updating git repository `https://github.com/enigmampc/treediff-rs.git`                                                                                                  
   Compiling proc-macro2 v0.4.27                                                                                                                                            
   Compiling unicode-xid v0.1.0                                                                                                                                             
   Compiling autocfg v0.1.2                                                                                                                                                 
   Compiling libc v0.2.51                                                                                                                                                   
   Compiling syn v0.15.30                                                                                                                                                   
   Compiling rand_core v0.4.0                                                                                                                                               
   Compiling typenum v1.10.0                                                                                                                                                
   Compiling serde v1.0.90                                                                                                                                                  
   Compiling ryu v0.2.7                                                                                                                                                     
   Compiling unicode-width v0.1.5                                                                                                                                           
   Compiling vec_map v0.8.1                                                                                                                                                 
   Compiling cfg-if v0.1.7                                                                                                                                                  
   Compiling strsim v0.8.0                                                                                                                                                  
   Compiling remove_dir_all v0.5.1                                                                                                                                          
   Compiling sgx_unwind v0.0.1 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                              
   Compiling bitflags v1.0.4                                                                                                                                                
   Compiling sgx_build_helper v0.1.0 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                        
   Compiling nodrop v0.1.13                                                                                                                                                 
   Compiling itoa v0.4.3                                                                                                                                                    
   Compiling crunchy v0.1.6                                                                                                                                                 
   Compiling sgx_types v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                               
   Compiling ansi_term v0.11.0                                                                                                                                              
   Compiling constant_time_eq v0.1.3                                                                                                                                        
   Compiling byteorder v1.3.1                                                                                                                                               
   Compiling byte-tools v0.3.1                                                                                                                                              
   Compiling failure_derive v0.1.5                                                                                                                                          
   Compiling cc v1.0.35                                                                                                                                                     
   Compiling serde v1.0.71 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                                  
   Compiling byte-tools v0.2.0                                                                                                                                              
   Compiling arrayvec v0.4.10                                                                                                                                               
   Compiling fixed-hash v0.2.5                                                                                                                                              
   Compiling rustc-hex v2.0.1                                                                                                                                               
   Compiling spin v0.4.10                                                                                                                                                   
   Compiling fake-simd v0.1.2                                                                                                                                               
   Compiling opaque-debug v0.2.2                                                                                                                                            
   Compiling elastic-array-plus v0.10.0                                                                                                                                     
   Compiling etcommon-hexutil v0.2.4                                                                                                                                        
   Compiling arrayref v0.3.5                                                                                                                                                
   Compiling rand v0.4.6                                                                                                                                                    
   Compiling untrusted v0.6.2                                                                                                                                               
   Compiling hashmap_core v0.1.9                                                                                                                                            
   Compiling libm v0.1.2                                                                                                                                                    
   Compiling memory_units v0.3.0                                                                                                                                            
   Compiling rand_core v0.3.1                                                                                                                                               
   Compiling rand_jitter v0.1.3                                                                                                                                             
   Compiling rand_pcg v0.1.2                                                                                                                                                
   Compiling rand_chacha v0.1.1                                                                                                                                             
   Compiling rand v0.6.5                                                                                                                                                    
   Compiling log v0.4.6                                                                                                                                                     
   Compiling textwrap v0.11.0                                                                                                                                               
   Compiling block-padding v0.1.3                                                                                                                                           
   Compiling sgx_tstd v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                                
   Compiling sgx_trts v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                                
   Compiling sgx_tcrypto v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                             
   Compiling sgx_tse v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                                 
   Compiling lazy_static v1.2.0                                                                                                                                             
   Compiling rand_xorshift v0.1.1                                                                                                                                           
   Compiling rand_isaac v0.1.1                                                                                                                                              
   Compiling rand_hc v0.1.0                                                                                                                                                 
   Compiling ring v0.14.3 (https://github.com/elichai/ring.git?rev=sgx-manual#8f2bee8c)                                                                                     
   Compiling sgx_tprotected_fs v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                       
   Compiling sgx_alloc v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                               
   Compiling sgx_tseal v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                               
   Compiling tiny-keccak v1.4.2                                                                                                                                             
   Compiling uint v0.4.1                                                                                                                                                    
   Compiling etcommon-rlp v0.2.4                                                                                                                                            
   Compiling parity-wasm v0.31.3 (https://github.com/enigmampc/parity-wasm.git?branch=enigma#faeef762)                                                                      
   Compiling rand_os v0.1.3                                                                                                                                                 
   Compiling atty v0.2.11                                                                                                                                                   
   Compiling ethbloom v0.5.1 (https://github.com/enigmampc/primitives.git?rev=sgx-v0.4.0#35df127e)                                                                          
   Compiling generic-array v0.8.3                                                                                                                                           
   Compiling generic-array v0.12.0                                                                                                                                          
   Compiling clap v2.33.0                                                                                                                                                   
   Compiling etcommon-bigint v0.2.10                                                                                                                                        
   Compiling quote v0.6.12                                                                                                                                                  
   Compiling crypto-mac v0.4.0                                                                                                                                              
   Compiling digest v0.6.2                                                                                                                                                  
   Compiling block-buffer v0.2.0                                                                                                                                            
   Compiling block-buffer v0.7.0                                                                                                                                            
   Compiling digest v0.8.0                                                                                                                                                  
   Compiling syn v0.14.9                                                                                                                                                    
   Compiling tempfile v3.0.7                                                                                                                                                
   Compiling hmac v0.4.2                                                                                                                                                    
   Compiling sha2 v0.6.0                                                                                                                                                    
   Compiling sha3 v0.6.0                                                                                                                                                    
   Compiling ripemd160 v0.6.0                                                                                                                                               
   Compiling sha2 v0.8.0                                                                                                                                                    
   Compiling itoa v0.4.1 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                                    
   Compiling num-traits v0.2.5 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                              
   Compiling byteorder v1.2.1 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                               
   Compiling dtoa v0.4.2 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                                    
   Compiling rustc-hex v2.0.1 (https://github.com/enigmampc/rustc-hex.git?rev=sgx-2.0.1-v1.0.4#270d72d1)                                                                    
   Compiling error-chain v0.12.0 (https://github.com/enigmampc/error-chain.git?rev=sgx-0.12.0#6bfcc339)                                                                     
   Compiling pwasm-utils v0.5.0 (https://github.com/enigmampc/wasm-utils.git#9fe1db0c)                                                                                      
   Compiling sgx_tunittest v1.0.4 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                           
   Compiling hmac-drbg v0.1.2                                                                                                                                               
   Compiling etcommon-block-core v0.3.0                                                                                                                                     
   Compiling wasmi v0.4.2 (https://github.com/enigmampc/wasmi#cf901b5b)                                                                                                     
   Compiling rmp v0.8.7 (https://github.com/enigmampc/msgpack-rust.git?rev=sgx-v1.0.4#0a43052c)                                                                             
   Compiling ethereum-types v0.4.0 (https://github.com/enigmampc/primitives.git?rev=sgx-v0.4.0#35df127e)                                                                    
   Compiling libsecp256k1 v0.2.2                                                                                                                                            
   Compiling serde_derive v1.0.71 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                           
   Compiling sputnikvm v0.10.1 (https://github.com/enigmampc/sputnikvm.git?rev=enigma-next#ef68f18f)                                                                        
   Compiling sputnikvm-network-classic v0.10.0 (https://github.com/enigmampc/sputnikvm.git?rev=enigma-next#ef68f18f)                                                        
   Compiling serde_derive v1.0.90                                                                                                                                           
   Compiling synstructure v0.10.1                                                                                                                                           
   Compiling log-derive v0.2.4                                                                                                                                              
   Compiling failure v0.1.5                                                                                                                                                 
   Compiling serde_json v1.0.24 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.4#212d9f4b)                                                                             
   Compiling rmp-serde v0.14.0 (https://github.com/enigmampc/msgpack-rust.git?rev=sgx-v1.0.4#0a43052c)                                                                      
   Compiling treediff v3.0.1 (https://github.com/enigmampc/treediff-rs.git?rev=sgx-v3.0.1-v1.0.4#de7cb9b5)                                                                  
   Compiling ethabi v6.1.0 (https://github.com/enigmampc/ethabi.git?rev=sgx-v6.1.0#085f0067)                                                                                
   Compiling json-patch v0.2.2 (https://github.com/enigmampc/json-patch.git?rev=sgx-0.2.2-v1.0.4#50b13ae0)                                                                  
   Compiling toml v0.4.10                                                                                                                                                   
   Compiling serde_json v1.0.39                                                                                                                                             
   Compiling cbindgen v0.8.3                                                                                                                                                
   Compiling enigma-types v0.1.0 (/root/enigma-core/enigma-types)                                                                                                           
   Compiling enigma-crypto v0.1.0 (/root/enigma-core/enigma-crypto)                                                                                                         
   Compiling enigma-tools-m v0.1.0 (/root/enigma-core/enigma-tools-m)                                                                                                       
   Compiling enigma-tools-t v0.1.3 (/root/enigma-core/enigma-tools-t)                                                                                                       
warning: unused `#[macro_use]` import                                                                                                                                       
  --> /root/enigma-core/enigma-tools-t/src/lib.rs:19:1                                                                                                                      
   |                                                                                                                                                                        
19 | #[macro_use]                                                                                                                                                           
   | ^^^^^^^^^^^^                                                                                                                                                           
   |                                                                                                                                                                        
   = note: #[warn(unused_imports)] on by default                                                                                                                            
                                                                                                                                                                            
warning: unused extern crate                                                                                                                                                
  --> /root/enigma-core/enigma-tools-t/src/lib.rs:18:1                                                                                                                      
   |                                                                                                                                                                        
18 | extern crate rmp_serde;                                                                                                                                                
   | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove it                                                                                                                                
   |                                                                                                                                                                        
note: lint level defined here                                                                                                                                               
  --> /root/enigma-core/enigma-tools-t/src/lib.rs:5:9                                                                                                                       
   |                                                                                                                                                                        
5  | #![warn(unused_extern_crates)]                                                                                                                                         
   |         ^^^^^^^^^^^^^^^^^^^^                                                                                                                                           
                                                                                                                                                                            
warning: unused extern crate                                                                                                                                                
  --> /root/enigma-core/enigma-tools-t/src/lib.rs:21:1                                                                                                                      
   |                                                                                                                                                                        
21 | extern crate serde_json;                                                                                                                                               
   | ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it                                                                                                                               
                                                                                                                                                                            
warning: unused extern crate                                                                                                                                                
  --> /root/enigma-core/enigma-tools-t/src/lib.rs:22:1                                                                                                                      
   |                                                                                                                                                                        
22 | extern crate sgx_trts;                                                                                                                                                 
   | ^^^^^^^^^^^^^^^^^^^^^^ help: remove it                                                                                                                                 
                                                                                                                                                                            
warning: variable does not need to be mutable                                                                                                                               
   --> /root/enigma-core/enigma-tools-t/src/document_storage_t.rs:132:13                                                                                                    
    |                                                                                                                                                                       
132 |         let mut doc: SealedDocumentStorage<[u8; 32]> = SealedDocumentStorage {                                                                                        
    |             ----^^^                                                                                                                                                   
    |             |                                                                                                                                                         
    |             help: remove this `mut`                                                                                                                                   
    |                                                                                                                                                                       
    = note: #[warn(unused_mut)] on by default                                                                                                                               
                                                                                                                                                                            
warning: unused `core::result::Result` which must be used                                                                                                                   
   --> /root/enigma-core/enigma-tools-t/src/storage_t.rs:127:21                                                                                                             
    |                                                                                                                                                                       
127 |                     remove_file(sealed_path);                                                                                                                         
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                         
    |                                                                                                                                                                       
    = note: #[warn(unused_must_use)] on by default                                                                                                                          
    = note: this `Result` may be an `Err` variant, which should be handled                                                                                                  
                                                                                                                                                                            
   Compiling enigma-runtime-t v0.1.0 (/root/enigma-core/enigma-runtime-t)                                                                                                   
   Compiling enigma-core-enclave v0.1.3 (/root/enigma-core/enigma-core/enclave)                                                                                             
warning: function is never used: `encrypt_delta`                                                                                                                            
  --> src/km_t/mod.rs:26:1                                                                                                                                                  
   |                                                                                                                                                                        
26 | pub fn encrypt_delta(del: StatePatch) -> Result<EncryptedPatch, EnclaveError> {                                                                                        
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                          
   |                                                                                                                                                                        
   = note: #[warn(dead_code)] on by default                                                                                                                                 
                                                                                                                                                                            
    Finished dev [unoptimized + debuginfo] target(s) in 52.54s                                                                                                              
cp ./target/debug/libenigmacoreenclave.a ../lib/libenclave.a
make[1]: Leaving directory '/root/enigma-core/enigma-core/enclave'
make -C /root/sgx/compiler-rt/ 2> /dev/null
make[1]: Entering directory '/root/sgx/compiler-rt'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/root/sgx/compiler-rt'
/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
CC   <=  enclave/Enclave_t.c
ar rcsD app/libEnclave_u.a app/Enclave_u.o
cp app/libEnclave_u.a ./lib
    Updating crates.io index
    Updating git repository `https://github.com/3Hren/msgpack-rust.git`
    Updating git repository `https://github.com/baidu/rust-sgx-sdk.git`                                                                                                     
    Updating git repository `https://github.com/elichai/ring.git`                                                                                                           
    Updating git repository `https://github.com/tomusdrw/rust-web3.git`                                                                                                     
error: failed to parse manifest at `/root/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-demangle-0.1.14/Cargo.toml`                                                 

Caused by:
  feature `rename-dependency` is required

consider adding `cargo-features = ["rename-dependency"]` to the manifest
Makefile:119: recipe for target 'enigma-core-app' failed
make: *** [enigma-core-app] Error 101
@lacabra
Copy link
Contributor Author

lacabra commented Apr 15, 2019

Seems like it is this very same issue that was reported solved months ago. The appearance of this error coincides with the release of version 0.1.14 of the dependency rustc-demangle 3 days ago, when this issue was reported.

@lacabra
Copy link
Contributor Author

lacabra commented Apr 15, 2019

I confirm that it seems to be something wrong with version 0.1.14 of rustc-demangle, as adding the following to enigma-core/app/Cargo.toml fixes the build:

rustc-demangle = "<0.1.14"

@elichai
Copy link
Contributor

elichai commented Apr 15, 2019

Yep. This always happens when our compiler version gets too old.

Your solution should work, it's not the maintainers fault, because even if he uses cfg's to check for compiler featutes/version it won't work because by our compiler "version number" this feature should be stable already but it's a nightly from before it was stable.
#94 will fix this for another few months.

@lacabra
Copy link
Contributor Author

lacabra commented Apr 15, 2019

Added as a small commit to #118 because after fixing this issue, core wouldn't build for me unless I fixed #118 as well.

Alternatively, add it wherever it makes sense.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants