Page MenuHomeFreeBSD

OCaml 4.14.1 upgrade.
ClosedPublic

Authored by freebsd_dev.thsi.be on Feb 13 2024, 6:13 AM.
Tags
None
Referenced Files
F83765881: D43861.diff
Tue, May 14, 3:10 PM
Unknown Object (File)
Fri, May 10, 8:39 AM
Unknown Object (File)
Thu, May 9, 5:56 PM
Unknown Object (File)
Tue, May 7, 2:43 PM
Unknown Object (File)
Mon, May 6, 4:23 PM
Unknown Object (File)
Sat, May 4, 11:21 PM
Unknown Object (File)
Sat, May 4, 5:37 PM
Unknown Object (File)
Sat, May 4, 6:28 AM

Details

Summary

This revision updates the ports tree to OCaml 4.14.1.

Of note: the dune port carries a trivial modification to allow the
installation of stublibs into the ocaml package directory, in the way
that pure ocamlfind packages used to do. A new "ocaml:dune" USES helper has
been created, it greatly simplifies porting of projects using dune.

After this REVISION is accepted, the lang/ocaml-nox11 port should be
retired.

Test Plan
  • poudriere bulk build of ocaml depends packages
  • exp-run

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

freebsd_dev.thsi.be created this revision.

Hi,

Thanks for your work, this is a much needed update, and not an easy one!

At a cursory look the patch looks well composed, but before approval it requires some testing.

The first commits are preparation to individual ports which must be applied before applying the last commit. Those commits work on the current tree and should cause no regressions.

While I agree that keeping the commits separated in the revision is useful, especially for you, if the patches require updates, for the final commit to the ports tree I'd be more in favour of one big commit with a succinct description for the individual changes (as in a list of one line descriptions). There are reasons for this.

Every commit would require the commit message to be modified to add our standard tags, referencing this revision and all approved by/tested by lines.

This is my opinion, maybe other involved committers have different ideas.

After this REVISION is accepted, the lang/ocaml-nox11 port should be retired.

Can you explain the logic of this? While I don't really know why it exists, to remove it we need a reason.

Hi,

Thanks for your work, this is a much needed update, and not an easy one!

At a cursory look the patch looks well composed, but before approval it requires some testing.

The first commits are preparation to individual ports which must be applied before applying the last commit. Those commits work on the current tree and should cause no regressions.

While I agree that keeping the commits separated in the revision is useful, especially for you, if the patches require updates, for the final commit to the ports tree I'd be more in favour of one big commit with a succinct description for the individual changes (as in a list of one line descriptions). There are reasons for this.

Every commit would require the commit message to be modified to add our standard tags, referencing this revision and all approved by/tested by lines.

This is my opinion, maybe other involved committers have different ideas.

The idea was that each commit is not introducing any more breakage (tree is buildable at any point), but it is easier to reviewed independently. It doesn't really matter in the end. I suppose that once the review is done, I can push a squashed commits with proper commit message that contains all the information plus the necessary tags.

After this REVISION is accepted, the lang/ocaml-nox11 port should be retired.

Can you explain the logic of this? While I don't really know why it exists, to remove it we need a reason.

Well the Graphics module got dropped from 4.13.0. It lives in its own upstream repositoy now. So lang/ocaml has essentially became what lang/ocaml-nox11 was. The later having no more purpose, there is no point in keeping it. The new-old Graphics module (== the new upstream repository) is now packaged in x11-toolkits/ocaml-graphics, and it is much nicer like this (better build system, simplifies lang/ocaml).

  • lang/ocaml: Missing PKGNAMESUFFIX.
  • math/teyjus: redundant build dep.

Hi!

I tested your patch in poudriere. In general it is very good from my POV, congrats on your work.

I noticed a few minor issues (plist issues mainly) that you should check. I created comments in the Makefiles of the ports having issues.

devel/ocaml-camlp5/Makefile
1–2

I got some plist errors in poudriere:

