1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00
nix/tests
Linus Heckemann 7c98167eab libutil: handle json builder log messages with unexpected format
Before this change, expressions like:

with import <nixpkgs> {};
runCommand "foo" {} ''
  echo '@nix {}' >&$NIX_LOG_FD
''

would result in Lix crashing, because accessing nonexistent fields of
a JSON object throws an exception.

Rather than handling each field individually, we just catch JSON
exceptions wholesale. Since these log messages are an unusual
circumstance, log a warning when this happens.

Fixes #544.

Change-Id: Idc2d8acf6e37046b3ec212f42e29269163dca893
(cherry picked from commit e55cd3beea710db727fd966f265a1b715b7285f3)
(cherry picked from commit ee03fd478e)
2024-12-09 21:40:23 +00:00
..
functional libutil: handle json builder log messages with unexpected format 2024-12-09 21:40:23 +00:00
installer Revert "tests.installer: Load profile with -o unset" 2024-09-18 23:06:01 +02:00
nixos Merge pull request #11832 from DeterminateSystems/fix-remote-build-test 2024-11-07 22:56:28 +01:00
repl-completion.nix Add repl completion test 2024-05-27 09:58:49 +02:00