Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Spurious rebuilds when watched file changes during compilation #464

Open
symphorien opened this issue Aug 8, 2020 · 0 comments
Open

Spurious rebuilds when watched file changes during compilation #464

symphorien opened this issue Aug 8, 2020 · 0 comments

Comments

@symphorien
Copy link

Describe the bug

If two watched files change during a projet is built, then the project will be rebuilt twice once the build completes.
I intend to open a PR later today fixing this.

To Reproduce
Steps to reproduce the behavior:

Create a folder a and shell.nix as follows:

let
  pkgs = import <nixpkgs> {};
  dep = pkgs.stdenv.mkDerivation {
    name = "dep";
    src = ./a;
    buildPhase = ''
      sleep 20
    '';
    installPhase = ''
      touch $out
    '';
  };
in
  pkgs.mkShell {
    buildInputs = [ dep ];
  }

trigger a recompilation: date > a/a
Then during the build (which takes 20 secs):
date > a/b; sleep 2; date > a/c
In the log, observe how once the current build complete, the build it started twice.

Expected behavior
Any number of events during the initial build should only trigger one build.

Metadata

$  lorri info --shell-file shell.nix 
lorri version: 1.1
GC roots exist, shell_gc_root: "/home/symphorien/.cache/lorri/gc_roots/90c4ac62ff5ef60472c76eeb4f573f86/gc_root/shell_gc_root"
$  uname -a
Linux nlaptop 5.7.11 #1-NixOS SMP Wed Jul 29 08:20:01 UTC 2020 x86_64 G
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant