ocamldoc: use ocamldoc.opt when available to build documentation and manpages#8837
ocamldoc: use ocamldoc.opt when available to build documentation and manpages#8837dra27 merged 5 commits intoocaml:trunkfrom
Conversation
8e4cdf1 to
99e85d5
Compare
|
I've never been sure why opam-repository does this, but the |
dra27
left a comment
There was a problem hiding this comment.
In these autoconf days, it would be good if we were heading towards ./configure && make all && make install - i.e. no more world, opt, opt.opt, world.opt, etc. but configure properly determining what's to be built and then make just doing it. That would certainly make this change simpler, but it's a very clear win - modulo the fix I note.
ocamldoc/Makefile
Outdated
| else | ||
| OCAMLDOC_RUN=$(OCAMLRUN) ./$(OCAMLDOC) | ||
| endif | ||
| OCAMLDOC_RUN_BYTE=$(OCAMLRUN) -I $(ROOTDIR)/otherlibs/$(UNIXLIB) -I $(ROOTDIR)/otherlibs/str ./$(OCAMLDOC) |
There was a problem hiding this comment.
This breaks make world on a --disable-shared build. The issue is that when shared support isn't available, ocamldoc is built with -custom so mustn't be invoked via ocamlrun
There was a problem hiding this comment.
Note: I can't find where in the Makefile logic -custom is used in absence of shared libraries (or at all) to compile ocamldoc. (There is logic to that effect in Makefile.tools but as far as I can tell it's not used to build ocamldoc.)
There was a problem hiding this comment.
It's done using the "lib_custom" flag in and str.cmo & unix.cmo - on a system without shared linking, using the .cmo forces -custom mode (see https://github.com/ocaml/ocaml/blob/trunk/file_formats/cmo_format.mli#L55 and https://github.com/ocaml/ocaml/blob/trunk/bytecomp/bytelink.ml#L55)
There was a problem hiding this comment.
Wow. Thanks. I'll definitely add a comment in the ocamldoc Makefile to point this out.
99e85d5 to
591f3f8
Compare
|
I do entirely approve, but I’d like Sébastien to have a chance to comment, if that’s ok? |
|
That's fine with me, thanks. (Re. |
|
Just to annoy everyone: what happens with platforms where ocamlopt is not supported? There was a time when Debian (people who care about man pages) cared about hppa, m68k, and ia64, while ocamlopt support for these platforms was removed. It was important for them that a fully-functional, bytecode-only OCaml system could be built. In all honesty, I don't know if they or anyone else still care. |
|
If I'm industrializing this technique in #8840. |
|
(cc @shindere) |
|
Sorry for the delay on this.
@gache: would you mind fixing the confilict in Changes, rebase and
perhaps cleaning up the history a bit?
I would then be happy to approve/merge.
|
212b88b to
ab217a7
Compare
|
Thanks @shindere; I rebased and updated the PR. Most commits are independent of each other and have their specific purpose, but I merged the Changes-entry commit into the main commit. |
The odoc_fhtml file required by this test seems to have been part of the ocamldoc distribution sometime in the distant past (see 27934ab from 2002) but I can't find traces of it in the git history of the compiler distribution.
|
Thanks, @gasche.
Waiting for CI to be happy and then either I can merge or any body else
includinng you can do so.
|
ab217a7 to
9067d0e
Compare
ocamldoc: use ocamldoc.opt when available to build documentation and manpages (cherry picked from commit 354bf8e)
ocamldoc: use ocamldoc.opt when available to build documentation and manpages (cherry picked from commit 354bf8e)
ocamldoc: use ocamldoc.opt when available to build documentation and manpages (cherry picked from commit 354bf8e)
ocamldoc: use ocamldoc.opt when available to build documentation and manpages (cherry picked from commit 354bf8e)
ocamldoc: use ocamldoc.opt when available to build documentation and manpages (cherry picked from commit 354bf8e)
ocamldoc: use ocamldoc.opt when available to build documentation and manpages (cherry picked from commit 354bf8e)
ocamldoc: use ocamldoc.opt when available to build documentation and manpages (cherry picked from commit 354bf8e)
This PR tweaks the build system of ocamldoc to use ocamldoc.opt to build documentation when available, and it also tweaks the root Makefile to build manpages (whose compilation time has been a hot topic of discussion in #8835) later in the build, when ocamldoc.opt may be available.
Before that PR, building the manpages takes 14s on my machine (it was 16s before #8836). After that PR, it takes 4s (5s before #8836). All other document targets benefit (
html_doc, introduced to test HTML rendering of documentation comments, goes from 36s to 8.5s) but they are not part of the default build.To check this PR I tried to run all the tests from ocamldoc's Makefile; it looks like some of them have bitrotten away, and I removed one that could not be run at all.