Skip to content

Conversation

@Pacman99
Copy link

@Pacman99 Pacman99 commented Mar 14, 2025

This solves a couple issues with crate2nix not matching expected cargo behavior. Fixes #387 and another issue where crates are located in subpaths of a git repository with no root cargo.toml. The second issue can be seen in https://github.com/strangelove-ventures/interchaintest where there is a rust crate located in local-interchain/rust/localic-std and no root Cargo.toml.

Both issues can be fixed by making a list of all cargo.toml in the repo and checking to see if any of them match the expected name of the package in the workspace. This is possible because of a nixpkgs function lib.filesystem.listFilesRecursive. This method seems pretty robust, since it follows the same logic that cargo itself follows when finding packages in a git repository as explained here rust-lang/cargo#1462 (comment).

@Pacman99 Pacman99 force-pushed the fix-subcrates branch 2 times, most recently from cb61181 to 1f3854e Compare March 14, 2025 21:43
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

Successfully merging this pull request may close these issues.

wildcard in workspace.members causes evaluation error

2 participants