lix-releng-staging/src
Maximilian Bosch 7a04839ea5
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-28 17:27:52 +01:00
..
build-remote Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
libcmd Replace defaultBla.$system with bla.$system.default 2022-02-22 11:47:41 +01:00
libexpr Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
libfetchers Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
libmain Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
libstore ssh-ng: also store build logs to make them accessible by nix log 2022-02-28 17:27:52 +01:00
libutil Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nix Merge pull request #6072 from Ma27/fix-nix-why-depends-non-precise 2022-02-28 11:46:50 +01:00
nix-build Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nix-channel Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nix-collect-garbage Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nix-copy-closure copyPaths: Pass store by reference 2021-07-22 09:59:51 +02:00
nix-env Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nix-instantiate Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nix-store Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
resolve-system-dependencies Fix macOS build 2022-02-21 17:14:22 +01:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00