This is an archive of the discontinued LLVM Phabricator instance.

[ocaml] [cmake] Fix make install error due to missing ocaml_doc
Needs ReviewPublic

Authored by jankratochvil on Jun 10 2021, 2:05 AM.

Details

Reviewers
jberdine
Summary

I have enabled ocaml build (to prevent undetected build breakage of 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")
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.

Diff Detail

Event Timeline

jankratochvil created this revision.Jun 10 2021, 2:05 AM
jankratochvil requested review of this revision.Jun 10 2021, 2:05 AM