-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
llvm-4/clang-4: Build and install man pages #25921
Conversation
@dtzWill, thanks for your PR! By analyzing the history of the files in this pull request, we identified @copumpkin to be a potential reviewer. |
@@ -13,20 +13,32 @@ let | |||
mv clang-tools-extra-* $sourceRoot/tools/extra | |||
''; | |||
|
|||
buildInputs = [ cmake libedit libxml2 llvm python ]; | |||
buildInputs = [ cmake libedit libxml2 llvm python python.pkgs.sphinx ]; |
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.
since this is a rebuild for darwin anyway, can you move cmake, ... to nativeBuildInputs
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.
Hmm, okay. I'll push that here although it changes the scope of the PR a bit.. feel free to retitle it if you'd like 👍.
postPatch = '' | ||
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp | ||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp | ||
|
||
# Patch for standalone doc building | ||
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt | ||
''; | ||
|
||
outputs = [ "out" "python" ]; |
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.
perhaps this should include man
, since this is part of the darwin stdenv?
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.
Erm, not sure what you mean sorry! Sounds like you're suggesting adding 'man' as an additional output, but I'm not sure what impact that would have on the Darwin stdenv (positive or negative).
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.
yes indeed, adding "man"
to the outputs and copying them to $man
instead.
- without that every darwin user will end up with the manpages on their system, regardless if they installed it in a way that man can even find them.
- having a separate output also allows users to install the manpages without polluting their global environment with the cc and clang binaries.
for example:
{ pkgs, ... }:
{
environment.systemPackages = [ llvm.man clang.man ];
}
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.
Hmm, is there a good way to avoid including the manpages in stdenv but still include them when installing the compiler explicitly?
Looking into it, looks like cc-wrapper
propagates the man
output which I believe satisfies the "make available when explicitly installed" part of my question above.
Neat re:installing man pages globally without their binaries, I hadn't thought about that and it seems very useful indeed!
I'll make that change shortly, although I don't think i can check whether the Darwin stdenv ends up containing the man page or not.
(rebuilding, will push once it at least builds locally :))
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.
I think meta.outputsToInstall
is used when you want to include an output by default when 'installing'. And I'm pretty sure that's not used when it's just a build input.
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.
As for checking the darwin stdenv, I think you can do this and check for clang-*-man.
nix-store -qR $(nix-instantiate -A stdenv --argstr system x86_64-darwin)
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.
Neat! Looks like it's working, then! 👍
Thanks for the comments/review, updated! |
ad86fcf
to
3d1c1c5
Compare
Looks like something in the stdenv is trying to refer to the man output 😕, also not sure why that breaks the build.
|
That should do it. I don't think it's possible not to reference the man output unless we change the cc-wrapper to also use multiple outputs. |
FYI. I added support for multiple outputs to the cc-wrapper in #26153 |
Woohoo, thanks! |
BTW, I'm not convinced that tiny outputs without extra dependencies are worth splitting.
EDIT: well, if there was some use case for having the man pages without the rest, that would be a very good reason. At least in general I fail to see use cases for having documentation without the documented thing itself. |
@vcunat Size isn't the main reason why I suggested it. I think installing compilers in the system/user profile is a bad idea because it makes |
Hmm, right, that makes good-enough sense to me. |
Motivation for this change
man pages are useful!
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)