Skip to content

does not compile to 32-bit targets since Solana v2.2 #3

Description

@lincot

Use case: WASM binary that depends on a Solana contract.

cargo build --target wasm32-wasip1

Leads to

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> invoke/src/instruction_stabilizer.rs:121:32
    |
121 |             accounts: unsafe { core::mem::transmute(accounts) },
    |                                ^^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `instruction_stabilizer::StableVec<AccountMeta>` (96 bits)
    = note: target type: `solana_program::solana_stable_layout::stable_vec::StableVec<AccountMeta>` (192 bits)

The reason seems to be that solana_stable_layout::stable_vec::StableVec uses u64 instead of usize since 2.2.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions