Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

errors: unresolved imports no BTreeMap or BTreeSet in the root, and no field idx on type &_ #289

Closed
ltfschoen opened this issue Jul 9, 2018 · 2 comments

Comments

@ltfschoen
Copy link
Contributor

If I try to clone and build the latest Polkadot client on macOS 10.13.4 using the 'master' branch using the following steps, it produces errors when it runs the ./build.sh step, as shown below:

Commands used in sequence (copy/paste):

git clone https://github.com/paritytech/polkadot;
cd polkadot;
git checkout master;
rustup update nightly;
rustup target add wasm32-unknown-unknown --toolchain nightly;
rustup update stable;
rustup default stable;
cargo install --git https://github.com/alexcrichton/wasm-gc --force;
cargo install --git https://github.com/pepyakin/wasm-export-table.git --force;
brew install openssl; brew upgrade openssl;

rustc --version; cargo --version;
./build.sh;
cargo build;

Error when ./build.sh; is run:

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ git checkout master;
Already on 'master'
Your branch is up to date with 'origin/master'.

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ rustup update nightly;
info: syncing channel updates for 'nightly-x86_64-apple-darwin'

  nightly-x86_64-apple-darwin unchanged - rustc 1.29.0-nightly (960f6046c 2018-07-08)

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ rustup target add wasm32-unknown-unknown --toolchain nightly;
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ rustup update stable;
info: syncing channel updates for 'stable-x86_64-apple-darwin'

  stable-x86_64-apple-darwin unchanged - rustc 1.27.0 (3eda71b00 2018-06-19)

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ rustup default stable;
info: using existing install for 'stable-x86_64-apple-darwin'
info: default toolchain set to 'stable-x86_64-apple-darwin'

  stable-x86_64-apple-darwin unchanged - rustc 1.27.0 (3eda71b00 2018-06-19)


 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ cargo install --git https://github.com/alexcrichton/wasm-gc --force;
    Updating git repository `https://github.com/alexcrichton/wasm-gc`
  Installing wasm-gc v0.1.6 (https://github.com/alexcrichton/wasm-gc#e4d27db9)  
   Compiling cfg-if v0.1.4
   Compiling byteorder v1.2.3
   Compiling quick-error v1.2.2
   Compiling libc v0.2.41
   Compiling rustc-demangle v0.1.8
   Compiling termcolor v0.3.6
   Compiling unicode-width v0.1.5
   Compiling log v0.4.3
   Compiling humantime v1.1.1
   Compiling atty v0.2.10
   Compiling parity-wasm v0.31.0
   Compiling getopts v0.2.18
   Compiling env_logger v0.5.10
   Compiling wasm-gc-api v0.1.6 (https://github.com/alexcrichton/wasm-gc#e4d27db9)
   Compiling wasm-gc v0.1.6 (https://github.com/alexcrichton/wasm-gc#e4d27db9)
    Finished release [optimized] target(s) in 2m 29.26s
   Replacing ~/.cargo/bin/wasm-gc

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ cargo install --git https://github.com/pepyakin/wasm-export-table.git --force;
    Updating git repository `https://github.com/pepyakin/wasm-export-table.git`
  Installing wasm-export-table v0.1.0 (https://github.com/pepyakin/wasm-export-table.git#3e110191)
   Compiling libc v0.2.39
   Compiling cfg-if v0.1.2
   Compiling smallvec v0.6.0
   Compiling stable_deref_trait v1.0.0
   Compiling byteorder v1.2.1
   Compiling log v0.4.1
   Compiling owning_ref v0.3.3
   Compiling log v0.3.9
   Compiling rand v0.4.2
   Compiling parking_lot_core v0.2.13
   Compiling parking_lot v0.5.4
   Compiling parity-wasm v0.27.1
   Compiling wasm-export-table v0.1.0 (https://github.com/pepyakin/wasm-export-table.git#3e110191)
    Finished release [optimized] target(s) in 26.40s
   Replacing ~/.cargo/bin/wasm-export-table

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ brew install openssl; brew upgrade openssl;
Warning: openssl 1.0.2o_2 is already installed and up-to-date
To reinstall 1.0.2o_2, run `brew reinstall openssl`
Error: openssl 1.0.2o_2 already installed

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ 

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ rustc --version; cargo --version;
rustc 1.27.0 (3eda71b00 2018-06-19)
cargo 1.27.0 (1e95190e5 2018-05-27)

 LS@Ls ~/code/blockchain/clones/paritytech/temp/polkadot [git:master]
$ ./build.sh;
*** Building wasm binaries in polkadot/runtime/wasm
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling semver-parser v0.7.0                                                                                                           
   Compiling pwasm-libc v0.1.0 (file://~/code/blockchain/clones/paritytech/temp/polkadot/substrate/pwasm-libc)                      
   Compiling nodrop v0.1.12                                                                                                                 
   Compiling crunchy v0.1.6                                                                                                                 
   Compiling serde v1.0.64                                                                                                                  
   Compiling byteorder v1.2.3                                                                                                               
   Compiling fixed-hash v0.1.3 (https://github.com/rphmeier/primitives.git?branch=compile-for-wasm#8dc45789)                                
   Compiling rustc-hex v2.0.0 (https://github.com/rphmeier/rustc-hex.git#ee2ec40b)                                                          
   Compiling num-traits v0.2.4                                                                                                              
   Compiling proc-macro-hack-impl v0.4.0                                                                                                    
   Compiling integer-sqrt v0.1.0 (https://github.com/paritytech/integer-sqrt-rs.git#886e9cb9)                                               
   Compiling cfg-if v0.1.3                                                                                                                  
   Compiling arrayvec v0.4.7                                                                                                                
   Compiling parity-wasm v0.30.0                                                                                                            
   Compiling semver v0.9.0                                                                                                                  
   Compiling log v0.4.1                                                                                                                     
   Compiling substrate-codec v0.1.0 (file://~/code/blockchain/clones/paritytech/temp/polkadot/substrate/codec)                      
   Compiling rustc_version v0.2.2                                                                                                           
   Compiling proc-macro-hack v0.4.0                                                                                                         
   Compiling pwasm-alloc v0.1.0 (file://~/code/blockchain/clones/paritytech/temp/polkadot/substrate/pwasm-alloc)                    
   Compiling substrate-runtime-std v0.1.0 (file://~/code/blockchain/clones/paritytech/temp/polkadot/substrate/runtime-std)          
   Compiling uint v0.1.2 (https://github.com/rphmeier/primitives.git?branch=compile-for-wasm#8dc45789)                                      
   Compiling substrate-runtime-io v0.1.0 (file://~/code/blockchain/clones/paritytech/temp/polkadot/substrate/runtime-io)            
   Compiling safe-mix v0.1.0 (file://~/code/blockchain/clones/paritytech/temp/polkadot/safe-mix)                                    
   Compiling substrate-runtime-sandbox v0.1.0 (file://~/code/blockchain/clones/paritytech/temp/polkadot/substrate/runtime-sandbox)  
   Compiling pwasm-utils v0.2.0                                                                                                             
   Compiling hex-literal-impl v0.1.1                                                                                                        
error[E0432]: unresolved import `alloc::BTreeMap`                      ] 32/62: serde, pwasm-utils, hex-literal-impl, pwasm-alloc           
  --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/pwasm-utils-0.2.0/src/lib.rs:39:19
   |
39 |         pub use alloc::{BTreeMap, BTreeSet};
   |                         ^^^^^^^^ no `BTreeMap` in the root

error[E0432]: unresolved import `alloc::BTreeSet`
  --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/pwasm-utils-0.2.0/src/lib.rs:39:29
   |
39 |         pub use alloc::{BTreeMap, BTreeSet};
   |                                   ^^^^^^^^ no `BTreeSet` in the root

error[E0609]: no field `idx` on type `&_`=====>                        ] 36/62: serde, pwasm-utils, hex-literal-impl, substrate-runtime...  
   --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/pwasm-utils-0.2.0/src/stack_height/thunk.rs:136:6
    |
136 |                 .idx
    |                  ^^^

error: aborting due to 3 previous errors

Some errors occurred: E0432, E0609.
For more information about an error, try `rustc --explain E0432`.
error: Could not compile `pwasm-utils`.                                                                                                     
warning: build failed, waiting for other jobs to finish...
error: build failed                         
@pepyakin
Copy link
Contributor

pepyakin commented Jul 9, 2018

This is because BTreeSet and BTreeMap were moved in alloc crate. I will file PR soon.

@NikVolf
Copy link
Contributor

NikVolf commented Jul 9, 2018

pwasm-utils already fixed

lamafab pushed a commit to lamafab/substrate that referenced this issue Jun 16, 2020
JoshOrndorff added a commit to moonbeam-foundation/substrate that referenced this issue Apr 21, 2021
liuchengxu pushed a commit to chainx-org/substrate that referenced this issue Aug 23, 2021
helin6 pushed a commit to boolnetwork/substrate that referenced this issue Jul 25, 2023
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants