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
haskellPackages.ghcWithPackages: Wrap haddock with GHC lib dir #37132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me. Did you (or the person who reported this problem originally) test whether this fix actually solves the problem?
An alternative suggestion would be to try and use the haskellPackages.haddock
program rather than the one bundled with ghc
, because that tool should work automatically due to the patches we apply to ghc-paths
.
@@ -95,6 +95,14 @@ symlinkJoin { | |||
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}" | |||
fi | |||
done | |||
|
|||
if [[ -x "${ghc}/bin/haddock" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, could you please add a reference to #36976 into the source code as a comment? That makes it easier for people who are reading the source code to grok why that wrapper is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, github got confused by my (too eager) squash. Here's the comment:
# haddock was referring to the base ghc, https://github.com/NixOS/nixpkgs/issues/36976
Here's what I tested, inspired by @mrkkrp
|
Motivation for this change
#36976
haddock isn't wrapped up in ghcWithPackages and friends. I think it's safe to do so, but I'm unsure whether this is the right approach, so I'm looking for feedback.
Things done
Wrapped up haddock with only
-B$NIX_${ghcCommandCaps}_LIBDIR
. I think this is sufficient, but maybe it doesn't hurt to simply use the wrapper used for eg. the ghc executable, which adds more env vars?build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)