wen-community / wen-program-library

Apache License 2.0
90 stars 21 forks source link

Panic during Anchor build #44

Closed jacksondoherty closed 4 months ago

jacksondoherty commented 7 months ago

Hi all! I tried pulling this repo and running anchor build and received the following output:

thread 'main' panicked at 'Code not parseable: Error("expected `=`")', lang/syn/src/idl/parse/file.rs:273:58
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

For context – I'm working on a grant for holder-editable metadata. I love what you all are doing with WNS and would love to help make it compatible with external metadata programs if possible.

balmy-gazebo commented 7 months ago

Hey Jackson, great to hear. Two things, you'll need to call ./anchor build instead of anchor build, as the version of anchor that's needed is not deployed to the CLI yet. Also, make sure you're running it in the /programs directory. Let me know if it's still not working for you

kespinola commented 7 months ago

@jacksondoherty if this works for you can you please update the readme? The getting started is weak on the project right now.

jacksondoherty commented 7 months ago

Ah that makes sense. The binary is built for a different architecture than my mac so I replaced it with a build of master from bridgesplit/anchor and running ./anchor build and received the following:

Error: `idl-build` feature is missing. To solve, add

[features]
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]

in `/{...}/wen-new-standard/programs/wen_new_standard/Cargo.toml`.

I'm not sure what these are, but adding them to the the root Cargo.toml did nothing. Adding them to each program's Cargo.toml results in:

Finished test [unoptimized + debuginfo] target(s) in 1m 37s
Running unittests src/lib.rs (/{...}/wen-new-standard/programs/target/debug/deps/wen_new_standard-be742c973962bc7a)
Error: IDL doesn't exist

I imagine I could try building from the specific git hash I see in Cargo.lock, but thought I'd surface this first as I imagine we want to use the latest version of bridgesplit/anchor.

@kespinola Will gladly update the README once we get this sorted out 👍

balmy-gazebo commented 7 months ago

could you share your solana and rust versions?

jacksondoherty commented 7 months ago

rustc 1.73.0 (cc66ad468 2023-10-03) solana-cli 1.16.27 (src:eb1dc08d; feat:2294205250, client:SolanaLabs)

I also tried updating solana and received the same error: solana-cli 1.17.25 (src:d0ed878d; feat:3580551090, client:SolanaLabs)

I'm running on a Macbook Pro: 2.6 GHz 6-Core Intel Core i7

kespinola commented 6 months ago

0.30.0 support is out should resolve. readme updated on how to install.

kespinola commented 6 months ago

We are still waiting for a patch for spl token extensions to be merged into anchor. Once we upgrade to that there should be no issues with building programs with the latest anchor version.

You should be able to now since the project is off the fork but specs will fail from stack overflow. I will close this issue when WNS is on anchor 0.30.1+

kespinola commented 4 months ago

We pointed anchor crate reference in our program to a sha but still works with 0.30.0 of anchor CLI so can build with it now.