fix(avm): Using a temporary installation dir on cargo install calls to prevent cargo erroring out due to existing anchor symlink in .avm/bin#4343
Merged
Conversation
…o prevent cargo erroring out due to existing anchor symlink in .avm/bin
|
@tiago18c is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
trixter-osec
approved these changes
Mar 20, 2026
Otter-0x4ka5h
pushed a commit
to Otter-0x4ka5h/anchor
that referenced
this pull request
Mar 25, 2026
…o prevent cargo erroring out due to existing anchor symlink in .avm/bin (otter-sec#4343)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Installations of
avmandanchorare expected to be under~/.cargo/bin/, avm works by creating a controlled directory of anchor installations under.avm/bin/. This location is also wherecargo installinstalls the many versions, and to end the process avm will rename the binary to append the version number.To tie this all together, a symlink of
.cargo/bin/anchor->.cargo/bin/avmis expected, so that avm proxies to the right install.The PR #3768 added the additional symlink of
.avm/bin/anchor->.avm/bin/avmwhich breaks thecargo installin some systems as the location (.avm/bin/anchor) already exists when trying to install a new version.Solution
This PR installs binaries in a temporary path before renaming and moving them to the expected
.avm/bin