NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.86k stars 1.52k forks source link

Make @nix json structured build log parsing warn instead of fail #11921

Open roberth opened 2 days ago

roberth commented 2 days ago

Motivation

A build may log with @nix something without the intent to write Nix structured logs, resulting in an obscure error. This makes it easy to understand and continues the build.

Example:

echo '@nix ]['
bad JSON log message from builder: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected ']'; expected '[', '{', or a literal
@nix ][

Context

Cherry-picked from https://gerrit.lix.systems/c/lix/+/2057 Author @lheckemann

Priorities and Process

Add :+1: to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

roberth commented 23 hours ago

Interestingly, the post-build-hook does not have @nix parsing logic, so that's what that's not in the diff.