From 0ce6504c6c0679f45505273af59f00048a405d1d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 25 Dec 2025 21:33:39 +0000 Subject: [PATCH] pkgsLLVM.git-doc: improve eval error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the change `pkgsLLVM.git-doc` evaluated to uncatchable error: $ nix build --no-link -f. pkgsLLVM.git-doc error: … while evaluating a branch condition at pkgs/top-level/splice.nix:59:11: 58| # on to splice them together. 59| if lib.isDerivation defaultValue then | ^ 60| augmentedValue … while evaluating the attribute 'git-doc' at pkgs/top-level/all-packages.nix:1159:3: 1158| 1159| git-doc = lib.addMetaAttrs { | ^ 1160| description = "Additional documentation for Git"; (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: attribute 'doc' missing at pkgs/top-level/all-packages.nix:1165:5: 1164| ''; 1165| } gitFull.doc; | ^ 1166| Did you mean src? After the change it's more typical `throw` error: $ nix build --no-link -f. pkgsLLVM.git-doc error: … while evaluating a branch condition at pkgs/top-level/splice.nix:59:11: 58| # on to splice them together. 59| if lib.isDerivation defaultValue then | ^ 60| augmentedValue … while evaluating the attribute 'git-doc' at pkgs/top-level/all-packages.nix:1159:3: 1158| 1159| git-doc = | ^ 1160| # doc attribnute is not present at least for pkgsLLVM (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: 'git-doc' can't be evaluated as 'gitFull' does no expose 'doc' attribute Co-authored-by: Colin Co-authored-by: Doron Behar --- pkgs/top-level/all-packages.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d24e7993433..9f1833803585 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1156,13 +1156,18 @@ with pkgs; # Git with SVN support, but without GUI. gitSVN = lowPrio (git.override { svnSupport = true; }); - git-doc = lib.addMetaAttrs { - description = "Additional documentation for Git"; - longDescription = '' - This package contains additional documentation (HTML and text files) that - is referenced in the man pages of Git. - ''; - } gitFull.doc; + git-doc = + # doc attribute is not present at least for pkgsLLVM + if (gitFull ? doc) then + lib.addMetaAttrs { + description = "Additional documentation for Git"; + longDescription = '' + This package contains additional documentation (HTML and text files) that + is referenced in the man pages of Git. + ''; + } gitFull.doc + else + throw "'git-doc' can't be evaluated as 'gitFull' does not expose 'doc' attribute"; gitMinimal = git.override { withManual = false;