nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
663 stars 24 forks source link

lorri 1.3 evaluates shell.nix on all pings #11

Closed symphorien closed 3 years ago

symphorien commented 3 years ago

Describe the bug lorri 1.3 evaluates shell.nix on all pings, an not only on the first one.

To Reproduce Steps to reproduce the behavior:

  1. create a folder /tmp/foobar with shell.nix:
    with import <nixpkgs> {}; mkShell {}
  2. start lorri:
    strace -fe trace=execve -e status=successful --quiet=attach,exit target/release/lorri daemon
  3. in /tmp/foobar
    $  for i in $(seq 1 10); do date; lorri internal ping shell.nix; sleep 5; done
    ven. 05 mars 2021 17:47:52 CET
    ven. 05 mars 2021 17:47:57 CET
    ven. 05 mars 2021 17:48:02 CET
    ven. 05 mars 2021 17:48:07 CET
    ven. 05 mars 2021 17:48:12 CET
    ven. 05 mars 2021 17:48:17 CET
    ven. 05 mars 2021 17:48:22 CET
    ven. 05 mars 2021 17:48:27 CET
    ven. 05 mars 2021 17:48:32 CET
    ven. 05 mars 2021 17:48:37 CET

Log:

$  strace -fe trace=execve -e status=successful --quiet=attach,exit target/release/lorri daemon
execve("target/release/lorri", ["target/release/lorri", "daemon"], 0x7fffc7c58a20 /* 155 vars */) = 0
Mar 05 17:47:17.396 INFO ready
Mar 05 17:47:19.681 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3203] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmppBq7Hr/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3214] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3203, si_uid=1000, si_status=0, si_utime=67, si_stime=12} ---
[pid  3304] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp8tr87X/result", "--", "/run/user/1000/.tmppBq7Hr/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3305] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3304, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:47:20.755 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:47:23.722 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3360] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpYLmAvD/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3373] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3360, si_uid=1000, si_status=0, si_utime=65, si_stime=12} ---
[pid  3439] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpmXVt0Y/result", "--", "/run/user/1000/.tmpYLmAvD/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3440] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3439, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:47:24.762 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:47:52.753 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3478] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpbjELxN/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3479] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3478, si_uid=1000, si_status=0, si_utime=62, si_stime=10} ---
[pid  3495] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp4656ya/result", "--", "/run/user/1000/.tmpbjELxN/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3497] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3495, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:47:53.696 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:47:57.766 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3524] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpVrXEaq/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3526] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3524, si_uid=1000, si_status=0, si_utime=62, si_stime=10} ---
[pid  3541] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpoaSJCr/result", "--", "/run/user/1000/.tmpVrXEaq/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3522] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3541, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:47:58.757 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:02.781 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3564] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpUatCzq/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3562] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3564, si_uid=1000, si_status=0, si_utime=61, si_stime=12} ---
[pid  3584] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpQMrnUp/result", "--", "/run/user/1000/.tmpUatCzq/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3586] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3584, si_uid=1000, si_status=0, si_utime=1, si_stime=0} ---
Mar 05 17:48:03.800 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:07.797 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3607] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpS0Dpws/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3608] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3607, si_uid=1000, si_status=0, si_utime=69, si_stime=12} ---
[pid  3633] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp247CyY/result", "--", "/run/user/1000/.tmpS0Dpws/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3635] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3633, si_uid=1000, si_status=0, si_utime=1, si_stime=1} ---
Mar 05 17:48:08.868 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:12.812 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3656] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmp0ZM8TA/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3657] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3656, si_uid=1000, si_status=0, si_utime=68, si_stime=13} ---
[pid  3673] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpYwzBB8/result", "--", "/run/user/1000/.tmp0ZM8TA/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3654] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3673, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:48:13.876 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:17.826 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3697] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpLlQZ73/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3699] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3697, si_uid=1000, si_status=0, si_utime=62, si_stime=11} ---
[pid  3714] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpcL6sdt/result", "--", "/run/user/1000/.tmpLlQZ73/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3715] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3714, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:48:18.831 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:22.843 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3745] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpk3IZdS/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3747] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3745, si_uid=1000, si_status=0, si_utime=71, si_stime=14} ---
[pid  3763] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpKuHVRL/result", "--", "/run/user/1000/.tmpk3IZdS/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3765] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3763, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:48:23.937 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:27.860 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3825] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpJbpqz4/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3828] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3825, si_uid=1000, si_status=0, si_utime=68, si_stime=13} ---
[pid  3847] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpiaphwB/result", "--", "/run/user/1000/.tmpJbpqz4/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3849] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3847, si_uid=1000, si_status=0, si_utime=1, si_stime=0} ---
Mar 05 17:48:28.938 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:32.875 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3889] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpdAN3fh/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3890] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3889, si_uid=1000, si_status=0, si_utime=61, si_stime=13} ---
[pid  3915] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpipr79T/result", "--", "/run/user/1000/.tmpdAN3fh/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3917] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3915, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:48:33.890 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:37.891 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  3943] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpBnP510/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3944] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3943, si_uid=1000, si_status=0, si_utime=68, si_stime=13} ---
[pid  3992] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpv887FQ/result", "--", "/run/user/1000/.tmpBnP510/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  3993] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3992, si_uid=1000, si_status=0, si_utime=1, si_stime=0} ---
Mar 05 17:48:38.959 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
Mar 05 17:48:42.967 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
[pid  4060] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpEZlLbv/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  4074] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4060, si_uid=1000, si_status=0, si_utime=70, si_stime=13} ---
[pid  4152] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp9s78Qy/result", "--", "/run/user/1000/.tmpEZlLbv/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
[pid  4154] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4152, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
Mar 05 17:48:44.079 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })

