Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anchor build fails #443

Open
Prajwal208V opened this issue Feb 28, 2024 · 2 comments
Open

anchor build fails #443

Prajwal208V opened this issue Feb 28, 2024 · 2 comments

Comments

@Prajwal208V
Copy link

Problem
When i try to run anchor build, i get the following error:

error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets
--> src/lib.rs:267:9
|
267 | / compile_error!("
268 | | target is not supported, for more information see:
269 | | https://docs.rs/getrandom/#unsupported-targets
270 | | ");
| |__________^

error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> src/lib.rs:375:20
|
375 | StdoutLock(io::StdoutLock<'a>),
| ^^^^^^^^^^---- help: remove these generics
| |
| expected 0 lifetime arguments

error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> src/lib.rs:376:20
|
376 | StderrLock(io::StderrLock<'a>),
| ^^^^^^^^^^---- help: remove these generics
| |
| expected 0 lifetime arguments

For more information about this error, try rustc --explain E0107.
error: could not compile termcolor (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0425]: cannot find function is in this scope
--> src/lib.rs:98:6
|
98 | !is(stream)
| ^^ not found in this scope

For more information about this error, try rustc --explain E0425.
error: could not compile atty (lib) due to previous error
error[E0433]: failed to resolve: use of undeclared crate or module imp
--> src/lib.rs:291:5
|
291 | imp::getrandom_inner(dest)
| ^^^ use of undeclared crate or module imp

For more information about this error, try rustc --explain E0433.
error[E0422]: cannot find struct, variant or union type LineColumn in crate proc_macro
--> /Users/prajwalv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.37/src/wrapper.rs:485:33
|
485 | let proc_macro::LineColumn { line, column } = s.start();
| ^^^^^^^^^^ not found in proc_macro
|
help: consider importing one of these items
|
1 + use crate::LineColumn;
|
1 + use crate::fallback::LineColumn;
|
help: if you import LineColumn, refer to it directly
|
485 - let proc_macro::LineColumn { line, column } = s.start();
485 + let LineColumn { line, column } = s.start();
|

error[E0422]: cannot find struct, variant or union type LineColumn in crate proc_macro
--> /Users/prajwalv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.37/src/wrapper.rs:502:33
|
502 | let proc_macro::LineColumn { line, column } = s.end();
| ^^^^^^^^^^ not found in proc_macro
|
help: consider importing one of these items
|
1 + use crate::LineColumn;
|
1 + use crate::fallback::LineColumn;
|
help: if you import LineColumn, refer to it directly
|
502 - let proc_macro::LineColumn { line, column } = s.end();
502 + let LineColumn { line, column } = s.end();
|

error: could not compile getrandom (lib) due to 2 previous errors
For more information about this error, try rustc --explain E0422.
error: could not compile proc-macro2 (lib) due to 2 previous errors

Proposed Solution

@Prajwal208V
Copy link
Author

Cargo.toml

[package]
name = "merkle-distributor"
version = "0.3.5"
description = "A Solana program for distributing tokens according to a Merkle root."
edition = "2021"
homepage = "https://saber.so/"
repository = "https://github.com/saber-hq/merkle-distributor"
authors = [
"Michael Huang [email protected]",
"Ian Macalinao [email protected]"
]
license = "GPL-3.0"
keywords = ["solana", "airdrop", "token", "saber"]

[lib]
crate-type = ["cdylib", "lib"]
name = "merkle_distributor"
path = "src/lib.rs"

[features]
no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = ">=0.22, <=0.24"
anchor-spl = ">=0.22, <=0.24"
vipers = { version = "^2", features = ["spl-associated-token-account"] }

@Prajwal208V
Author

@Prajwal208V
Copy link
Author

Environment

macOS = macOS Sonoma Version 14.1.2

solana --version =solana-cli 1.18.2 (src:13656e30; feat:3352961542, client:SolanaLabs)
cargo -V = cargo 1.76.0 (c84b36747 2024-01-18)
npm -version = 9.8.0
rustc --version = rustc 1.76.0 (07dca489a 2024-02-04)
rustup --version = rustup 1.26.0 (5af9b9484 2023-04-05)
rustup show = stable-x86_64-unknown-linux-gnu (default)
node -v = v20.5.1

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

No branches or pull requests

1 participant