Previously the worker process was started with environment variables from whatever first rule happened to start it.
This changes the behavior to:
- allow specifying environment variables via
env
in worker_tool - remove step-specific environment variables from the worker launch environment.
- moves
$CWD
to project root - moves
$TMP
tobuck-out/bin/<worker_tool target>_worker
This way the worker is started the same way every time. It also avoids including the (potentially huge) environment from the genrule in an actual call to exec.
In terms of code organization, I followed the existing pattern, but I think perhaps
it might make sense to move WorkerProcess
startup into WorkerTool
itself so we
don't have to pass so many arguments around.