1

I'm using pallet-nfts in my custom pallet. From the moment that I integrated pallet-nfts into my pallet it's not longer possible to build the node.

The custom pallet's Cargo.toml looks like this:

[package]
name = "pallet-projects"
version = "4.0.0-dev"
description = "FRAME pallet for projects"
authors = ["Sonemas LLC <[email protected]>"]
homepage = "https://incentiverse.io"
edition = "2021"
license = "MIT"
publish = false
repository = "https://gitlab.com/incentiverse/node"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [
    "derive",
] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
pallet-nfts = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
sp-std = { version = "8.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
log = "0.4.20"
getrandom = { version = "0.2", features = ["js"] }

[dev-dependencies]
sp-core = { version = "21.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
sp-io = { version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
sp-runtime = { version = "24.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }

[features]
default = ["std"]
std = [
    "codec/std",
    "frame-benchmarking?/std",
    "frame-support/std",
    "frame-system/std",
    "scale-info/std",
    "sp-std/std",
    "pallet-balances/std",
    "pallet-nfts/std",
]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]

I added the line with getrandomas a solution to the following error that occurred:

  285 | /         compile_error!("the wasm*-unknown-unknown targets are not supported by \
  286 | |                         default, you may need to enable the \"js\" feature. \
  287 | |                         For more information see: \
  288 | |                         https://docs.rs/getrandom/#webassembly-support");

However I'm still left with the following build error:

Compiling node-template-runtime v4.0.0-dev (/Users/arjanvaneersel/Development/rust/node/runtime)
error: failed to run custom build command for `node-template-runtime v4.0.0-dev (/Users/arjanvaneersel/Development/rust/node/runtime)`

Caused by:
  process didn't exit successfully: `/Users/arjanvaneersel/Development/rust/node/target/release/build/node-template-runtime-17bb0d6993cb0094/build-script-build` (exit status: 1)
  --- stdout
  Information that should be included in a bug report.
  Executing build command: RUSTFLAGS="-C target-cpu=mvp -C target-feature=-sign-ext -C link-arg=--export-table -Clink-arg=--export=__heap_base -C link-arg=--import-memory  " SKIP_WASM_BUILD="" "/Users/arjanvaneersel/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/arjanvaneersel/Development/rust/node/target/release/wbuild/node-template-runtime/Cargo.toml" "--color=always" "--profile" "release"
  Using rustc version: rustc 1.74.0-nightly (b3aa8e716 2023-09-21)


  --- stderr
     Compiling wasm-bindgen-backend v0.2.87
     Compiling thiserror v1.0.44
     Compiling toml v0.5.11
     Compiling impl-trait-for-tuples v0.2.2
     Compiling indexmap v1.9.3
     Compiling crypto-common v0.1.6
     Compiling block-buffer v0.10.4
     Compiling digest v0.9.0
     Compiling digest v0.10.7
     Compiling derive_more v0.99.17
     Compiling cranelift-entity v0.95.1
     Compiling errno v0.3.1
  error[E0583]: file not found for module `sys`
    --> /Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/lib.rs:26:1
     |
  26 | mod sys;
     | ^^^^^^^^
     |
     = help: to create the module `sys`, create file "/Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/sys.rs" or "/Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/sys/mod.rs"

  error[E0425]: cannot find function `with_description` in module `sys`
    --> /Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/lib.rs:47:14
     |
  47 |         sys::with_description(*self, |desc| {
     |              ^^^^^^^^^^^^^^^^ not found in `sys`

  error[E0425]: cannot find function `with_description` in module `sys`
    --> /Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/lib.rs:58:14
     |
  58 |         sys::with_description(*self, |desc| match desc {
     |              ^^^^^^^^^^^^^^^^ not found in `sys`

  error[E0425]: cannot find value `STRERROR_NAME` in module `sys`
    --> /Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/lib.rs:64:22
     |
  64 |                 sys::STRERROR_NAME,
     |                      ^^^^^^^^^^^^^ not found in `sys`

  error[E0425]: cannot find function `errno` in module `sys`
    --> /Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/lib.rs:95:10
     |
  95 |     sys::errno()
     |          ^^^^^ not found in `sys`

  error[E0425]: cannot find function `set_errno` in module `sys`
     --> /Users/arjanvaneersel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/errno-0.3.1/src/lib.rs:100:10
      |
  100 |     sys::set_errno(err)
      |          ^^^^^^^^^ not found in `sys`

  Some errors have detailed explanations: E0425, E0583.
  For more information about an error, try `rustc --explain E0425`.
  error: could not compile `errno` (lib) due to 6 previous errors
  warning: build failed, waiting for other jobs to finish...

I found some article suggesting that I should add the line syn = { version = "=2.0.37" } to Cargo.toml. I added this line first in the Cargo.toml of my custom pallet, then also in runtime, but the aforementioned error keeps coming back.

The command I'm using to build is cargo build --release.

What am I doing wrong?

1
  • Can you share the repo so we can replicate the issue and debug it?
    – Bruno
    Commented Sep 26, 2023 at 16:27

1 Answer 1

1

It looks like you're missing default-features=false on the pallet-nfts import. Try changing it to:

pallet-nfts = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false }

1
  • How could I have missed that... Thank you for pointing that out, it solved the issue indeed. Commented Sep 27, 2023 at 4:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.