Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build multiple outputs #306

Closed
davidak opened this issue Feb 15, 2023 · 2 comments · Fixed by #307
Closed

How to build multiple outputs #306

davidak opened this issue Feb 15, 2023 · 2 comments · Fixed by #307
Assignees

Comments

@davidak
Copy link

davidak commented Feb 15, 2023

I reviewed a multiple output package (NixOS/nixpkgs#215728), but in results/ i see only the bin output.

[nix-shell:~/.cache/nixpkgs-review/pr-215728]$ tree results/
results/
└── geogram -> /nix/store/j64i56kvgg5wp5m1snhxwmm9wcbg2zm1-geogram-1.8.2-bin

How can i access the other? (lib)

I tried to specify it similar to nix-build, but it does not work.

https://nixos.org/manual/nix/stable/command-ref/nix-build.html#examples

[davidak@gaming:~/code/nixpkgs]$ nixpkgs-review pr -p geogram.lib 215728
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/215728/head:refs/nixpkgs-review/1
$ git worktree add /home/davidak/.cache/nixpkgs-review/pr-215728-2/nixpkgs 0621648513a20d6e6a3be974f396c0cebc1cb48d
Preparing worktree (detached HEAD 0621648513a)
Updating files: 100% (33608/33608), done.
HEAD is now at 0621648513a Merge pull request #216123 from Detegr/c64-debugger
$ git merge --no-commit --no-ff 9edb082b5a3cbd3d914038f1ddc890038e6e3543
Auto-merging pkgs/top-level/all-packages.nix
Automatic merge went well; stopped before committing as requested
The following packages specified with `-p` are not rebuilt by the pull request
geogram.lib
$ git worktree prune
[davidak@gaming:~/code/nixpkgs]$ nixpkgs-review pr -p geogram.all 215728
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/215728/head:refs/nixpkgs-review/1
$ git worktree add /home/davidak/.cache/nixpkgs-review/pr-215728-3/nixpkgs 0621648513a20d6e6a3be974f396c0cebc1cb48d
Preparing worktree (detached HEAD 0621648513a)
Updating files: 100% (33608/33608), done.
HEAD is now at 0621648513a Merge pull request #216123 from Detegr/c64-debugger
$ git merge --no-commit --no-ff 9edb082b5a3cbd3d914038f1ddc890038e6e3543
Auto-merging pkgs/top-level/all-packages.nix
Automatic merge went well; stopped before committing as requested
error: cannot coerce a list to a string

       at /nix/store/0zipgmy333i0x71xgriaa5ajz11waf1s-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/nix/evalAttrs.nix:16:27:

           15|       else
           16|         builtins.tryEval "${pkg}";
             |                           ^
           17|   in rec {
nix --experimental-features nix-command --system x86_64-linux eval --json --impure --expr (import /nix/store/0zipgmy333i0x71xgriaa5ajz11waf1s-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/nix/evalAttrs.nix { allowAliases = false; attr-json = /tmp/tmp6k5ncsg3; }) failed to run, /tmp/tmp6k5ncsg3 was stored inspection
https://github.com/NixOS/nixpkgs/pull/215728 failed to build
$ git worktree prune

Workaround

Build PR as usual:

[davidak@gaming:~/code/nixpkgs]$ nixpkgs-review pr 215728

Then use nix-build:

[nix-shell:~/.cache/nixpkgs-review/pr-215728-4]$ nix-build nixpkgs/ -A geogram.all
/nix/store/j64i56kvgg5wp5m1snhxwmm9wcbg2zm1-geogram-1.8.2-bin
/nix/store/299za097p633g4w1ig63g8k5zcf86nk6-geogram-1.8.2-lib
/nix/store/cr6wlvc22gj072r0fw0j52kbmqmpr6my-geogram-1.8.2-dev
/nix/store/jd1ys0jn7sp9bw647ch8ydp5ic3l09g6-geogram-1.8.2

I would expect nixpkgs-review to build all outputs in this way.

@figsoda
Copy link
Collaborator

figsoda commented Feb 15, 2023

Looks like nixpkgs-review does build all the outputs, but doesn't symlink all of them. The current symlink logic only symlinks one path per attribute, and the path is determined by the default output here:

builtins.tryEval "${pkg}";

@figsoda
Copy link
Collaborator

figsoda commented Feb 15, 2023

Can you see if #307 fixes the issue?

@bors bors bot closed this as completed in #307 Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants