Skip to content

Update to ocaml 5#24

Draft
balat wants to merge 9 commits into
masterfrom
update-to-ocaml-5
Draft

Update to ocaml 5#24
balat wants to merge 9 commits into
masterfrom
update-to-ocaml-5

Conversation

@balat
Copy link
Copy Markdown
Member

@balat balat commented May 1, 2026

No description provided.

balat added 9 commits May 1, 2026 17:12
odoc_import.ml:
- Printtyp.shared_type_scheme replaces mark_loops/type_scheme_max
- Printtyp.modtype now returns Format_doc.format_printer
  (compatible with Format.formatter)
- Use Types.get_desc instead of .desc field access
- Tsubst now takes 2 arguments
- Drop Tlink/Tsubst pattern matching (get_desc resolves links)

odoc_wiki.ml:
- Odoc_html.text class merged into Generator.html in OCaml 5.x:
  re-declare virtuals + html_of_text/html_of_text_element/
  label_of_text/create_title_label locally instead of inheriting
- html_of_info gains ?cls
- html_of_info_first_sentence requires ~with_p (was optional)
- output_code gains ?with_pre
- Rename methods with incompatible ~init_len/~indent parameters
  to wiki_* prefix to avoid conflicts with inherited signatures
- Local print_concat (removed from Odoc_html)
- Module_apply_unit kind
- Odoc_info.Target constructor: record -> tuple
- Annotate list_extensions for type inference
Track changes per-release in CHANGES, starting with the OCaml 5.x
compiler-libs port from the previous commit.
OCamlduce has been disabled by default (OCAMLDUCE=NO) for years and
the upstream tooling is no longer maintained on modern OCaml. Drop
the OCAMLDUCE conditionals, the odoc_duce_* targets generated by
sed-rewriting odoc_wiki.ml, and the long-commented-out OCSIGEN 1.2
and 1.3 wikidoc-publishing targets.

Side effect: the install rule no longer installs the same files
twice (ODOC_DUCE_WIKI fell back to ODOC_WIKI when Duce was off).
The META file shipped with previous releases contained only a single
space, leaving `ocamlfind query wikidoc` blank and forcing users of
the generator to invoke ocamldoc with an absolute path to
odoc_wiki.cmxs. Declare description, dependencies (compiler-libs.common,
ocamldoc, str) and archive/plugin entries so the package can be
consumed normally.
The opam file was still in 1.2 format and missing fields required by
opam-repository (synopsis, description, license).

- Bump opam-version to 2.0.
- Add synopsis, description, license (GPL-2.0-or-later AND QPL-1.0,
  reflecting the mixed licensing of latex_of_wiki vs odoc_wiki).
- Drop unused dependencies: base-threads (no Thread usage) and
  base-unix (Unix is pulled transitively by lwt.unix).
- Replace `available: [ocaml-version >= "4.03.0"]` with
  `"ocaml" {>= "5.0"}` in depends — the OCaml 5.x compiler-libs port
  uses APIs (Module_apply_unit, Types.get_desc) not present before 5.x.
Document the dual licensing of the project explicitly:
- latex_of_wiki is under GPL-2-or-later (Vincent Balat, 2010);
- odoc_wiki is under QPL-1.0 (derived from the ocamldoc standard
  generators distributed by INRIA).

The top-level LICENSE file states the per-file split; LICENSE.GPL-2
and LICENSE.QPL-1.0 ship the full canonical texts.
Build matrix: ubuntu-latest + macos-latest x OCaml 5.0 / 5.4. Plus an
opam lint job. Modelled after the workflow shipped by html_of_wiki.

Windows is intentionally excluded: the build relies on POSIX make and
the pcre/lwt dependencies are not exercised on the win32 runner here.
Origin/master already shipped .github/workflows/build.yml (OCaml 4.12,
no matrix, no lint job). The previous CI commit added a parallel
workflow.yml; merge them: keep the build.yml filename, take the
broader content (OCaml 5.0 + 5.4 matrix, lint-opam job, weekly cron).

The 4.12 entry would have failed anyway: the depends in wikidoc.opam
now require ocaml >= 5.0.
@balat balat force-pushed the update-to-ocaml-5 branch from bd1d980 to 61d3c14 Compare May 1, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant