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

Build failing on master branch #4978

Closed
jbrukh opened this issue Feb 18, 2020 · 16 comments
Closed

Build failing on master branch #4978

jbrukh opened this issue Feb 18, 2020 · 16 comments

Comments

@jbrukh
Copy link

jbrukh commented Feb 18, 2020

When running cargo install --force --git http://github.com/paritytech/substrate subkey, I get the following build error:

error: `core::slice::<impl [T]>::len` is not yet stable as a const fn
   --> /Users/jbrukh/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.4/src/bytes.rs:130:18
    |
130 |             len: bytes.len(),
    |                  ^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `bytes`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `subkey v2.0.0 (http://github.com/paritytech/substrate#dc92587b)`, intermediate artifacts can be found at `/var/folders/bv/lgq40k393ybf6pjnb9ytvwh40000gn/T/cargo-installDQcd6b`

Caused by:
  build failed

Not a rust expert, would appreciate any advice. Looks like a dependency issue or perhaps my dependencies may be out of date.

@NikVolf
Copy link
Contributor

NikVolf commented Feb 19, 2020

What is rust version you are using? You can update it with rustup update.

@jbrukh
Copy link
Author

jbrukh commented Feb 19, 2020

1.37.0. Using rustup to get up to 1.41.0 and will report back.

@bjornwgnr
Copy link
Member

@joepetrowski Please have a look & give @jbrukh assistance if he still have issues after upgrading. Thanks.

@emkman
Copy link

emkman commented Feb 19, 2020

I am having similar issues, trying to upgrade from an older substrate/subkey for latest edgeware flags.

  • first I got use of unstable library errors and rustup update fixed that
  • next I got Rust nightly not installed, please install it! and rustup toolchain install nightly fixed that
  • now I am getting Rust WASM toolchain not installed, please install it! which seems to be related to wasm builder fails when running with a specific toolchain #3492

I am on OS X Catalina 10.15.2

@joepetrowski
Copy link
Contributor

Can you try running this first?

curl https://getsubstrate.io -sSf | bash -s -- --fast

I just ran that and then

cargo install --force --git https://github.com/paritytech/substrate subkey

And it worked fine.

@emkman
Copy link

emkman commented Feb 19, 2020

@joepetrowsk I can't speak for @jbrukh but that is what I've been doing. The first command just updates all my brew packages and then exits.

I've also tried pulling the repo manually and building with cargo. In both cases, I am now stuck on the WASM error.

@emkman
Copy link

emkman commented Feb 19, 2020

@joepetrowski I ran again a few times and found there to be some unrelated issues with homebrew that were blocking the script.

It doesn't seem to recognize certain brew exits as errors and unfortunately because it tries to update every single package, even those unrelated to substrate, there is a wide error surface. For instance, in my case there was a breaking change to an ocaml packge. I had to manually remove it and rerun the script and now it works. I never knew previously that the script hadn't finished.

After resolving this issue my build succeeded with cargo install --force --git https://github.com/paritytech/substrate subkey

Thanks.

@emkman
Copy link

emkman commented Feb 19, 2020

As a side note, how is subkey versioned? Running subkey --version before and after both show subkey 2.0.0 despite the previous version being over 6 months old. Perhaps the commit hash should be included if not using semver.

@joepetrowski
Copy link
Contributor

Versioning will be coming soon. For the last several months, Substrate has been changing so fast that there was no semver, so everything was "pre-2.0". We will be releasing 2.0 shortly though.

@xlc
Copy link
Contributor

xlc commented Feb 20, 2020

I am getting a different build issue on Substrate master, possibly caused by latest nightly rustc 1.43.0-nightly (7760cd0fb 2020-02-19)

   Compiling wasm-bindgen-macro-support v0.2.58
   Compiling wasm-bindgen-macro v0.2.58
   Compiling regex v1.3.4
   Compiling js-sys v0.3.35
   Compiling paste-impl v0.1.6
error[E0603]: struct `Memory` is private
    --> /Users/xiliangchen/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:4873:60
     |
4873 |                 let mem = buf.unchecked_ref::<WebAssembly::Memory>();
     |                                                            ^^^^^^ this struct is private
     |
note: the struct `Memory` is defined here
    --> /Users/xiliangchen/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:3516:5
     |
3516 |     #[wasm_bindgen]
     |     ^^^^^^^^^^^^^^^
     = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0603]: struct `Memory` is private
    --> /Users/xiliangchen/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:4898:60
     |
4898 |                 let mem = buf.unchecked_ref::<WebAssembly::Memory>();
     |                                                            ^^^^^^ this struct is private
     |
note: the struct `Memory` is defined here
    --> /Users/xiliangchen/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:3516:5
     |
3516 |     #[wasm_bindgen]
     |     ^^^^^^^^^^^^^^^
     = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0603]: struct `Memory` is private
    --> /Users/xiliangchen/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:4908:60
     |
4908 |                 let mem = buf.unchecked_ref::<WebAssembly::Memory>();
     |                                                            ^^^^^^ this struct is private
     |
note: the struct `Memory` is defined here
    --> /Users/xiliangchen/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:3516:5
     |
