fix wild cards and subcrates#394
Merged
domenkozar merged 1 commit intonix-community:masterfrom Jan 28, 2026
Merged
Conversation
cb61181 to
1f3854e
Compare
hallettj
approved these changes
Mar 19, 2025
Contributor
|
Can we have a test? |
domenkozar
added a commit
that referenced
this pull request
Jan 28, 2026
Add changelog entry documenting the fix for git dependencies with wildcard workspace members and subcrates in nested directories. Add sub_dir_crates_ifd test that exercises the IFD code path in tools.nix to verify the fix works when dynamically generating Cargo.nix. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-stdand 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).