Hi all, On +2020-11-03 14:53:07 +0100, Ludovic Courtès wrote: > Hi, > > John Soo <js...@asu.edu> skribis: > > > I was looking to pause a long build today and asked on IRC how to > > accomplish pause/resume. It seems this is possible already with the > > following: > > > > kill --signal SIGSTOP|SIGCONT {pids-of-build-process-tree} > > > > There is already a command to list the processes associated to guix > > commands: guix processes. Perhaps pause/resume can be a subcommand or > > set of flags to guix processes. The following is the first thing that > > comes to mind: > > > > guix processes --pause package-name ... --resume package-name ... > > > > What do you think? > > First, note that the daemon is unaware of “packages”, it only knows > about “derivations”. >
What if you turned the problem inside out, and made the derivation volunteer to be paused (at sensible places in its progress)? I.e., if you defined part of a given derivation "hash-prefixed-derivation-file-name-in-question.drv" to do a check for the existence of /var/guix/daemon-ctl/hash-prefixed-derivation-file-name-in-question.drv.sfx (.sfx appended to signify special effects :) ISTM that could open the door for some easy hacks, (and probably some dangers to watch for :) E.g. a proof of concept might be just to sleep 6 seconds (say) and repeat sleep/check until the file disappears. IWG this should not change anything for non-volunteering derivations other than the load-relief of not running the sleeping process(es). Then the person wanting to pause the derivation "hash-prefixed-derivation-file-name-in-question.drv" could do so simply by touch /var/guix/daemon-ctl/hash-prefixed-derivation-file-name-in-question.drv.sfx and deleting it when wanting to allow it to continue. Later, if that works, .sfx files could have content, for as yet unimagined purposes ;) [...] > > Conclusion: I don’t think we can implement this reliably. > IDK from the outside, but inside-out, WDYT? > HTH! > > Ludo’. > -- Regards, Bengt Richter