====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: lib/ocaml/camlp5/ast2pt.cmx
Error: Orphaned: lib/ocaml/camlp5/asttools.cmi
Error: Orphaned: lib/ocaml/camlp5/asttools.cmx
Error: Orphaned: lib/ocaml/camlp5/camlp5_top_funs.cmi
Error: Orphaned: lib/ocaml/camlp5/camlp5_top_funs.cmo
Error: Orphaned: lib/ocaml/camlp5/mlsyntax.cmi
Error: Orphaned: lib/ocaml/camlp5/mlsyntax.cmx
Error: Orphaned: lib/ocaml/camlp5/pa_schemer.cmo
Error: Orphaned: lib/ocaml/camlp5/pa_schemer.cmx
Error: Orphaned: lib/ocaml/camlp5/pa_schemer.o
Error: Orphaned: lib/ocaml/camlp5/papr_phony_macro.cmo
Error: Orphaned: lib/ocaml/camlp5/papr_phony_macro.cmx
Error: Orphaned: lib/ocaml/camlp5/papr_phony_macro.o
Error: Orphaned: lib/ocaml/camlp5/pcaml.cmx
Error: Orphaned: lib/ocaml/camlp5/pp_debug.cmi
Error: Orphaned: lib/ocaml/camlp5/pp_debug.cmx
Error: Orphaned: lib/ocaml/camlp5/pr_o.cmi
Error: Orphaned: lib/ocaml/camlp5/pr_official.cmo
Error: Orphaned: lib/ocaml/camlp5/pr_official.cmx
Error: Orphaned: lib/ocaml/camlp5/pr_official.o
Error: Orphaned: lib/ocaml/camlp5/pr_r.cmi
Error: Orphaned: lib/ocaml/camlp5/prtools.cmx
Error: Orphaned: lib/ocaml/camlp5/q_MLast.cmi
Error: Orphaned: lib/ocaml/camlp5/q_ast.cmi
Error: Orphaned: lib/ocaml/camlp5/q_ast_base.cmi
Error: Orphaned: lib/ocaml/camlp5/q_ast_base.cmo
Error: Orphaned: lib/ocaml/camlp5/q_ast_base.cmx
Error: Orphaned: lib/ocaml/camlp5/q_ast_base.o
Error: Orphaned: lib/ocaml/camlp5/quotation.cmx
Error: Orphaned: lib/ocaml/camlp5/reloc.cmx
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.

The plist needs to be updated accordingly.

sysutils/ledit/Makefile
1–2

I got a strange plist issue form this port, that was not happening without the patch:

====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: @dir %%OCAML_SITELIBDIR%%
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.

but I'm not sure why this is happening. I'm not completely sure the plist must be modified, but I suspect something is creating a spurious directory.

Can you verify?

x11-toolkits/ocaml-labltk/Makefile
1

In this port, while testing here, I got some plist issues from poudriere:

====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: lib/ocaml/labltk/camltkwrap.cmi
Error: Orphaned: lib/ocaml/labltk/camltkwrap.cmx
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.

The plist needs to be updated.

This revision now requires changes to proceed.Feb 20 2024, 8:11 PM
  • devel/ocaml-camlp5: Plist fix.
  • sysutils/ledit: Plist fix, install native binary, manpage version patch.
  • x11-toolkits/ocaml-labltk: Fixes
  • devel/ocaml-findlib: Stop providing conflicting META.
  • devel/ocaml-findlib: Broken POST-DEINSTALL.
  • graphics/ocaml-lablgl: Labltk include path fix, OCAML_SITELIBDIR, shared librairies stripped, missing GL dependencies

Hi!

I tested your patch in poudriere. In general it is very good from my POV, congrats on your work.

Thank you very much for the review!

I noticed a few minor issues (plist issues mainly) that you should check. I created comments in the Makefiles of the ports having issues.

All those plist issues, along with other newly uncovered and longer standing issues, are now resolved.
Labltk and lablgl are now also moved into OCAML_SITELIBDIR/$package, with their stublibs.

freebsd_dev.thsi.be marked 3 inline comments as done.
  • lang/ocaml: Missing PKGNAMESUFFIX.
  • math/teyjus: redundant build dep.
  • devel/ocaml-camlp5: Plist fix.
  • sysutils/ledit: Plist fix, install native binary, manpage version patch.
  • x11-toolkits/ocaml-labltk: Fixes
  • devel/ocaml-findlib: Stop providing conflicting META.
  • devel/ocaml-findlib: Broken POST-DEINSTALL.
  • graphics/ocaml-lablgl: Labltk include path fix, OCAML_SITELIBDIR
  • x11-toolkits/ocaml-lablgtk2: LablGL in site-lib.

Hi,

I'm testing the latest patch.

I got a new failure in devel/ocaml-findlib:

gmake[1]: Leaving directory '/wrkdirs/usr/ports/devel/ocaml-findlib/work/findlib-1.9.6'
cd /wrkdirs/usr/ports/devel/ocaml-findlib/work/findlib-1.9.6/doc && /bin/sh -c '(/usr/bin/find -Ed $1 $3 | /usr/bin/cpio -dumpl $2 >/dev/null 2>&1) &&  /usr/bin/find -Ed $1 $3 \(   -type d -exec /bin/sh -c '\''cd '\''$2'\'' && chmod 755 "$@"'\'' . {} +  -o -type f -exec /bin/sh -c '\''cd '\''$2'\'' && chmod 0644 "$@"'\'' . {} + \)' COPYTREE_SHARE \* /wrkdirs/usr/ports/devel/ocaml-findlib/work/stage/usr/local/share/doc/ocaml/findlib  "! -regex .*ref-man.*"
/bin/chmod 755 /wrkdirs/usr/ports/devel/ocaml-findlib/work/stage/usr/local/bin/ocamlfind  /wrkdirs/usr/ports/devel/ocaml-findlib/work/stage/usr/local/lib/ocaml/site-lib/findlib/make_wizard
chmod: /wrkdirs/usr/ports/devel/ocaml-findlib/work/stage/usr/local/lib/ocaml/site-lib/findlib/make_wizard: No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/ocaml-findlib

Not sure what is the cause here.

Also, the patch needs rebasing, it fails to apply cleanly on the latest ports tree (due to the changes in graphics/ocaml-images/Makefile)

This revision now requires changes to proceed.Feb 28 2024, 8:37 PM

ocaml-findlib fix, rebased&squashed.

