coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

Do not build anchor syn for the Solana target #3062

Open LucasSte opened 3 days ago

LucasSte commented 3 days ago

Function inside anchor/lang/syn only serve for code generation, but are also built for Solana programs, leading to spurious stack error warnings.

vercel[bot] commented 3 days ago

@LucasSte is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

LucasSte commented 1 day ago

Thanks for the PR, but could you mention how you got these spurious stack error warnings? You'd get it if you included anchor-syn as a direct dependency, but we don't have a direct dependency to it. You shouldn't run into this just from using anchor-lang.

The contract I was testing had anchor-syn as dependency, bringing up errors about functions that are not in the final binary. Adding the CFG flag ensures syn is not built for Solana, removing the errors. As far as I could dig the code, syn only deals with code generation, right? It does not contain code to be executed on chain.