Skip to content

Conversation

@jamie-osec
Copy link
Collaborator

Closes #2993

The root cause of the above issue is that we switch directories when running all commands, thus leaving relative paths incorrect.
This PR introduces a new trait (and corresponding derive macro) AbsolutePath for making paths in CLI arguments absolute. This is then used in anchor_cli::entry to prepare arguments for use.
As an additional cleanup, all path arguments have been converted to PathBuf (rather than String).

@vercel
Copy link

vercel bot commented Dec 3, 2025

@jamie-osec is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@jamie-osec jamie-osec added cli fix Bug fix PR labels Dec 3, 2025
@jamie-osec
Copy link
Collaborator Author

@swaroop-osec What do you think about merging this PR as-is, as it fixes the motivating issue, and addressing the other issue in a followup? I have some ideas to eliminate these problems but they'll require some more extensive refactoring

@swaroop-osec
Copy link
Collaborator

swaroop-osec commented Dec 4, 2025

@swaroop-osec What do you think about merging this PR as-is, as it fixes the motivating issue, and addressing the other issue in a followup? I have some ideas to eliminate these problems but they'll require some more extensive refactoring

Sounds good. Please address the failed tests

Co-authored-by: hasip-timurtas <hasip.timurtas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli fix Bug fix PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: support relative paths for anchor idl init

2 participants