Skip to content

Commit

Permalink
feat: Use filterCargoSources for workspace crates
Browse files Browse the repository at this point in the history
To avoid unnecessary rebuilds.

We already do this for project root (via the `src` option).
  • Loading branch information
srid committed Jul 28, 2024
1 parent 8c702ae commit 1cd0b43
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nix/modules/default-crates.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
lib.foldl'
(acc: pathString:
let
path = "${src}/${pathString}";
cargoPath = "${src}/${pathString}/Cargo.toml";
path =
lib.cleanSourceWith {
src = "${src}/${pathString}";
filter = path: type:
(config.rust-project.crane-lib.filterCargoSources path type);
};
cargoPath = "${path}/Cargo.toml";
cargoToml = builtins.fromTOML (builtins.readFile cargoPath);
name = cargoToml.package.name;
in
Expand Down

0 comments on commit 1cd0b43

Please sign in to comment.