summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-10-28Pass workdir from driver to runnerMatthias Schiffer
The paths modules of driver and runner do not contain any duplicates anymore. One remaining path that still appears in more places than it should is /build.
2021-10-28runner: drop paths::abs() functionMatthias Schiffer
2021-10-28Move handling of current directory of task to driverMatthias Schiffer
2021-10-28Pass target directory for download archives from driver to runnerMatthias Schiffer
2021-10-28Split paths module into driver and runner partsMatthias Schiffer
There are still a few remaining paths that are defined in both driver and runner.
2021-10-28Pass full Output path to runnerMatthias Schiffer
Concatenate TASK_DESTDIR with output path in driver instead of runner to reduce amount of shared logic between driver and runner.
2021-10-28Update dependenciesMatthias Schiffer
2021-10-28Rename executor to driverMatthias Schiffer
2021-10-28executor: move some state into separate structMatthias Schiffer
2021-10-28executor: use lazy_static for template engineMatthias Schiffer
2021-10-27Update dependenciesMatthias Schiffer
2021-10-27runner: get rid of spawn argument funnellingMatthias Schiffer
2021-10-27runner: tar: simplify spawn callMatthias Schiffer
The writing end of the pipe is moved to the child process, there is no need to funnel it back to the parent process just to drop it.
2021-10-27runner: add Steal wrapper, use for socketMatthias Schiffer
A deref wrapper that allows taking out its contents, which is convenient after a fork.
2021-10-26runner: move Checkable trait into separabe moduleMatthias Schiffer
2021-10-26runner: remove another layer of child processesMatthias Schiffer
With the restructuring around the poll loop and moving the job token handling to the task process, this has become unnecessary as well.
2021-10-26runner: move jobserver token handling into task processMatthias Schiffer
We can avoid holding onto a token while waiting on a lock this way. Abnormal exits that would make us lose tokens should not happen here; if they do, the runner PID1 will stop the whole build, so a lost token does not matter.
2021-10-26runner: maintain list of task PIDs in contextMatthias Schiffer
2021-10-26runner: add RunnerContext structMatthias Schiffer
Bundle common variables passed to different functions.
2021-10-26runner: move more code into the actual task processMatthias Schiffer
Leave only the jobserver token handling in the task spawner process.
2021-10-26runner: pass jobserver to task handler as referenceMatthias Schiffer
Some code simplification.
2021-10-26runner: handle reaping and requests in the poll loopMatthias Schiffer
2021-10-26runner: wait for signals using poll()Matthias Schiffer
2021-10-26runner: use signal fd to wait for exiting child processesMatthias Schiffer
Will be used to poll for new tasks and signals in the same process.
2021-10-26executor: context: remove unneeded Serialize impl on TaskRef/OutputRefMatthias Schiffer
2021-10-26Replace ipc-channel with UNIX sockets and manual FD passingMatthias Schiffer
The new implementation is more flexible, as it allows mixed polling with other FD types, and it saves us a whole zoo of dependencies.
2021-10-26Switch to 2021 editionMatthias Schiffer
2021-10-26runner: hold lock on task state dir while task is runningMatthias Schiffer
Do not allow concurrent runs of the same task.
2021-10-26runner: do not delete whole task dir, only layer and work dirMatthias Schiffer
We will also store a lockfile in the taskdir that must not be deleted.
2021-10-26runner: make lock() function more genericMatthias Schiffer
2021-10-25Allow to set the maximum number of jobs on the command lineMatthias Schiffer
2021-10-25Add lockfile for build state directoryMatthias Schiffer
Use flock() to ensure that there are no concurrent instances using the same build state. More fine-gained locking may be implemented in the future.
2021-10-25Update dependenciesMatthias Schiffer
2021-10-25Move main crate to subdirectoryMatthias Schiffer
2021-10-25Move runner into separate crateMatthias Schiffer
2021-10-24Split defintions used by both runner and executor into separate crateMatthias Schiffer
Also get rid of the Runner trait - different runner implementations do not make sense with our current design.
2021-10-24Move util modules to container runnerMatthias Schiffer
The ipc module was unused and is removed completely.
2021-10-24container: remove unneeded "pub" visibility from BUILD_UID/BUILD_GIDMatthias Schiffer
2021-10-24Move Hasher type aliases to runnerMatthias Schiffer
2021-10-24runner: merge TaskInput struct into TaskMatthias Schiffer
2021-10-24Move definition of Dependency into runner moduleMatthias Schiffer
runner::TaskInput does not contain the dependency hashes anymore, this is handled internally in the runner module now. Unfortunately this also means that we can't use this struct directly for the InputHash anymore, but overall this reduces the complexity of the interface between runner and executor.
2021-10-24jobserver: always make the reading pipe end nonblockingMatthias Schiffer
Match the behaviour of GNU Make.
2021-10-24jobserver: preserve token valueMatthias Schiffer
The Make manual recommends to preserve the token value when interacting with a jobserver pipe. While this is mostly meant for processes run by Make rather than processes running Make and with current Make, the token value is never changed, it is easy to implement this recommendation.
2021-10-24container: pass jobserver pipe to tasks through MAKEFLAGSMatthias Schiffer
Allow all tasks to share a common job token pool.
2021-10-24examples: remove explicit parallelism handlingMatthias Schiffer
We are going to pass in a jobserver pipe through MAKEFLAGS.
2021-10-24container: create additional child process for tasksMatthias Schiffer
Ensure that we don't lose jobserver tokens even if a task exits abnormally.
2021-10-24container: add reaper loopMatthias Schiffer
Don't let the runner PID1 leave zombie processes unreaped.
2021-10-24container: implement jobserver pipeMatthias Schiffer
Limit the number of parallel tasks by the runner's CPU affinity. The jobserver is implemented as a pipe like in Make to allow passing it down to tasks.
2021-10-24container: consistently use spawn-style forkMatthias Schiffer
Also remove a few process::exit() that happen implicitly now.
2021-10-24Update dependenciesMatthias Schiffer