1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00
nix/src
Linus Heckemann 9fed865d1d 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:39:58 +00:00
..
build-remote build-remote: only allocate storeUri once 2024-07-25 14:04:03 +02:00
external-api-docs Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00
internal-api-docs Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00
libcmd Remove warning that interpretation of .drv has changed 2024-11-13 16:12:58 +00:00
libexpr Use HAVE_BOEHMGC 2024-09-19 19:04:17 +00:00
libexpr-c allow to c api with older c versions 2024-08-07 23:12:17 +00:00
libfetchers Bump fetcher cache version 2024-11-23 09:05:52 +01:00
libflake fix: add flake headers 2024-07-30 13:19:55 -04:00
libmain Merge pull request #11167 from NixOS/repl-test-rejiggle 2024-07-27 00:55:57 +02:00
libmain-c Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00
libstore local-derivation-goal: Move builder preparation to non-builtin code path 2024-10-22 17:56:06 +02:00
libstore-c Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00
libutil libutil: handle json builder log messages with unexpected format 2024-12-09 21:39:58 +00:00
libutil-c Merge pull request #11127 from NixOS/issue-10635-c-api-error-enum 2024-07-29 16:00:58 +02:00
nix Resolve conflict 2024-12-06 12:13:12 +01:00
nix-build fix env-vars beeing written to /tmp 2024-10-22 12:13:47 +00:00
nix-channel downloadFile(): Remove the "locked" (aka "immutable") flag 2024-04-08 15:56:16 +02:00
nix-collect-garbage inline the usage of nix::readDirectory 2024-05-12 17:42:18 +05:30
nix-copy-closure Restrict some code to StoreDirConfig 2023-11-04 19:05:36 -04:00
nix-env Make abort() call sites log first 2024-07-24 16:52:04 +02:00
nix-instantiate No global settings in libnixfetchers and libnixflake 2024-07-12 08:50:28 -04:00
nix-store Make abort() call sites log first 2024-07-24 16:52:04 +02:00
perl add werror=suggest-override 2024-07-25 07:41:12 +02:00
nix-expr-test-support Put back files for now 2024-07-02 09:26:22 -04:00
nix-expr-tests Put back files for now 2024-07-02 09:26:22 -04:00
nix-fetchers-tests Put back files for now 2024-07-02 09:26:22 -04:00
nix-flake-tests Put back files for now 2024-07-02 09:26:22 -04:00
nix-store-test-support Put back files for now 2024-07-02 09:26:22 -04:00
nix-store-tests Put back files for now 2024-07-02 09:26:22 -04:00
nix-util-test-support Put back files for now 2024-07-02 09:26:22 -04:00
nix-util-tests Put back files for now 2024-07-02 09:26:22 -04:00