coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

Install Anchor fails under macOS #2976

Closed TheFox closed 1 month ago

TheFox commented 1 month ago

Hi all,

I am getting this error when trying to install Anchor:

    Updating git repository `https://github.com/coral-xyz/anchor`

warning: skipping duplicate package `shared` found at `/Users/thefox/.cargo/git/checkouts/anchor-50c4b9c8b5e0501f/4540c82/tests/zero-copy/programs/shared`
warning: skipping duplicate package `shared` found at `/Users/thefox/.cargo/git/checkouts/anchor-50c4b9c8b5e0501f/4540c82/tests/typescript/programs/shared`
warning: skipping duplicate package `external` found at `/Users/thefox/.cargo/git/checkouts/anchor-50c4b9c8b5e0501f/4540c82/tests/declare-program/programs/external`
warning: skipping duplicate package `swap` found at `/Users/thefox/.cargo/git/checkouts/anchor-50c4b9c8b5e0501f/4540c82/tests/cfo/deps/swap/programs/swap`
warning: skipping duplicate package `docs` found at `/Users/thefox/.cargo/git/checkouts/anchor-50c4b9c8b5e0501f/4540c82/tests/docs/programs/docs`
warning: skipping duplicate package `relations-derivation` found at `/Users/thefox/.cargo/git/checkouts/anchor-50c4b9c8b5e0501f/4540c82/tests/relations-derivation/programs/relations-derivation`
  Installing avm v0.30.0 (https://github.com/coral-xyz/anchor#4540c825)
    Updating crates.io index
warning: package `ahash v0.7.6` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
   Compiling libc v0.2.153
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.1.0
error: failed to run custom build command for `proc-macro2 v1.0.79`

Caused by:
  process didn't exit successfully: `/var/folders/vw/20gt5mnj3bbc16jcq14zcnc40000gn/T/cargo-installlCuYZ7/release/build/proc-macro2-c0dfe5d9e48dc013/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `avm v0.30.0 (https://github.com/coral-xyz/anchor#4540c825)`, intermediate artifacts can be found at `/var/folders/vw/20gt5mnj3bbc16jcq14zcnc40000gn/T/cargo-installlCuYZ7`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

How can I get this working?

acheroncrypto commented 1 month ago

error: failed to run custom build command for proc-macro2 v1.0.79

Not sure what the cause is but searching for this gives a few results in other places. I'd check these GitHub issues regarding this error message and try the mentioned fixes.