-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation Error with Passing Cargo args when build program when IDL Generation is enabled in Anchor 0.30 #3054
Comments
Thanks, your analysis is correct; cargo arguments you pass don't apply to the IDL build command currently, as you've figured out. Using the same cargo arguments both for the regular program build and the IDL build should be fine at first glance. If there is a problem, we can also introduce an option that takes in arguments to only pass to the IDL build command. |
I saw labels. From my perspective the issue is a bug(or at least breaking change) since it worked before |
The reason I didn't classify this issue as a bug is because IDL generation process between v0.28 and v0.30 are vastly different (the old one did not use compilation), and you can fix this by including the feature you want to enable to the [features]
idl-build = ["anchor-lang/idl-build", "one"] It's definitely a breaking change though, hence the versioning. |
passes cargo args to idl generation
passes cargo args to idl generation
passes cargo args to idl generation
passes cargo args to idl generation
Hello! I'm from Debridge team. We faced an issue while updating our contract from anchor 0.28 to 0.30
Description:
After updating from Anchor 0.28 to 0.30, our project encounters a compilation error when conditional compilation features are used along with IDL generation. The error does not occur when compiling with the --no-idl flag.
MRE:
features "one" and "two" are added to Cargo.toml
Expected behavior:
Running
anchor build -- --features one
should produce a valid library and an IDL.Actual result:
Analysis:
The issue likely stems from the IDL builder function not accepting and passing cargo_args, based on the examination of the source code here.
It works fine when I add flag --no-idl.
It works fine with 0.28.0
The text was updated successfully, but these errors were encountered: