Skip to content

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
tiago18c merged 1 commit into
otter-sec:masterfrom
tiago18c:fix-avm-cargo-install-dir
Mar 20, 2026
Merged

Conversation

@tiago18c

@tiago18c tiago18c commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

Installations of avm and anchor are expected to be under ~/.cargo/bin/, avm works by creating a controlled directory of anchor installations under .avm/bin/. This location is also where cargo install installs 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/avm is expected, so that avm proxies to the right install.

The PR #3768 added the additional symlink of .avm/bin/anchor -> .avm/bin/avm which breaks the cargo install in 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

…o prevent cargo erroring out due to existing anchor symlink in .avm/bin
@vercel

vercel Bot commented Mar 20, 2026

Copy link
Copy Markdown

@tiago18c is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@tiago18c tiago18c requested a review from trixter-osec March 20, 2026 20:05
@tiago18c tiago18c merged commit e42ab8a into otter-sec:master Mar 20, 2026
118 of 120 checks passed
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants