fix wild cards and subcrates #394
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).