1

I've started to learn Solana and I'm on the very beginning. When running cargo build-bpf, I get an error like this:

error: could not compile `crossbeam-epoch`

Caused by:
  process didn't exit successfully: `rustc --crate-name crossbeam_epoch --edition=2018 /home/karol/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.11/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="alloc"' --cfg 'feature="std"' -C metadata=0c75772846040a4e -C extra-filename=-0c75772846040a4e --out-dir /home/karol/repos/local/hello-solana/src/program/target/bpfel-unknown-unknown/release/deps --target bpfel-unknown-unknown -L dependency=/home/karol/repos/local/hello-solana/src/program/target/bpfel-unknown-unknown/release/deps -L dependency=/home/karol/repos/local/hello-solana/src/program/target/release/deps --extern cfg_if=/home/karol/repos/local/hello-solana/src/program/target/bpfel-unknown-unknown/release/deps/libcfg_if-1643e4a2c6efb510.rmeta --extern crossbeam_utils=/home/karol/repos/local/hello-solana/src/program/target/bpfel-unknown-unknown/release/deps/libcrossbeam_utils-9bec6a43634cd6a8.rmeta --extern memoffset=/home/karol/repos/local/hello-solana/src/program/target/bpfel-unknown-unknown/release/deps/libmemoffset-4fe6cc40ad2ab243.rmeta --extern scopeguard=/home/karol/repos/local/hello-solana/src/program/target/bpfel-unknown-unknown/release/deps/libscopeguard-83203493741a9def.rmeta --cap-lints allow -C lto=no --cfg crossbeam_no_const_fn_trait_bound` (signal: 6, SIGABRT: process abort signal)
warning: build failed, waiting for other jobs to finish...
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /home/karol/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.46/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: build failed

Cargo.toml:

[package]
name = "program"
version = "0.1.0"
edition = "2021"

[dependencies]
solana-program = "1.9.9"
getrandom = { version = "0.2.2", features = ["custom"] }

[dev-dependencies]
solana-program-test = "1.9.9"
solana-sdk = "1.9.9"

[lib]
crate-type = ["cdylib", "lib"]

Running:

Ubuntu 22.04 on WSL
solana-cli 1.9.8
cargo 1.64.0
0

2 Answers 2

1

Updating Solana CLI solved this issue for me. Refer to this webpage or run this command: solana-install update

1
cargo update -p syn --precise 1.0.99; cargo update -p proc-macro2 --precise 1.0.43

this work well for me
https://github.com/coral-xyz/anchor/issues/2226

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.