arrowd added inline comments.
Mk/Uses/dune.mk
26 ↗(On Diff #135249)

Sorry, what's the point in the additional USE_OCAML knob? Maybe bsd.ocaml.mk contents should be moved into this new USES?

  • Mk/Uses/dune.mk: clean build environment
  • respect MAKE_ENV
  • USES=dune -> USES=ocaml:dune
  • devel/ocaml-dune: fix PORTREVISION increment
  • security/ocaml-ssl: PORTREVISION bump.
  • textproc/ocaml-text: PORTREVISION bump.
madpilot requested changes to this revision.Mar 2 2024, 7:56 AM

Hi,

Great work, really!

I did another round of testing with the latest patch and got two new failures:

in devel/ocaml-logs there are some simple plist issues, some files are missing in the plist:

====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: share/doc/ocaml/logs/CHANGES.md
Error: Orphaned: share/doc/ocaml/logs/LICENSE.md
Error: Orphaned: share/doc/ocaml/logs/README.md
Error: Orphaned: share/doc/ocaml/logs/tags.ml
Error: Orphaned: share/doc/ocaml/logs/tool.ml
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/ocaml-logs
=>> Error: check-plist failures detected

while games/freetennis is failing with some strange error about a dependency:

===>   freetennis-0.4.8_18 depends on file: /usr/local/lib/ocaml/site-lib/lablgtk2/gtk.ml - found
===>   Returning to build of freetennis-0.4.8_18
===>   freetennis-0.4.8_18 depends on file: /usr/local/lib/ocaml/lablGL/gl.ml - not found
===>   Installing existing package /packages/All/ocaml-lablgl-1.05_6,1.pkg
[poudriere.madpilot.net] Installing ocaml-lablgl-1.05_6,1...
the most recent version of ocaml-lablgl-1.05_6,1 is already installed
===>   freetennis-0.4.8_18 depends on file: /usr/local/lib/ocaml/lablGL/gl.ml - not found
*** Error code 1

I suspect after the update the file /usr/local/lib/ocaml/lablGL/gl.ml is not being installed anymore, maybe it has been renamed, so poudriere cannot figure out if the package is already installed. The dependency line should be fixed.

BTW the OCAML_DEPENDS variable is only being referenced by BUILD_DEPENDS and AFAIK, it has no other function or purpose, so I think the contents should be directly merged in BUILD_DEPENDS.

This revision now requires changes to proceed.Mar 2 2024, 7:56 AM
  • Uses/ocaml.mk: Typo.
  • devel/ocaml-sdl: bad --with-lablgldir.
  • games/freetennis: LablGL moved to site-lib, tidy Makefile.
  • devel/ocaml-logs: PORTDOCS adoption (un-orphaning).

Squashed, commit message preparation.

Thank you again for the reviews. There had been a bit of fallover from the moving of labltk and lablGL to site-lib/, I should have catched them before...
All plist issues should be gone too, as I've learned to use -t with poudriere-bulk ;)

Also Mk/Uses/dune.ml was renamed to Mk/Uses/ocaml.ml, only USES= ocaml:dune is supported now and it still requires to USE_OCAML=yes for bsd.ocaml.mk get pulled in. My ultimate goal is to remove bsd.ocaml.mk, but that's better left for another revision as this ocaml 4.14 update is getting quite massive by now.

I've squashed the changes to prepare for the final commit message: only missing the Approved by: and Exp-run by : tags now.

Mk/Uses/dune.mk
26 ↗(On Diff #135249)

USES=dune needs USE_OCAML because bsd.ocaml.mk sets up variables such as OCAML_SITELIBDIR and sets up hooks for setting up $OCAML_LIBDIR/ld.conf.

I agree that bsd.ocaml.ml should be moved into this new USES (and probably renamed USES=ocaml then), however this will require a fairly larger amount of change. Because the majority of ocaml ports aren't using the new dune build tool, and also for the fact that bsd.ocaml.mk is processed much earlier than USES hooks are (so that it wouldn't be a straightforward code transposition), I'd much prefere to leave that change for a subsequent restructuration.

Can we rename it to USES=ocaml:dune now and keep the status-quo of having to use both USE_OCAML=yes and USES=ocaml:dune? Then I can take care of bsd.ocaml.mk in a later, distinct, review?

sysutils/ledit/Makefile
1–2

There was indeed an issue caused by USE_OCAML_FINDLIB=yes adding the site-lib into the plist, but none of that was necessary as ledit doesn't even provide a caml library to begin with. Also apparently the bytecode executable was installed, and that gets broken by STRIP-ing it. Fixed by installing the native binary.

x11-toolkits/ocaml-labltk/Makefile
1

Plist fixed and the library got moved into site-lib/labltk. Related to that, I fixed ocaml-findlib to stop shipping site-lib/labltk/META as it makes no sense (that may have been overlooked when x11-toolkits/ocaml-labltk got created or when it started to ship a META), and likewise for site-lib/graphics/META (which I also overlooked when adding x11-toolkits/ocaml-graphics :P ).

Hi,

I'm running with this patch successfully. I also noticed the exp-run at [1] was fine, so I would approve this, patch.

I plan to commit the change once all the pending bug reports are approved or timed out.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277026

This revision is now accepted and ready to land.Mar 6 2024, 3:38 PM
  • devel/ocaml-logs: Missing RUN_DEPENDS.
  • x11-toolkits/ocaml-graphics: Extraneous BUILD_DEPENDS.
  • devel/ocaml-fpath: Missing RUN_DEPENDS.
  • devel/ocaml-fmt: Missing RUN_DEPENDS.
  • devel/ocaml-camomile: Missing RUN_DEPENDS.
  • devel/ocaml-camlp-streams: Package version set.
  • devel/ocaml-csexp: Package version set.
  • devel/ocaml-pcre2: Package version set.
  • devel/ocaml-re: Package version set.
  • x11-toolkits/ocaml-graphics: Package version set.
  • Set WRK_ENV.
This revision now requires review to proceed.Mar 10 2024, 12:10 PM
freebsd_dev.thsi.be edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Mar 11 2024, 8:27 PM
This revision was automatically updated to reflect the committed changes.