build queue is not debounced anymore
Describe the bug
When an event triggers a build, previously what happened was:
- If there’s no build running, the build is started
- If a build is already running, the build is queued iff there’s no other build queued for that file yet
To Reproduce Steps to reproduce the behavior:
Change a file multiple times and watch every change be translated in a (superfluous) evaluation
Expected behavior
Debounce the builds
$ lorri info current master
This is especially painful if your evaluation does a bunch of IFD! :skull:
I just changed branch on one of my lorri projects, and i tlooks like I see a
Apr 29 09:52:55 kirk lorri[20859]: Apr 29 09:52:55.362 INFO build status, message: BuildEvent(Started { nix_file: Shell("/home/jojo/project/shell.nix"), reason: FilesChanged(["/home/jojo/dfinity/project/sources.json"]) })
followed by BuildResults event for every single nix file in the project. This is probably the present bug, is it?
@Profpatsch, could you clarify this bug report?
- Is the "previous" behaviour the expected behaviour? If so, let's call it that.
- In the observed behaviour, do you see simultaneous evaluations? Or do they pile up in a queue and then get evaluated one after another? This would help clarify the relationship between this issue and https://github.com/target/lorri/issues/389.
* Or do they pile up in a queue and then get evaluated one after another?
^ this one
I did some preliminary refactoring a while ago, but didn’t come around to do the actual fix.
I think this PR is an attempt at fixing this: https://github.com/target/lorri/pull/465