Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 562008 - =sys-devel/llvm-3.7.0[-doc,ocaml] fails during install phase due to missing directory docs/ocamldoc/html
Summary: =sys-devel/llvm-3.7.0[-doc,ocaml] fails during install phase due to missing d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-02 02:16 UTC by Olivier Huber
Modified: 2015-10-12 18:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
tentative patch (llvm-ocamldoc.patch,3.05 KB, patch)
2015-10-02 02:16 UTC, Olivier Huber
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Huber 2015-10-02 02:16:08 UTC
Created attachment 413476 [details, diff]
tentative patch

from build.log:
CMake Error at docs/cmake_install.cmake:36 (file):
  file INSTALL cannot find
  /var/tmp/portage/sys-devel/llvm-3.7.0-r1/work/llvm-3.7.0.src-abi_x86_64.amd64/docs/ocamldoc/html.
Call Stack (most recent call first):
  cmake_install.cmake:66 (include)


FAILED: cd /var/tmp/portage/sys-devel/llvm-3.7.0-r1/work/llvm-3.7.0.src-abi_x86_64.amd64 && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.

The offending line in llvm-3.7.0.src-abi_x86_64.amd64/docs/cmake_install.cmake is 

file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/docs/ocaml/html" TYPE DIRECTORY FILES "/var/tmp/portage/sys-devel/llvm-3.7.0-r1/work/llvm-3.7.0.src-abi_x86_64.amd64/docs/ocamldoc/html")

Since it was so close to being installed and removed this line and continued with "ebuild llvm-3.7.0-r1.ebuild merge" and it installed went through.
But this removed the build.log :(


I think the issue is in docs/CMakeLists.txt. There is no mechanism to conditionally enable the documentation (like LLVM_ENABLE_SPHINX or LLVM_ENABLE_DOXYGEN).
I attached a POC patch: it basically use a LLVM_ENABLE_OCAMLDOC to conditionally build the ocaml documentation.
In the ebuild I would add "-DLLVM_ENABLE_OCAMLDOCS=$(usex doc)"

If this makes sense to the maintainer I can test the patch (while also testing if the fix proposed in https://bugs.gentoo.org/show_bug.cgi?id=559624 works).
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-04 06:46:15 UTC
Hmm, if I understand the code correctly, there's 'ocaml_doc' target we're supposed to use to create the needed docs, correct?
Comment 2 Olivier Huber 2015-10-05 15:27:12 UTC
(In reply to Michał Górny from comment #1)
> Hmm, if I understand the code correctly, there's 'ocaml_doc' target we're
> supposed to use to create the needed docs, correct?

Yes, and I think it works, if we want to build the documentation. Also in this bug report https://bugs.gentoo.org/show_bug.cgi?id=559940 they successfully build llvm[ocaml,doc] after deleting the previous ocaml files. But I'm not interested in building the documentation.

The issue with this cmake code is that it is expected that the documentation is always build if the ocaml bindings are being built. The install statement in docs/CMakeLists.txt

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html DESTINATION docs/ocaml/html)

that caused the error cannot be disabled by a switch. But this directory does not exists if the ocaml documentation has not being created. I guess the ocaml_doc target is run by this part in the ebuild.

# TODO: not sure why this target is not correctly called
multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc


With this patch, I'm just trying to replicate the logic used for the sphinx and doxygen documentation, that is has a boolean to control the documentation generation. Since I added the correct indenting, it looks like a lot changed, but I added only 1 line at the top and on at the end.

Since it takes almost forever to build llvm, I'd rather have a go from a gentoo dev before trying a fix that would not be considered.
I agree it's not great to tackle two unrelated issue at a time, but this package is a beast.
Comment 3 Bernard Cafarelli gentoo-dev 2015-10-12 09:51:16 UTC
Thanks for the report and the work here!

The final decision is probably for upstream, but in the meantime, I'm inclined to use existing LLVM_BUILD_DOCS:
LLVM_BUILD_DOCS:BOOL
Enables all enabled documentation targets (i.e. Doxgyen and Sphinx targets) to be built as part of the normal build. If the install target is run then this also enables all built documentation targets to be installed.

I'll try a build with modified test:
if( NOT uses_ocaml LESS 0 AND LLVM_BUILD_DOCS)
Comment 4 Bernard Cafarelli gentoo-dev 2015-10-12 18:23:51 UTC
Tested and committed in 3.7.0-r2 (still masked for #559624 testing), don't hesitate to reopen if you still have problems!