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

Can't build package from crates.io registry #370

Open
jkopanski opened this issue Apr 30, 2024 · 0 comments
Open

Can't build package from crates.io registry #370

jkopanski opened this issue Apr 30, 2024 · 0 comments

Comments

@jkopanski
Copy link

I've prepared minimal repository

nix build fails with building the dependency cairo-lang-casm, in a code that is behind an enabled feature flag, with a message:

error: Could not find `parity-scale-codec` in `dependencies` or `dev-dependencies` in `/home/nat/famisoft/cargo2nix-issue/debug/cairo-lang-casm-2.6.3/Cargo.toml`!
  --> src/hints/mod.rs:24:12
   |
24 |     derive(parity_scale_codec::Encode, parity_scale_codec::De...
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |

You can see the failed build in the github CI run here.

I don't know how cargo2nix should work, but I've followed this guide to take a peek what's going on. Very neat feature, btw. I didn't know this. Indeed cairo2nix overwrites Cargo.toml to

[package]
edition = "2021"
name = "cairo-lang-casm"
version = "2.6.3"
description = "Cairo assembly encoding."
license-file = "LICENSE"
repository = "https://github.com/starkware-libs/cairo/"

[features]
default = []
parity-scale-codec = []
serde = []
std = []

[profile]

which indeed doesn't have dependencies section. I guess cargo2nix uses compiler flags to pass them instead. However cairo-lang-casm entry from Cargo.nix seems to list proper dependency.

cargo build builds successfully when executed from the nix shell.

I don't know if this is some sort of bug, or perhaps I am doing something wrong here? Please advise.

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