Skip to content

pkgsLLVM.git-doc: improve eval error#474199

Merged
doronbehar merged 1 commit intoNixOS:masterfrom
trofi:pkgsLLVM.git-doc-fix-eval
Dec 27, 2025
Merged

pkgsLLVM.git-doc: improve eval error#474199
doronbehar merged 1 commit intoNixOS:masterfrom
trofi:pkgsLLVM.git-doc-fix-eval

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Dec 25, 2025

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

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Dec 25, 2025
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Dec 26, 2025
@trofi trofi force-pushed the pkgsLLVM.git-doc-fix-eval branch from 285a6b6 to f7ae2ec Compare December 26, 2025 11:53
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the relation of this PR to #432788 or why is gitFull.outputs dependent upon pkgs v.s pkgsLLVM but I guess this makes sense.

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 <[email protected]>
Co-authored-by: Doron Behar <[email protected]>
@trofi trofi force-pushed the pkgsLLVM.git-doc-fix-eval branch from eb60b5e to 0ce6504 Compare December 26, 2025 16:50
@trofi
Copy link
Contributor Author

trofi commented Dec 26, 2025

I don't understand the relation of this PR to #432788 or why is gitFull.outputs dependent upon pkgs v.s pkgsLLVM but I guess this makes sense.

Before PR #432788 git-doc failed the eval as:

error: assertion '(sendEmailSupport -> perlSupport)' failed

That it's a typical way to declare "no support". builtins.tryEval can catch it.

Note that pkgsLLVM is a cross-target (thus PR #432788 changes the eval behaviour):

nix-repl> pkgsLLVM.stdenv.buildPlatform == pkgsLLVM.stdenv.hostPlatform
false

After PR #432788 git-doc started failing on a missing attribute:

error: attribute 'doc' missing

@doronbehar doronbehar added this pull request to the merge queue Dec 27, 2025
Merged via the queue into NixOS:master with commit cf17ead Dec 27, 2025
28 of 30 checks passed
@trofi trofi deleted the pkgsLLVM.git-doc-fix-eval branch December 27, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants