Skip to content

Merge ocamldoc/Makefile into the root Makefile#12616

Merged
dra27 merged 8 commits intoocaml:trunkfrom
shindere:merge-ocamldoc-makefile
Oct 20, 2023
Merged

Merge ocamldoc/Makefile into the root Makefile#12616
dra27 merged 8 commits intoocaml:trunkfrom
shindere:merge-ocamldoc-makefile

Conversation

@shindere
Copy link
Copy Markdown
Contributor

This PR depends on #12586 which has not been merged yet. It start by fixing a left-over from #12321, before doing what is announced.

In addition to the two usual merges (sub-Makefile and sub .depend into the root ones), this PR also merges ocamldoc/Makefile.best_ocamldoc into Makefile.best_binaries.

Three remarks can be made:

  1. For this PR, it has not been necessary to extend the already in-place generic build framework. Not to say it won't be necessary to do so in the future (it will, for sure) but it is still pleasing to notice when things ``just work''.
  2. The changes to the root Makefile in the head commit of this PR seem very easy and straightfoward to read.
  3. On trunk, .depend and ocamldoc/.depend are 8450 and 965 lines long, thus 9415 lines in total, to be compared to the 9464 lines of the root .depend file on the PR branch. It has been checked that the 49 lines that have been added all correspond to genuine dependencies of ocamldoc either on a library (dynlink, str, unix) or on compiler internals. This PR thus does make the global dependency graph of our source base more explicit and accurate. The fact that we gain more fine-grained dependencies should ultimately allow us to get rid of more gross dependencies and thus increase the parallelism of the build.

@dra27 dra27 self-assigned this Oct 4, 2023
Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As ever, keeping up the more lines deleted than added (just!) :D

Mostly hair-spitting - odoc_test.ml should either be being removed (unlikely) or continue to be built. I think it's worth going slightly further with the refactoring of the WITH_* variables, but that's not compulsory.

We're very nearly there!

@shindere shindere force-pushed the merge-ocamldoc-makefile branch from 2bc27b4 to d1710fe Compare October 19, 2023 15:35
@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Oct 19, 2023 via email

Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor suggestion in configure.ac, but otherwise this is looking good to go!

configure.ac Outdated
Comment on lines +2257 to +2258
[AS_IF([test x"$enable_stdlib_manpages" = "xyes"],
[AC_MSG_ERROR([--enable-stdlib-manpages requires ocamldoc])])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put this test much higher up, around L532 just after the checks for the dependencies of ocamldoc - the reason is that ./configure --disable-ocamldoc --enable-stdlib-manpages does an awful lot of work before returning the error relative to ./configure --disable-unix-lib --enable-ocamldoc

shindere and others added 7 commits October 19, 2023 19:46
This is captured by the generic framework and does thus not need
to be written here.

(Follow-up to PR ocaml#12321 merging ocamltest/Makefile into the root Makefile)
This variable was used in ocamldoc/Makefile, by the test targets that got
removed in PR ocaml#12615.
This commit introduces two private build variables: OCAMLDOC_TARGET
and OCAMLDOC_OPT_TARGET.
The ./ prefix in front of $(OCAMLDOC) and $(OCAMLDOC_OPT) is not useful
since the definitions of these variables are already prefixed with
$(ROOTDIR).
Makefile.best_ocamldoc was included in two files:

1. In ocamldoc/Makefile, which also includes

  $(ROOTDIR)/Makefile.best_binaries

So that the definitions which were in Makefile.best_ocamldoc remain available.

2. In api_docgen/ocamldoc/Makefile which also includes
Makefile.best_binaries via api_docgen/Makefile.common
STDLIB_MANPAGES is still defined in Makefile.config.in for backwards
compatibility, whereas build_libraries_manpages is defined in
Maekfile.build_config.in and thus remains private.

Co-authored-by: David Allsopp <david.allsopp@metastack.com>
@shindere shindere force-pushed the merge-ocamldoc-makefile branch from d1710fe to c69b429 Compare October 19, 2023 17:50
Before this commit, the build_libraries_manpages variable (aka STDLIB_MANPAGES)
was set to true if the build of the manpages for libraries was
enabled at configure time, whether ocamldoc (which is required
 to build those manpages) was enabled or not. It was thus the build
system's responsibility to determine whether the manpages for
libraries should be built / installed,
by testing both the
build_ocamldoc and the build_libraries_manpages variables.

However, it is known at configure time whether ocamldoc is available
or not, which makes it possible to set build_libraries_manpages to
true only if the manpages for libraries have been requested AND
ocamldoc has been enabled.

This is what is done in this commit, leading to a simplification
on the build system's side since it becomes enough to test only
one variable, namely build_libraries_manpages, rather than two
like before.

Co-authored-by: David Allsopp <david.allsopp@metastack.com>
@shindere shindere force-pushed the merge-ocamldoc-makefile branch from c69b429 to 53f2a93 Compare October 19, 2023 18:39
@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Oct 19, 2023 via email

Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dra27 dra27 added the merge-me label Oct 20, 2023
@dra27 dra27 merged commit c454547 into ocaml:trunk Oct 20, 2023
@gasche
Copy link
Copy Markdown
Member

gasche commented Oct 20, 2023

Could we still have an ocamldoc-clean or clean-ocamldoc target to do what make -C ocamldoc clean would do previously? The latter is useful to me in some cases to get out of an incompatible-digests issue (by cleaning the two affected directories instead of all partialclean).

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Oct 20, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants