Skip to content

Conversation

@cryptopapi997
Copy link

@cryptopapi997 cryptopapi997 commented Nov 5, 2025

solana-instruction v2.3.2 was released a few hours ago, which when using the serde feature tries to access stuff via serde::__private::.... Unfortunately, __private is no longer accessible in newer serde versions as of serde-rs/serde#2980 (and instead requires the patch version to be specified too, e.g. __private123 for patch 123). This isn't visible in this crate as the Cargo.lock file prevents it from updating, but in crates that depend on it and don't have a lockfile yet (e.g. a new anchor project spawned with anchor init), it will default to the latest solana-instruction and serde version, which will spit out a million errors like the below:

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1096:37
     |
1096 | ...                   _serde::__private::Ok(InstructionError::BorshIoError(
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1104:37
     |
1104 | ...                   _serde::__private::Ok(InstructionError::AccountNotRentExempt)
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1108:37
     |
1108 | ...                   _serde::__private::Ok(InstructionError::InvalidAccountOwner)
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1112:37
     |
1112 | ...                   _serde::__private::Ok(InstructionError::ArithmeticOverflow)
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1116:37
     |
1116 | ...                   _serde::__private::Ok(InstructionError::UnsupportedSysvar)
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1120:37
     |
1120 | ...                   _serde::__private::Ok(InstructionError::IllegalOwner)
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1124:37
     |
1124 | ...                   _serde::__private::Ok(
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1130:37
     |
1130 | ...                   _serde::__private::Ok(InstructionError::MaxAccountsExceeded)
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`
    --> src/error.rs:1134:37
     |
1134 | ...                   _serde::__private::Ok(
     |                               ^^^^^^^^^ could not find `__private` in `_serde`

error[E0433]: failed to resolve: could not find `__private` in `_serde`

The "right" fix would be to migrate away from using __private altogether, however for now this would be a good patch for solana-instruction to get it working for downstream users again. I think it would also make sense to yank 2.3.2.

@cryptopapi997 cryptopapi997 changed the title Fixate serde version in 2.x (currently causing all anchor programs to be broken) Fixate serde version in 2.x (currently causing all new anchor programs to be broken) Nov 5, 2025
@cryptopapi997
Copy link
Author

Alternative fix is to bump to latest (1.0.228) and replace all serde::__private with serde::__private228. But either way, this requires fixating the version, as this will break when 1.0.229 will be released. Can adapt if this is more desirable.

@joncinque
Copy link
Collaborator

We'll just remove the usage of __private with #434, that should resolve everything, apologies for the breakage

@joncinque
Copy link
Collaborator

v2.3.2 has been yanked https://crates.io/crates/solana-instruction/2.3.2

@joncinque
Copy link
Collaborator

For completeness sake, https://crates.io/crates/solana-instruction/2.3.3 is out now

@cryptopapi997 cryptopapi997 deleted the fix-serde branch November 5, 2025 16:18
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

Successfully merging this pull request may close these issues.

2 participants