1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 06:22:42 +01:00
nix/src
Linus Heckemann ee03fd478e 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)
2024-12-09 15:59:59 +01:00
..
build-remote build-remote: only allocate storeUri once 2024-07-25 14:04:03 +02:00
external-api-docs Add nix-flake-c, nix_flake_init_global, nix_flake_settings_new 2024-11-24 23:57:24 +01:00
internal-api-docs Fix most DoxyGen warnings 2024-11-12 15:34:24 +01:00
libcmd fix(treewide): remove unnecessary copying in range for loops 2024-11-26 00:06:29 +03:00
libexpr Fix typo (#12015) 2024-12-05 19:10:59 +00:00
libexpr-c refactor: Extract unsafe_new_with_self 2024-11-24 23:57:24 +01:00
libexpr-test-support build(lib{expr,store,util}-test-support): depend on -c libraries 2024-11-24 09:53:10 +00:00
libexpr-tests parser-state: fix attribute merging 2024-11-27 21:41:47 +01:00
libfetchers Merge pull request #11937 from xokdvium/dev/exterminate-dead-variables 2024-11-24 10:50:58 +01:00
libfetchers-tests Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common 2024-11-21 20:34:54 +01:00
libflake chore: get rid of dead code and unused variables where appropriate 2024-11-22 18:05:53 +03:00
libflake-c Add nix-flake-c, nix_flake_init_global, nix_flake_settings_new 2024-11-24 23:57:24 +01:00
libflake-tests Add nix-flake-c, nix_flake_init_global, nix_flake_settings_new 2024-11-24 23:57:24 +01:00
libmain Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common 2024-11-21 20:34:54 +01:00
libmain-c Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common 2024-11-21 20:34:54 +01:00
libstore s3-binary-cache: show the error's request ID 2024-12-04 05:49:21 -05:00
libstore-c Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common 2024-11-21 20:34:54 +01:00
libstore-test-support build(lib{expr,store,util}-test-support): depend on -c libraries 2024-11-24 09:53:10 +00:00
libstore-tests Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common 2024-11-21 20:34:54 +01:00
libutil libutil: handle json builder log messages with unexpected format 2024-12-09 15:59:59 +01:00
libutil-c Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common 2024-11-21 20:34:54 +01:00
libutil-test-support Merge pull request #11940 from NixOS/c-api-libflake 2024-11-25 10:00:56 +01:00
libutil-tests fix(treewide): remove unnecessary copying in range for loops 2024-11-26 00:06:29 +03:00
nix nix hash: Don't print 'nix hash' deprecation message 2024-12-05 16:25:05 +01:00
nix-build Fix issue 11892 2024-11-18 21:04:04 +01:00
nix-channel Don't use OS_STR in nix-channel.cc 2024-08-18 18:27:20 +05:30
nix-collect-garbage More std::filesystem for nix-collect-garbage 2024-08-26 17:29:23 -04:00
nix-copy-closure Restrict some code to StoreDirConfig 2023-11-04 19:05:36 -04:00
nix-env Work around gcc warning 2024-11-28 15:25:51 +01:00
nix-instantiate No global settings in libnixfetchers and libnixflake 2024-07-12 08:50:28 -04:00
nix-store fix(treewide): remove unnecessary copying in range for loops 2024-11-26 00:06:29 +03:00
perl src/perl/meson.build: fall back to 'bz2' library lookup 2024-11-26 18:37:53 +00:00
nix-functional-tests Build Functional tests with Meson 2024-08-14 15:35:40 -04:00
nix-manual Build the manual with Meson 2024-10-09 11:58:17 -04:00