Skip to content

solana-pubkey: Building without std feature still pulls std #301

@vadorovsky

Description

@vadorovsky

Building any project depending on solana-pubkey without default features and without std causes the error:

error[E0463]: can't find crate for `std`
  |
  = note: the `bpfel-unknown-none` target may not support the standard library
  = note: `std` is required by `solana_atomic_u64` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

error: cannot resolve a prelude import

That's because solana-pubkey pulls the atomic feature of solana-address:

solana-address = { workspace = true, features = ["atomic", "decode", "error", "sanitize", "sha2", "syscalls"] }

atomic = ["dep:solana-atomic-u64"]

Which then pulls the solana-atomic-u64 crate, which is not and cannot be no-std, because it depends on std (or parking_lot).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions