Skip to content

lang: Fix declare_program! messing up IDL errors generation#4126

Merged
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:lang-fix-declare_program-messing-up-idl-errors-generation
Dec 14, 2025
Merged

lang: Fix declare_program! messing up IDL errors generation#4126
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:lang-fix-declare_program-messing-up-idl-errors-generation

Conversation

@acheroncrypto

Copy link
Copy Markdown
Collaborator

Problem

As mentioned in #3757 (comment), the errors module generated by declare_program! makes the errors field of IDLs inconsistent at best and incorrect at worst.

Summary of changes

  • Fix declare_program! messing up IDL errors generation by skipping the generation of the errors module during IDL generation
  • Add a test case that makes sure programs that don't have error definitions don't end up having errors field in their IDL because of declare_program! usage

Note: There is no good reason for the errors module to exist for Solana program builds, as it might result in getting stack-related error logs during build (see #4109), but that problem is outside the scope of this PR (will handle in a subsequent PR).

@vercel

vercel Bot commented Dec 13, 2025

Copy link
Copy Markdown

@acheroncrypto is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added lang fix Bug fix PR labels Dec 13, 2025
@acheroncrypto acheroncrypto merged commit 92af6fa into otter-sec:master Dec 14, 2025
56 of 58 checks passed
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix PR lang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant