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

Latest node template fails to build #14335

Closed

Description

@deepink-mas

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

Compiling the current main tip (commit 87b1b4728e29f68c6b2bafde7f3d0f4c8af9b302) of the node template results in this error:

   Compiling node-template-runtime v4.0.0-dev (/home/werk/Code/substrate-node-template/runtime)
error: failed to run custom build command for `node-template-runtime v4.0.0-dev (/home/werk/Code/substrate-node-template/runtime)`

Caused by:
  process didn't exit successfully: `/home/werk/Code/substrate-node-template/target/debug/build/node-template-runtime-5ecf88b7b75beaf9/build-script-build` (exit status: 1)
  --- stderr
  Cannot compile the WASM runtime: no compatible Rust compiler found!
  Install at least Rust 1.68.0 or a recent nightly version.
  • I am able to successfully compile commit tagged as polkadot-v0.9.40.
  • I am using rust 1.69 with wasm backend and nighly options enabled.

Steps to reproduce

substrate-node-template> git checkout 87b1b4728e29f68c6b2bafde7f3d0f4c8af9b302
substrate-node-template> cargo c

Activity

  1. deepink-mas commented on Jun 9, 2023

    @deepink-mas
    ContributorAuthor

    Some similar reports seem to be made here: #12791

  2. deepink-mas commented on Jun 9, 2023

    @deepink-mas
    ContributorAuthor

    In case this failure is related to #13580:

    • $ rustc --version
      rustc 1.69.0-nightly (84c898d65 2023-04-16) (gentoo)
    • $ cargo --version
      cargo 1.69.0-nightly
  3. deepink-mas commented on Jun 9, 2023

    @deepink-mas
    ContributorAuthor

    Version::extract("cargo 1.69.0-nightly").unwrap(); // panicked at 'called Option::unwrap() on a None value'

  4. deepink-mas commented on Jun 9, 2023

    @deepink-mas
    ContributorAuthor

    Since the checking code accepts any nightly a workaround is to: export RUSTC_BOOTSTRAP=1

  5. self-assigned this
    on Jun 11, 2023
  6. added
    I3-bugThe node fails to follow expected behavior.
    and removed
    J2-unconfirmedIssue might be valid, but it’s not yet known.
    on Jun 11, 2023
  7. jasl commented on Jun 27, 2023

    @jasl
    Contributor

    I got the same error, but the root cause may be different.

      The following warnings were emitted during compilation:
    
      warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
      warning: 1 error generated.
    
      error: failed to run custom build command for `secp256k1-sys v0.6.1`
    
      Caused by:
        process didn't exit successfully: `/Users/jasl/Workspaces/BlockChain/cybros-network/target/release/wbuild/cybros-primal-runtime/target/release/build/secp256k1-sys-9d0d23adcf50967f/build-script-build` (exit status: 1)
        --- stdout
        TARGET = Some("wasm32-unknown-unknown")
        OPT_LEVEL = Some("3")
        HOST = Some("aarch64-apple-darwin")
        cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
        CC_wasm32-unknown-unknown = None
        cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
        CC_wasm32_unknown_unknown = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
        CFLAGS_wasm32-unknown-unknown = None
        cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
        CFLAGS_wasm32_unknown_unknown = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        DEBUG = Some("false")
        cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
        CC_wasm32-unknown-unknown = None
        cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
        CC_wasm32_unknown_unknown = None
        cargo:rerun-if-env-changed=TARGET_CC
        TARGET_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
        CFLAGS_wasm32-unknown-unknown = None
        cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
        CFLAGS_wasm32_unknown_unknown = None
        cargo:rerun-if-env-changed=TARGET_CFLAGS
        TARGET_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/jasl/Workspaces/BlockChain/cybros-network/target/release/wbuild/cybros-primal-runtime/target/wasm32-unknown-unknown/release/build/secp256k1-sys-1854092b76a525fb/out/wasm/wasm.o" "-c" "wasm/wasm.c"
        cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
        cargo:warning=1 error generated.
        exit status: 1
    
        --- stderr
    
    
        error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/jasl/Workspaces/BlockChain/cybros-network/target/release/wbuild/cybros-primal-runtime/target/wasm32-unknown-unknown/release/build/secp256k1-sys-1854092b76a525fb/out/wasm/wasm.o" "-c" "wasm/wasm.c" with args "clang" did not execute successfully (status code exit status: 1).
    
    
      warning: build failed, waiting for other jobs to finish...
    warning: build failed, waiting for other jobs to finish...
    

    I know the error. It only occurs on macOS with Xcode bundled LLVM, and the WASM target has C binding crates. Changing to the Homebrew LLVM will solve the problem. It's just annoying.

    The problem introduced to node-template from #14452

  8. bkchr commented on Jun 27, 2023

    @bkchr
    Member

    @jasl yes this is not related and is caused by the pr you linked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

I3-bugThe node fails to follow expected behavior.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions