Re: [Nix-dev] nix rebuilds

2017-05-12 Thread Harmen
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!
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix rebuilds

2017-05-12 Thread Kevin Cox

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)) ./.;
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] nix rebuilds

2017-05-12 Thread Harmen
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 put the .nix file in the repo next to the code, so I don't refer to an
external repo with a nice checksum, but like this:

  src = ./.;


This is for a Ruby on Rails project build with bundix.

Any thoughts? Thanks!
Harmen
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev