Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spl-token-metadata] crate, I am not able to compile the program. #722

Closed
SushantChandla opened this issue Oct 14, 2021 · 2 comments
Closed

Comments

@SushantChandla
Copy link

SushantChandla commented Oct 14, 2021

BPF SDK: /Users/sushantchandla/.local/share/solana/install/releases/1.7.10/solana-release/bin/sdk/bpf
Running: rustup toolchain list -v
Running: cargo +bpf build --target bpfel-unknown-unknown --release
   Compiling marketplace v0.1.0 (..../marketplace)
error: the `#[global_allocator]` in this crate conflicts with global allocator in: spl_token_metadata

error: aborting due to previous error

error: could not compile `marketplace`

To learn more, run the command again with --verbose

rust-lang/rust#44113

https://lib.rs/crates/spl-token-metadata

With --verbose flag

BPF SDK: /Users/sushantchandla/.local/share/solana/install/releases/1.7.10/solana-release/bin/sdk/bpf
Running: rustup toolchain list -v
Running: cargo +bpf build --target bpfel-unknown-unknown --release --verbose
       Fresh unicode-xid v0.2.2
       Fresh semver-parser v0.7.0
       Fresh version_check v0.9.3
       Fresh feature-probe v0.1.1
       Fresh block-padding v0.2.1
       Fresh autocfg v1.0.1
       Fresh cfg-if v1.0.0
       Fresh opaque-debug v0.3.0
       Fresh ahash v0.4.7
       Fresh spin v0.5.2
       Fresh keccak v0.1.0
       Fresh either v1.6.1
       Fresh bs58 v0.3.1
       Fresh hex v0.4.3
       Fresh arrayref v0.3.6
       Fresh semver v0.9.0
       Fresh hashbrown v0.9.1
       Fresh lazy_static v1.4.0
       Fresh proc-macro2 v1.0.28
       Fresh itertools v0.9.0
       Fresh rustc_version v0.2.3
       Fresh typenum v1.13.0
       Fresh quote v1.0.9
       Fresh log v0.4.14
       Fresh rustversion v1.0.5
       Fresh syn v1.0.75
       Fresh num-traits v0.2.14
       Fresh serde_derive v1.0.129
       Fresh thiserror-impl v1.0.26
       Fresh borsh-derive-internal v0.9.1
       Fresh borsh-schema-derive-internal v0.9.1
       Fresh solana-frozen-abi-macro v1.7.11
       Fresh num-derive v0.3.3
       Fresh solana-sdk-macro v1.7.11
       Fresh derivative v2.2.0
       Fresh serde v1.0.129
       Fresh thiserror v1.0.26
       Fresh toml v0.5.8
       Fresh generic-array v0.14.4
       Fresh bv v0.11.1
       Fresh serde_bytes v0.11.5
       Fresh bincode v1.3.3
       Fresh block-buffer v0.9.0
       Fresh digest v0.9.0
       Fresh proc-macro-crate v0.1.5
       Fresh proc-macro-crate v1.0.0
       Fresh borsh-derive v0.9.1
       Fresh sha2 v0.9.5
       Fresh sha3 v0.9.1
       Fresh num_enum_derive v0.5.4
       Fresh solana-frozen-abi v1.7.11
       Fresh borsh v0.9.1
       Fresh num_enum v0.5.4
       Fresh solana-program v1.7.11
       Fresh spl-token v3.2.0
       Fresh spl-token-vault v0.0.1
       Fresh spl-token-metadata v0.0.1
   Compiling marketplace v0.1.0 (/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace)
     Running `rustc --crate-name marketplace --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type lib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=b620f7336d5ca2f8 --out-dir /Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps --target bpfel-unknown-unknown -L dependency=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps -L dependency=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/release/deps --extern borsh=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libborsh-97b663fc6b48ff00.rlib --extern borsh_derive=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/release/deps/libborsh_derive-e215a298f389ee9d.dylib --extern solana_program=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libsolana_program-c8f20ad4b8ef6d9d.rlib --extern spl_token=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libspl_token-5a364889b85a3610.rlib --extern spl_token_metadata=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libspl_token_metadata-db95f607c23f2e89.rlib -C lto=no -C opt-level=2`
error: the `#[global_allocator]` in this crate conflicts with global allocator in: spl_token_metadata

error: aborting due to previous error

error: could not compile `marketplace`

Caused by:
  process didn't exit successfully: `rustc --crate-name marketplace --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type lib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=b620f7336d5ca2f8 --out-dir /Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps --target bpfel-unknown-unknown -L dependency=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps -L dependency=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/release/deps --extern borsh=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libborsh-97b663fc6b48ff00.rlib --extern borsh_derive=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/release/deps/libborsh_derive-e215a298f389ee9d.dylib --extern solana_program=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libsolana_program-c8f20ad4b8ef6d9d.rlib --extern spl_token=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libspl_token-5a364889b85a3610.rlib --extern spl_token_metadata=/Users/sushantchandla/rust/shadow_of_strom_programs/marketplace/target/bpfel-unknown-unknown/release/deps/libspl_token_metadata-db95f607c23f2e89.rlib -C lto=no -C opt-level=2` (exit code: 1)

@SushantChandla
Copy link
Author

Using like this fixes the issue.

spl-token = { version="3.1.1", features = [ "no-entrypoint" ] }
spl-token-metadata = { version="0.0.1", features = [ "no-entrypoint" ] }

May be consider adding this to readme.md of spl-token-metadata

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

This Issue has received no activity for 30 days. We will close it in 2 days, please reopen if you are still experiencing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant