nix-super/src
Maximilian Bosch 3d525e96c0
ssh-ng: also store build logs to make them accessible by nix log
Right now when building a derivation remotely via

    $ nix build -j0 -f . hello -L --builders 'ssh://builder'

it's possible later to read through the entire build-log by running
`nix log -f . hello`. This isn't possible however when using `ssh-ng`
rather than `ssh`.

The reason for that is that there are two different ways to transfer
logs in Nix through e.g. an SSH tunnel (that are used by `ssh`/`ssh-ng`
respectively):

* `ssh://` receives its logs from the fd pointing to `builderOut`. This
  is directly passed to the "log-sink" (and to the logger on each `\n`),
  hence `nix log` works here.
* `ssh-ng://` however expects JSON-like messages (i.e. `@nix {log data
  in here}`) and passes it directly to the logger without doing anything
  with the `logSink`. However it's certainly possible to extract
  log-lines from this format as these have their own message-type in the
  JSON payload (i.e. `resBuildLogLine`).

  This is basically what I changed in this patch: if the code-path for
  `builderOut` is not reached and a `logSink` is initialized, the
  message was successfully processed by the JSON logger (i.e. it's in
  the expected format) and the line is of the expected type (i.e.
  `resBuildLogLine`), the line will be written to the log-sink as well.

Closes #5079
2022-02-19 21:35:34 +01:00
..
build-remote build-remote: Implicitly add the 'builtin' system type to all machines 2021-10-27 14:25:13 +02:00
libcmd InstallableFlake: Default attr paths cleanup 2022-02-14 21:06:11 +01:00
libexpr Merge pull request #6042 from pennae/fix-repl-a 2022-02-06 13:17:58 +01:00
libfetchers InputScheme::fetch(): Return a StorePath instead of a Tree 2022-02-16 11:14:01 +01:00
libmain Respect /etc/hosts 2021-12-13 19:37:30 +01:00
libstore ssh-ng: also store build logs to make them accessible by nix log 2022-02-19 21:35:34 +01:00
libutil Make sure no exceptions leave ignoreException() 2022-02-07 16:20:56 +00:00
nix Merge pull request #6103 from Radvendii/welcomeText 2022-02-17 21:06:10 +01:00
nix-build nix-shell: set BASH variable to correct shell 2022-02-05 17:56:51 +01:00
nix-channel nix-channel: use nix-env -i --remove-all to upgrade 2021-07-25 12:00:00 +00:00
nix-collect-garbage Initialize plugins after handling initial command line flags 2021-02-24 08:22:17 -05:00
nix-copy-closure copyPaths: Pass store by reference 2021-07-22 09:59:51 +02:00
nix-env Make most calls to determinePos() lazy 2022-02-04 00:33:21 +01:00
nix-instantiate Make most calls to determinePos() lazy 2022-02-04 00:33:21 +01:00
nix-store nix-store --serve: pass on settings.keepFailed from SSH store 2021-08-31 13:11:46 +02:00
resolve-system-dependencies convert a for more utilities to string_view 2022-01-27 17:15:43 +01:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00