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

Latest node template fails to build #14335

Closed
2 tasks done
deepink-mas opened this issue Jun 9, 2023 · 6 comments · Fixed by #14490
Closed
2 tasks done

Latest node template fails to build #14335

deepink-mas opened this issue Jun 9, 2023 · 6 comments · Fixed by #14490
Assignees
Labels
I3-bug The node fails to follow expected behavior.

Comments

@deepink-mas
Copy link
Contributor

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

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Jun 9, 2023
@deepink-mas
Copy link
Contributor Author

Some similar reports seem to be made here: #12791

@deepink-mas
Copy link
Contributor Author

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

@deepink-mas
Copy link
Contributor Author

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

@deepink-mas
Copy link
Contributor Author

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

@bkchr bkchr self-assigned this Jun 11, 2023
@bkchr bkchr added I3-bug The node fails to follow expected behavior. and removed J2-unconfirmed Issue might be valid, but it’s not yet known. labels Jun 11, 2023
@jasl
Copy link
Contributor

jasl commented Jun 27, 2023

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

@bkchr
Copy link
Member

bkchr commented Jun 27, 2023

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

bkchr added a commit that referenced this issue Jul 2, 2023
Apparently there are installations where the `hash` and `date` is optional.

Closes: #14335
paritytech-processbot bot pushed a commit that referenced this issue Jul 3, 2023
* wasm-builder: Make `hash` and `date` optional

Apparently there are installations where the `hash` and `date` is optional.

Closes: #14335

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
nathanwhit pushed a commit to nathanwhit/substrate that referenced this issue Jul 19, 2023
* wasm-builder: Make `hash` and `date` optional

Apparently there are installations where the `hash` and `date` is optional.

Closes: paritytech#14335

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants