-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
buildRustCrate: Search for matching Cargo.toml in sub directories #82155
Conversation
* Make errors include the crate name and make them much more prominent. * Move more code into lib.sh * Already source generated logging code and lib.sh in configure
…sub directories This is what cargo does for git repositories. See related issues: * nix-community/crate2nix#53 * nix-community/crate2nix#33
@GrahamcOfBorg build buildRustCrateTests |
https://logs.nix.ci/?attempt_id=cc2ccc7c-25d3-4115-b4bf-8f068cff8650&key=nixos%2Fnixpkgs.82155 |
I think that if I do that, darwin will not rebuild but I'll try ;) @GrahamcOfBorg build buildRustCrateTests |
@GrahamcOfBorg build carnix cargo-download |
The build failure of The tests also look fine and pass (on at least linux). Thank you for adding this! 👍 |
Cargo does this for git repositories as well: rust-lang/cargo#1462 (comment) This will fix #33, #53 -- integration tests pending. It depends on a nixpkgs buildRustCrate feature PR: NixOS/nixpkgs#82155
Cargo does this for git repositories as well: rust-lang/cargo#1462 (comment) This will fix #33, #53 -- integration tests pending. It depends on a nixpkgs buildRustCrate feature PR: NixOS/nixpkgs#82155
Cargo does this for git repositories as well: rust-lang/cargo#1462 (comment) This will fix #33, #53 -- integration tests pending. It depends on a nixpkgs buildRustCrate feature PR: NixOS/nixpkgs#82155
Motivation for this change
When
cargo
builds a git dependency, it will search for a matchingCargo.toml
in any sub directory.buildRustCrate
assumes the top-level directory by default which results in the following build failures:nix-community/crate2nix#33
nix-community/crate2nix#53
In theory,
workspace_member
could be set to the appropriate sub directory upfront but allowingworkspace_member = null
to trigger a search is much mroe convenient. This PR will NOT change the default behavior because the currentbuildRustCrate
does not depend on anyCargo.toml
being present and we'd like to preserve that.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)