nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
363 stars 86 forks source link

error inheriting `version` from workspace root manifest's `workspace.package.version` #311

Open commandodev opened 11 months ago

commandodev commented 11 months ago

I'm trying to us crate2nix to nixify windmill (https://github.com/windmill-labs/windmill).

I'm adding crate2nix in the backend subdirectory, which also has further sub directories with rust projects in them (e.g. windmill/backend/windmill-api)

I get:

++ crate2nix generate -f ./Cargo.toml -o Cargo-generated.nix -h /nix/store/32d3zrqyvz6w77k94hr3l4mn6qzhf5in-windmill-api-crate2nix/crate-hashes.json
Error: while retrieving metadata about ./Cargo.toml: `cargo metadata` exited with an error: error: failed to parse manifest at `/build/windmill-api/Cargo.toml`

Caused by:
  error inheriting `version` from workspace root manifest's `workspace.package.version`

Caused by:
  failed to find a workspace root
crate2nix failed.

I'll try and move the flake to the top level from backend and see if that works.

See also https://github.com/nix-community/naersk/issues/318

kolloch commented 10 months ago

For reference: Crane has a workaround: https://github.com/ipetkov/crane/pull/224