[PATCH] D104014: [ocaml] [cmake] Fix make install error due to missing ocaml_doc

Jan Kratochvil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 02:05:03 PDT 2021


jankratochvil created this revision.
jankratochvil added a reviewer: jberdine.
jankratochvil added a project: LLVM.
Herald added subscribers: pengfei, mgorny.
jankratochvil requested review of this revision.

I have enabled ocaml build (to prevent undetected build breakage of D103910 <https://reviews.llvm.org/D103910>), on Fedora 34 x86_64:

  BuildRequires:  ocaml-findlib ocaml-ctypes ocaml-ocamldoc

But it failed:
https://download.copr.fedorainfracloud.org/results/jankratochvil/lldb/fedora-34-x86_64/02248144-lldb-experimental/builder-live.log.gz

  + /usr/bin/cmake --install x86_64-redhat-linux-gnu
  ...
  CMake Error at x86_64-redhat-linux-gnu/docs/cmake_install.cmake:46 (file):
    file INSTALL cannot find
    "/builddir/build/BUILD/lldb-experimental-13.0.0/x86_64-redhat-linux-gnu/docs/ocamldoc/html/.":
    No such file or directory.
  Call Stack (most recent call first):
    x86_64-redhat-linux-gnu/cmake_install.cmake:85 (include)

It is in fact a common error for users: Google("file INSTALL cannot find" "ocamldoc") <https://www.google.com/search?hl=en&lr=lang_en&num=100&q=%22file%20INSTALL%20cannot%20find%22%20%22ocamldoc%22>
The fix is one needs to do additional step

  make
  make ocaml_doc #!!!
  make install

This patch adds `ocaml_doc` to the default build. The disadvantage is that now on each `make` (or `ninja`) run it runs some phony commands:

  [36/36] cd /home/jkratoch/redhat/llvm-monorepo-clangassertninja/docs && /usr/bin/cmake -E...camldoc/style.css /home/jkratoch/redhat/llvm-monorepo-clangassertninja/docs/ocamldoc/html

@jberdine if you could make the dependencies clean I think this would be clearly a win. But I find it worth for check-in even as it is.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104014

Files:
  llvm/docs/CMakeLists.txt


Index: llvm/docs/CMakeLists.txt
===================================================================
--- llvm/docs/CMakeLists.txt
+++ llvm/docs/CMakeLists.txt
@@ -148,7 +148,7 @@
     list(APPEND odoc_files -load ${odoc_file})
   endforeach()
 
-  add_custom_target(ocaml_doc
+  add_custom_target(ocaml_doc ALL
     COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html
     COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html
     COMMAND ${OCAMLFIND} ocamldoc -d ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104014.351091.patch
Type: text/x-patch
Size: 572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210610/21582ea0/attachment.bin>


More information about the llvm-commits mailing list