-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
haskell/with-packages-wrapper.nix: install "doc" outputs #76842
haskell/with-packages-wrapper.nix: install "doc" outputs #76842
Conversation
We were previously just installing the "out" output which broke when we recently changed to generating multiple outputs. Fixes NixOS#76837
75b92cd
to
e915608
Compare
@matthewbauer Could you show me how to test that this actually fixes the problem with hoogle? My idea was to run a command like the following on the current $ nix-build -E 'with import ./. {}; haskellPackages.ghcWithPackages (p: [p.conduit])'
/nix/store/48grjcgskic4iij38sgdfx4f4q7r0hlr-ghc-8.6.5-with-packages This works, as expected. In the I then checked out this PR and tried to run the same command, but I got an error: $ hub checkout https://github.com/NixOS/nixpkgs/pull/76842
$ nix-build -E 'with import ./. {}; haskellPackages.ghcWithPackages (p: [p.conduit])'
these derivations will be built:
/nix/store/chk26hff7nhhzjyjj5fk80xm3rw3v597-ghc-8.6.3-with-packages.drv
building '/nix/store/chk26hff7nhhzjyjj5fk80xm3rw3v597-ghc-8.6.3-with-packages.drv'...
created 131 symlinks in user environment
rm: cannot remove '/nix/store/0s4vjgsz437aqmpyxxr5zqdcdcdih57j-ghc-8.6.3-with-packages/bin/ghc': Permission denied
builder for '/nix/store/chk26hff7nhhzjyjj5fk80xm3rw3v597-ghc-8.6.3-with-packages.drv' failed with exit code 1
error: build of '/nix/store/chk26hff7nhhzjyjj5fk80xm3rw3v597-ghc-8.6.3-with-packages.drv' failed I don't understand two things:
|
Yeah this was based off of
Yeah this is definitely an oversight. It looks like it is a result in moving from symlinkJoin to buildEnv. |
The wrapper need a writable directory to work, so remove the symlink to a read-only one if it occurs.
Oh, I see. That's really smart! I'm happy with this as-is, then. No need to rebase.
I've tested your fix in 93aabab and this appears to be working for me. $ nix-build -E 'with import ./. {}; haskellPackages.ghcWithPackages (p: with p; [aeson conduit lens servant-server])'
...
/nix/store/c36g05zmrflibzy5w6wji2zc0nmry3sf-ghc-8.6.3-with-packages
$ ls /nix/store/c36g05zmrflibzy5w6wji2zc0nmry3sf-ghc-8.6.3-with-packages/share/doc/
adjunctions-4.4
aeson-1.4.2.0
ansi-terminal-0.8.2
... |
Also it's usually worth trying the GitHub merge commit to test PRs. I think nix-review does this for you, but you can also use something like & test merge_commit_sha directly:
|
* Will make it so that GHC.Paths's docdir NIX_GHC_DOCDIR points to an actual directory. * Documentation of all packages in the environment is available in `$out/share/doc`. This has previously been attempted in NixOS#76842 and reverted in NixOS#77442, since documentation can collide when the libraries wouldn't (thanks to the hash in the lib filename). `symlinkJoin` allows collision, so this solution should be akin to NixOS#77523 (minus `buildEnv`, one step at a time). `installDocumentation = false` restores the old behavior. Collision in the documentation only happen if the dependency closure of the given packages has more than one different derivation for the same library of the very same version. I'm personally inclined not to claim that our infrastructure does anything sensible in this case. Additionally, the documentation is likely largely the same in such cases (unless it is heavily patched). Resolves NixOS#150666. Resolves NixOS#76837. Closes NixOS#150968. Closes NixOS#77523.
* Will make it so that GHC.Paths's docdir NIX_GHC_DOCDIR points to an actual directory. * Documentation of all packages in the environment is available in `$out/share/doc`. This has previously been attempted in NixOS#76842 and reverted in NixOS#77442, since documentation can collide when the libraries wouldn't (thanks to the hash in the lib filename). `symlinkJoin` allows collision, so this solution should be akin to NixOS#77523 (minus `buildEnv`, one step at a time). `installDocumentation = false` restores the old behavior. Collision in the documentation only happen if the dependency closure of the given packages has more than one different derivation for the same library of the very same version. I'm personally inclined not to claim that our infrastructure does anything sensible in this case. Additionally, the documentation is likely largely the same in such cases (unless it is heavily patched). Resolves NixOS#150666. Resolves NixOS#76837. Closes NixOS#150968. Closes NixOS#77523.
We were previously just installing the "out" output which broke when
we recently changed to generating multiple outputs.
Fixes #76837
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @