1

I created a project with the command: anchor init solanasc and I receive this error when I run anchor build

ERROR cargo_build_sbf] Failed to obtain package metadata: `cargo metadata` exited with an error: error: failed to load manifest for workspace member `\\?\C:\Users\user\Desktop\Projects\Rust_projects\solanasc\programs\*`
    
    Caused by:
      failed to read `\\?\C:\Users\user\Desktop\Projects\Rust_projects\solanasc\programs\*\Cargo.toml`
    
    Caused by:
      The filename, directory name, or volume label syntax is incorrect. (os error 123)

I have tried the solutions here: `anchor build` fails with error, "failed to load manifest for workspace member", to no avail.

I am currently using Windows 10, and git bash. Here is my cargo.toml:

[package]
name = "solanasc"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "solanasc"

[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = "0.29.0"
2
  • 1
    Can you try a normal cargo build-sbf from your program's directory? Since there's only one program, that might resolve the issue
    – Jon C
    Commented Apr 7 at 13:07
  • I am having the same issue. Did you find the solution for this ? Commented May 14 at 21:36

1 Answer 1

0

I had the same problem, the error suggests that there is an invalid file path or character in the Cargo.toml file. I resolve it in changing:

[workspace]
members = [
     "programs/*"
]
[profile.release]
overflow-checks = true

to

[workspace]
members = [
     "programs/my_program_name"
]
[profile.release]
overflow-checks = true

t's not exactly the same configuration as your project, but if it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.