Skip to content
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

idl: Make safety comment checks fail silently when program path env is not set #3045

Conversation

acheroncrypto
Copy link
Collaborator

Problem

IDL generation expects ANCHOR_IDL_BUILD_PROGRAM_PATH environment variable to be set, but if the user is using Rust Analyzer with all features enabled, they will run into a panic due the environment variable not being set as described in #3042.

Summary of changes

Make safety comment checks fail silently when the ANCHOR_IDL_BUILD_PROGRAM_PATH environment variable is not set.

Note that the checks still work as expected, this is only to improve an LSP related issue.

Resolves #3042

Copy link

vercel bot commented Jun 23, 2024

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

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added lang idl related to the IDL, either program or client side fix Bug fix PR labels Jun 23, 2024
@acheroncrypto
Copy link
Collaborator Author

Blocked by #3044

@acheroncrypto
Copy link
Collaborator Author

Merging with (unrelated) CI errors because solana-labs/solana-program-library#6897 is taking a while to get resolved.

@acheroncrypto acheroncrypto merged commit 594169e into coral-xyz:master Jun 26, 2024
32 of 48 checks passed
@Abhishek7Tech
Copy link

Still the issue hasn't been resolved. @acheroncrypto

@acheroncrypto
Copy link
Collaborator Author

It has been resolved, but we don't have a release with this PR included. This is a LSP only issue, and I've shared multiple ways to fix it in #3042 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PR idl related to the IDL, either program or client side lang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#[program] macro error in rust-analyzer when LSP run with cargo.features = "all"
2 participants