Bonfida / sns-sdk

Solana Name Service SDKs monorepo
https://sns.id/
MIT License
34 stars 28 forks source link

Unable to install Rust sns-sdk #32

Closed queiroz closed 10 months ago

queiroz commented 10 months ago
error[E0432]: unresolved imports `solana_sdk::ic_msg`, `solana_sdk::process_instruction`
 --> /Users/rodrigo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-config-program-1.5.14/src/config_processor.rs:6:18
  |
6 |     feature_set, ic_msg,
  |                  ^^^^^^ no `ic_msg` in the root
...
9 |     process_instruction::InvokeContext,
  |     ^^^^^^^^^^^^^^^^^^^ could not find `process_instruction` in `solana_sdk`
queiroz commented 10 months ago

rustc --version rustc 1.74.1 (a28077b28 2023-12-04)

ellttBen commented 10 months ago

Hey @queiroz, thanks for opening the issue. I just tried to reproduce the issue on my machine with a similar rustc version and couldn't, as the following seems to work:

cargo init temp
cd temp
cargo add sns-sdk
cargo build

What command are you running to get this result? The error message seems to indicate a failure in building the solana-config-program dependency, so you might have a dependency conflict here. Would you mind providing your Cargo.toml? (At least the dependencies section) Thanks

queiroz commented 10 months ago

hey @ellttBen thanks for getting back to me, I followed the README instructions related to CLI.

The CLI can be installed with:

cargo install --git https://github.com/Bonfida/sns-sdk.git sns

I've just tried building with cargo add and build and it works but cargo install did not

ellttBen commented 10 months ago

Hey @queiroz, so it turns out that building the CLI is indeed broken. I've done some repairs on a new branch, would you mind trying this command instead:

cargo install --git https://github.com/Bonfida/sns-sdk.git sns --branch sns-sdk-cli-fix 

Thanks again for the report

queiroz commented 10 months ago
cargo install --git https://github.com/Bonfida/sns-sdk.git sns --branch sns-sdk-cli-fix
    Updating git repository `https://github.com/Bonfida/sns-sdk.git`
  Installing sns v0.1.0 (https://github.com/Bonfida/sns-sdk.git?branch=sns-sdk-cli-fix#8f672b48)
    Updating crates.io index
    Updating git repository `https://github.com/Bonfida/name-tokenizer`
error: failed to compile `sns v0.1.0 (https://github.com/Bonfida/sns-sdk.git?branch=sns-sdk-cli-fix#8f672b48)`, intermediate artifacts can be found at `/var/folders/x5/m9_4wd694czg0pvf3fx19h480000gn/T/cargo-installCxb3a8`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  failed to select a version for the requirement `name-tokenizer = "^0.1.0"`
  candidate versions found which didn't match: 1.0.0
  location searched: Git repository https://github.com/Bonfida/name-tokenizer
  required by package `sns-sdk v1.3.1 (/Users/rodrigo/.cargo/git/checkouts/sns-sdk-9a587b4560096ade/8f672b4/rust)`
      ... which satisfies path dependency `sns-sdk` of package `sns v0.1.0 (/Users/rodrigo/.cargo/git/checkouts/sns-sdk-9a587b4560096ade/8f672b4/cli)`
ellttBen commented 10 months ago

Hey @queiroz, Made some progress so now a simple

cargo install sns-cli

should suffice

queiroz commented 10 months ago

Great solved then, thank you!