You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NixOS configuration.nix or nix-darwin configuration:
nixpkgs.overlays = [
(final: prev: {
nixUnstable = prev.nixUnstable.overrideAttrs (o: {
patches = (o.patches or []) ++ [
# Fix #4234, send build logs to Nix 2.3 / Hercules CI 0.8
# https://github.com/NixOS/nix/pull/4418
./nix-issue-4234-build-output-for-nix-2.3.diff
];
});
# Pick up our overrides (Nixpkgs uses the same definition
# instead of a reference to the final nixUnstable attribute)
nixFlakes = final.nixUnstable;
})
];
Add to the same directory the file nix-issue-4234-build-output-for-nix-2.3.diff:
commit aae705f9fc6f118315bf6d2bb49c98e2558fa190
Author: Robert Hensing <[email protected]>
Date: Sat Jan 2 19:27:34 2021 +0100
daemon.cc: Duplicate build output as general logs for Nix 2.3
The conditional on clientVersion isn't accurate for a certain
range of master commits, but those are unsupported anyway.
It's not accurate for repeated builds either, because that
would complicate the code for too little gain.
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc
index ba5788b64..14e5b1b9b 100644
--- a/src/libstore/daemon.cc+++ b/src/libstore/daemon.cc@@ -142,6 +142,14 @@ struct TunnelLogger : public Logger
void result(ActivityId act, ResultType type, const Fields & fields) override
{
+ if (GET_PROTOCOL_MINOR(clientVersion) < 22 && type == resBuildLogLine && settings.verboseBuild) {+ // Nix < 2.4 expects build logs to be logged as general logs at lvlError.+ // We probably shouldn't do this for repeated builds, but that's not+ // something we can know here without complicating the implementation+ // unnecessarily.+ auto lastLine = fields[0].s;+ log(lvlError, lastLine);+ }
if (GET_PROTOCOL_MINOR(clientVersion) < 20) return;
StringSink buf;
buf << STDERR_RESULT << act << type << fields;
Versions >= 0.8.4 build against Nix 2.4 by default, with the possible exception of some Nixpkgs versions. This means that the Nix client version has caught up with the NIx daemon version and it won't exhibit this problem anymore.
Description
No build logs appear in the dashboard, except perhaps some lines about substitution from Nix itself.
To Reproduce
Deploy an agent system with
Solution
Soon: update Nixpkgs. For now:
Apply the following configuration to the system:
NixOS
configuration.nix
or nix-darwin configuration:Add to the same directory the file
nix-issue-4234-build-output-for-nix-2.3.diff
:Platform / Version
Hercules CI Agent: all versions
Nix: nixUnstable / master between NixOS/nix#3073 and NixOS/nix#4418
The text was updated successfully, but these errors were encountered: