You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue:
When using feature flags in a Rust file to set the program ID, which should be reflected in the IDL file, passing feature flags during compilation does not work as expected. Instead, only the default option specified in Cargo.toml is applied.
Code Example:
Here is an example of code where the program ID depends on feature flags:
Thanks for the report, but since this issue is essentially the same as #3054, I'm closing it as completed, but feel free to reopen it if the problem continues.
Issue:
When using feature flags in a Rust file to set the program ID, which should be reflected in the IDL file, passing feature flags during compilation does not work as expected. Instead, only the default option specified in
Cargo.toml
is applied.Code Example:
Here is an example of code where the program ID depends on feature flags:
Build Command:
anchor build --arch sbf -- --features $(NETWORK) --no-default-features
Result:
IDL generation only considers the default settings specified in
Cargo.toml
, regardless of which feature flag is passed.Workaround:
To generate an IDL for a specific environment, you must manually change the default feature in
Cargo.toml
each time before compilation.Cargo.toml example:
The text was updated successfully, but these errors were encountered: