coral-xyz / anchor

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

Anchor deploy fails when CARGO_TARGET_DIR is set. #958

Open uttarayan21 opened 3 years ago

uttarayan21 commented 3 years ago

On anchor cli version 0.18.0 installed using cargo install --git https://github.com/project-serum/anchor anchor-cli --locked

When anchor build is used output is generated in $CARGO_TARGET_DIR/target/deploy/basic_0.so but the anchor deploy looks for it in the current directory.

Using anchor build -- --bpf-out-dir ./target/deploy generates the library inside $PWD/programs/basic-0/target/deploy

unset -int the CARGO_TARGET_DIR makes anchor work as expected.

Also anchor build -- --bpf-out-dir "$PWD/target/deploy" works fine.

Henry-E commented 1 year ago

curious if this ever got fixed, tempted to close