From 61eaaf618422f26f7d3772285eccb595ba2ea48d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Thu, 19 Mar 2026 13:43:18 -0700 Subject: [PATCH] tests.buildenv: assert that structuredAttrs is broken buildEnv's builder.pl reads all inputs from environment variables, which is incompatible with structuredAttrs (values go into a JSON file instead). Document this known failure as a test. --- pkgs/test/buildenv.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/test/buildenv.nix b/pkgs/test/buildenv.nix index 952177546579..433be3c7b103 100644 --- a/pkgs/test/buildenv.nix +++ b/pkgs/test/buildenv.nix @@ -277,6 +277,19 @@ let touch $out ''; + # buildEnv's builder.pl reads all inputs from environment variables, + # which is incompatible with structuredAttrs (values go into a JSON file instead). + # This test documents the known failure so it can be tracked. + structuredAttrs-is-broken = pkgs.testers.testBuildFailure' { + drv = buildEnv { + name = "test-env-structuredAttrs"; + paths = [ pkgs.hello ]; + derivationArgs.__structuredAttrs = true; + }; + expectedBuilderExitCode = 255; # Perl's `die` exits with code 255 + expectedBuilderLogEntries = [ "malformed JSON string" ]; + }; + ignoreCollisions = pkgs.runCommand "test-buildenv-ignoreCollisions" {