3516 |     #[wasm_bindgen]
     |     ^^^^^^^^^^^^^^^
     = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0603`.
error: could not compile `js-sys`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

@riusricardo
Copy link
Contributor

riusricardo commented Feb 20, 2020

I'm getting the same error as @xlc

rustc 1.41.0 (5e1a79984 2020-01-27)
rustc 1.43.0-nightly (7760cd0fb 2020-02-19)

EDIT:
I can confirm that I'm getting a nightly issue.
It builds if I use:

rustc 1.43.0-nightly (5e7af4669 2020-02-16)

@jbrukh
Copy link
Author

jbrukh commented Feb 20, 2020

Thanks @joepetrowski and thanks @emkman, I went through exactly the same steps and got the same errors. Then I just ran the recommended install command curl https://getsubstrate.io -sSf | bash and got:

Compiling js-sys v0.3.35
error[E0603]: struct `Memory` is private
    --> /Users/jbrukh/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:4873:60
     |
4873 |                 let mem = buf.unchecked_ref::<WebAssembly::Memory>();
     |                                                            ^^^^^^ this struct is private
     |
note: the struct `Memory` is defined here
    --> /Users/jbrukh/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:3516:5
     |
3516 |     #[wasm_bindgen]
     |     ^^^^^^^^^^^^^^^
     = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0603]: struct `Memory` is private
    --> /Users/jbrukh/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:4898:60
     |
4898 |                 let mem = buf.unchecked_ref::<WebAssembly::Memory>();
     |                                                            ^^^^^^ this struct is private
     |
note: the struct `Memory` is defined here
    --> /Users/jbrukh/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:3516:5
     |
3516 |     #[wasm_bindgen]
     |     ^^^^^^^^^^^^^^^
     = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0603]: struct `Memory` is private
    --> /Users/jbrukh/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:4908:60
     |
4908 |                 let mem = buf.unchecked_ref::<WebAssembly::Memory>();
     |                                                            ^^^^^^ this struct is private
     |
note: the struct `Memory` is defined here
    --> /Users/jbrukh/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.35/src/lib.rs:3516:5
     |
3516 |     #[wasm_bindgen]
     |     ^^^^^^^^^^^^^^^
     = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0603`.
error: could not compile `js-sys`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

warning: build failed, waiting for other jobs to finish...
error: failed to compile `node-cli v2.0.0 (/private/var/folders/bv/lgq40k393ybf6pjnb9ytvwh40000gn/T/tmp.6dCfbyWl/bin/node/cli)`, intermediate artifacts can be found at `/private/var/folders/bv/lgq40k393ybf6pjnb9ytvwh40000gn/T/tmp.6dCfbyWl/target`

Caused by:
  build failed

My goal is to just get the latest version of subkey.

@joepetrowski
Copy link
Contributor

@jbrukh seems to be an issue with latest rust nightly. That install command builds everything. Try:

$ curl https://getsubstrate.io -sSf | bash -s -- --fast
$ rustup install nightly-2020-02-17
$ cargo install --force --git https://github.com/paritytech/substrate subkey

@riusricardo
Copy link
Contributor

riusricardo commented Feb 20, 2020

Complementing Joe's answer:

$ curl https://getsubstrate.io -sSf | bash -s -- --fast
$ rustup install nightly-2020-02-17
$ rustup target add wasm32-unknown-unknown --toolchain nightly-2020-02-17
$ cargo +nightly-2020-02-17 install --force --git https://github.com/paritytech/substrate subkey

@jbrukh
Copy link
Author

jbrukh commented Feb 24, 2020

Thanks @joepetrowski and @riusricardo for the support! This worked for me, so I am resolving the ticket.

@jbrukh jbrukh closed this as completed Feb 24, 2020
@dmpierre
Copy link

Hey :)

Still not working for me..

I am using Ubuntu Release 18.04

$ rustup show

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-2020-02-17-x86_64-unknown-linux-gnu (default)
rustc 1.43.0-nightly (5e7af4669 2020-02-16)

Here are the logs I get:

error[E0658]: `while` is not allowed in a `const fn`
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:107:9
    |
107 | /         while i < encode.len() {
108 | |             if base[i] >= 128 {
109 | |                 return Err(Error::NonAsciiCharacter { index: i });
110 | |             }
...   |
120 | |             i += 1;
121 | |         }
    | |_________^
    |
    = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
    = help: add `#![feature(const_loop)]` to the crate attributes to enable
    = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0658]: `if` is not allowed in a `const fn`
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:108:13
    |
108 | /             if base[i] >= 128 {
109 | |                 return Err(Error::NonAsciiCharacter { index: i });
110 | |             }
    | |_____________^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
    = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0658]: `if` is not allowed in a `const fn`
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:111:13
    |
111 | /             if decode[base[i] as usize] != 0xFF {
112 | |                 return Err(Error::DuplicateCharacter {
113 | |                     character: base[i] as char,
114 | |                     first: decode[base[i] as usize] as usize,
115 | |                     second: i,
116 | |                 });
117 | |             }
    | |_____________^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
    = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0658]: `match` is not allowed in a `const fn`
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:156:12
    |
156 |           [][match result {
    |  ____________^
157 | |             Ok(alphabet) => return alphabet,
158 | |             Err(_) => 0,
159 | |         }]
    | |_________^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
    = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `bs58`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `subkey v2.0.0 (https://github.com/paritytech/substrate#3c1c49e8)`, intermediate artifacts can be found at `/tmp/cargo-installdn9JpJ`

Caused by:
  build failed

Do you have any idea?

Thanks :)

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

8 participants