coral-xyz / anchor

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

cli: Add checks for incorrect usage of `idl-build` feature #3061

Closed acheroncrypto closed 3 days ago

acheroncrypto commented 3 days ago

Problem

People sometimes incorrectly enable idl-build feature by default e.g.

[dependencies]
anchor-lang = { version = "0.30.1", features = ["idl-build"] }

This is not the intended usage, as it results in unnecessary compilation and unrelated stack errors.

Summary of changes

Add a warning in CLI that specifically checks for the above case, and show how to fix it:

WARNING: `idl-build` feature of crate `anchor-lang` is enabled by default. This is not the intended usage.

        To solve, do not enable the `idl-build` feature and include crates that have `idl-build` feature in the `idl-build` feature list:

        [features]
        idl-build = ["anchor-lang/idl-build", ...]
vercel[bot] commented 3 days ago

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

A member of the Team first needs to authorize it.