[Nix-dev] nix rebuilds
Harmen
harmen at lijzij.de
Fri May 12 15:19:58 CEST 2017
On Fri, May 12, 2017 at 01:31:00PM +0100, Kevin Cox wrote:
> On 05/12/2017 01:23 PM, Harmen wrote:
> > I'm building a few ruby and node projects with nix. It works well enough, but
> > nix does too many rebuilds, also when nothing changed. The question is: how I
> > can figure out why it does a rebuild? Maybe some checksum has changed, but can
> > I somehow figure out which one?
> I suspect that at a bare minimum the ./result symlink has changed.
>
> What I tend to do is use builtins.filterSource in order to ensure I am only
> including paths that I need.
>
> You can see an example at
> https://github.com/kevincox/sog/blob/master/default.nix
>
> src = builtins.filterSource (name: type:
> (lib.hasPrefix (toString ./BUILD) name) ||
> (lib.hasPrefix (toString ./sog) name) ||
> (lib.hasPrefix (toString ./test) name) ||
> (lib.hasPrefix (toString ./tools) name) ||
> (lib.hasPrefix (toString ./WORKSPACE) name)) ./.;
Works great, thanks!
More information about the nix-dev
mailing list