NixOS / hydra

Hydra, the Nix-based continuous build system
http://nixos.org/hydra
GNU General Public License v3.0
1.1k stars 291 forks source link

Use factored-out `BuildResult` serializer #1318

Closed Ericson2314 closed 7 months ago

Ericson2314 commented 7 months ago

For the record, here is the Nix 2.19 version: https://github.com/NixOS/nix/blob/2.19-maintenance/src/libstore/serve-protocol.cc, which is what we would initially use.

It is a more complete version of what Hydra has today except for one thing: it always unconditionally sets the start/stop times.

I think that is correct at the other end seems to unconditionally measure them, but just to be extra careful, I reproduced the old behavior of falling back on Hydra's own measurements if startTime is 0.

The only difference is that the fallback stopTime is now measured from after the entire BuildResult is transferred over the wire, but I think that should be negligible if it is measurable at all. (And remember, this is fallback case I already suspect is dead code.)