Expected behavior Lorri should evaluate shell.nix (that is, run nix-instantiate) only:

  1. on the first ping after daemon startup
  2. after inotfy events

Metadata

$  lorri info --shell-file shell.nix
lorri version: 1.3
GC roots exist, shell_gc_root: "/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root"
$ uname -a
Linux bete 5.10.17 #1-NixOS SMP Wed Feb 17 10:02:30 UTC 2021 x86_64 GNU/Linux

Reproduced on top of a26745e404c3a201fe98af4c000bb27f910542b1

Profpatsch commented 3 years ago

Pings are intended to cause unconditional evaluation, that’s their primary use. The watcher will create its own events when a file changes, so I don’t see what this would give us?

Profpatsch commented 3 years ago

Lorri direnv sends a ping, I assume that was the reason for this issue?

It should probably send something that has the behavior you propose instead.

symphorien commented 3 years ago

Lorri direnv sends a ping, I assume that was the reason for this issue?

Yes.

I am quite sure the expected behavior I describe is the previous behavior. I have been using lorri direnv as long as I have been using lorri, and this is a new regression. It results in a very noticeable behavior: every time the prompt is displayed, lorri reevaluates and direnv displays that is redefines the environment.

Pings are intended to cause unconditional evaluation, that’s their primary use

I think ping is meant to trigger a rebuild only if the directory was not already watched, so that when you first enter the repo you build it, because maybe something changed in the repo when it was not watched. But afterwards, it serves no purpose, as inotify is enough. nix-direnv sends a ping on very prompt display in order to notify on the "first entering the repo" event.

Profpatsch commented 3 years ago

But afterwards, it serves no purpose, as inotify is enough.

Bear in mind that ping is an internal command to serve mainly for debugging issues. I wouldn’t trust the file watcher in all cases.

But you are right, we should switch direnv over to only trigger a reeval only when nothing was watched yet, e.g. by introducing a start-watching command.

As to it not being the case until the rewrite, it might just have been a side effect of the general brokenness of the builder. I’m certain that the semantics of ping has always been “schedule a rebuild unconditionally”.

symphorien commented 3 years ago

Having lorri direnv use a new start-watching command looks good.