GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Upstream OxCaml by art-w · Pull Request #1399 · ocaml/odoc

Conversation

@art-w

@art-w art-w commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

(builds on top of #1398 which provides ocaml-config:ox to detect OxCaml)

This PR is a rebase of @lukemaurer 's patches from oxcaml/odoc (+ small fixes from #22). I hope this will make it easier to keep everything uptodate, and that it isn't too much of a stretch as Odoc already supports multiple versions of the OCaml AST using cppo. (Note that the preprocessor was originally using OCAML_VERSION=(5,2,0) as a heuristic to check for OxCaml, but since dune 3.21 we can be exact.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
art-w
art-w commented Jan 28, 2026
View reviewed changes
Comment thread src/model/dune
(chdir
%{workspace_root}
(run %{bin:cppo} -V OCAML:%{ocaml_version} -D "OXCAML" %{x} -o %{targets}))))

@art-w art-w Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The rules duplication, here and in src/loader/dune, are rather inconvenient but I didn't find how to avoid it: cppo only accepts variables with integer values in conditionals, but dune %{ocaml-config:ox} is a boolean with no way to cast it to an int (?). I tried cppo -D "OXCAML %{ocaml-config:ox} but then the variable can't be used in #if. Please let me know if you know a better way!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@art-w
art-w force-pushed the upstream-oxcaml branch from 80bf1f1 to bb20ded Compare January 28, 2026 13:01
@art-w
art-w marked this pull request as draft January 28, 2026 14:55
@art-w
art-w force-pushed the upstream-oxcaml branch 2 times, most recently from f36c8b9 to cd3629c Compare February 18, 2026 11:37
jonnyfiveisonline pushed a commit to jonnyfiveisonline/odoc that referenced this pull request Feb 18, 2026
Jon Ludlam's Agent @claude
feat: add OxCaml dual-compiler support for js_top_worker and odoc
f195506
Add support for building js_top_worker and odoc with both the standard
OCaml 5.4 compiler and the OxCaml 5.2.0+ox compiler using cppo
conditional compilation and dual dune stanzas.

js_top_worker changes:
- Bump dune-project to 3.21 for %{ocaml-config:ox} support
- Add dual library stanzas gated by (enabled_if %{ocaml-config:ox})
- Add cppo guards for OxCaml API differences:
  - Compilation_unit.Name.t vs string for persistent loader
  - Env.report_error ~level:0 (extra parameter)
  - Language_extension.set_universe_and_enable_all (oxcaml-only)
  - Unit_info.make ~for_pack_prefix (extra parameter)
  - Typemod.type_implementation (extra Compilation_unit arg)
- Gate ppx_deriving_rpc with (not %{ocaml-config:ox})

odoc changes:
- Apply upstream oxcaml PR ocaml#1399 (art-w/upstream-oxcaml)
- Bump dune-project to 3.21
- Add dual stanzas in loader, model, xref2, odoc, syntax_highlighter
- Add cppo OXCAML guards for compiler API differences
- Support OxCaml features: modes, layouts, labeled tuples, iarray,
  unboxed records, module type strengthening, polymorphic arguments,
  call position arguments, Import_info.t, Compilation_unit.t

Verified end-to-end: scrollycode demos generate HTML and the
interactive playground evaluates OCaml code in the browser with
both compiler switches.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@art-w
art-w force-pushed the upstream-oxcaml branch from 8fa44a8 to 745c7eb Compare March 17, 2026 09:17
art-w and others added 12 commits March 17, 2026 10:18
@art-w
Simplify dune rules for ident_env cppo
6b24f9c
@art-w
Preprocess for OxCaml
cada72e
@lukemaurer @art-w
Quick fix for include functor (ocaml#1)
86e29f8
@lukemaurer @art-w
Support OxCaml Compilation_unit.t type (ocaml#2)
551e438
@lukemaurer @art-w
Support OxCaml Import_info.t type (ocaml#3)
fe9aca0
@lukemaurer @art-w
Adapt to OxCaml renaming Ident.persistent (ocaml#5)
555f01f
@lukemaurer @art-w
Support OxCaml modes in loader (ocaml#6)
f9b28af
@lukemaurer @art-w
Support OxCaml layouts in loader (ocaml#7)
4b57b26
@lukemaurer @art-w
Support OxCaml module type strengthening operator (ocaml#8)
5e8e2d0
@lukemaurer @art-w
Support OxCaml iarray syntax in loader (ocaml#9)
500de34
@lukemaurer @art-w
Support OxCaml labeled tuples (ocaml#10)
cebbb87
@lukemaurer @art-w
Support OxCaml call position arguments (ocaml#11)
e769c22
@art-w
art-w force-pushed the upstream-oxcaml branch 3 times, most recently from 06b3c16 to a3a6c22 Compare March 17, 2026 10:40
@art-w
art-w marked this pull request as ready for review March 19, 2026 07:59
art-w
art-w commented Mar 19, 2026
View reviewed changes
Comment thread .github/workflows/oxcaml.yml

- name: Install dependencies
run: |
sed -i '/bisect_ppx/d' odoc.opam

@art-w art-w Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

bisect_ppx is currently incompatible with OxCaml, bringing the coverage down

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@art-w

art-w commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

@jonludlam If you have time, I think this PR is in good shape for a review!

This is only the first step to integrate oxcaml/odoc in this repo, so currently I've left out a small patch "Support OxCaml polymorphic arguments (#4)" from @lukemaurer as it was breaking the OCaml 4.08 regression tests. The polymorphic arguments require a bit more work and testing so I'll open another PR for them.

The other useful patches from @lukemaurer in oxcaml/odoc are not directly related to OxCaml support, so I've left them out to ease the review as we can cherry-pick them later:

  • 7770657 - CSS fix for layout when there is no global ToC (#12) has "FIXME: This will probably get a better fix upstream"
  • 8213d44 - Add source locations to more places (#14) uses an alternative source_loc_jane to point at file locations
  • 4b8f988 - Print source information in implementations (#13) is also useful but not OxCaml specific
  • 328ae6f - Support compiling against 'result' library (#19) conflicts with 8478ff4 Remove dependency on the 'result' package by @Julow
  • 0e57a5b - Update integration test (#21) is a fix of a test output, not required for this PR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@art-w art-w mentioned this pull request Mar 20, 2026
OxCaml: Fix missing parens for polymorphic parameters #1404
Merged
jonludlam
jonludlam reviewed Apr 8, 2026
View reviewed changes
Comment thread src/xref2/ref_tools.ml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jonludlam

jonludlam commented Apr 8, 2026

Copy link
Copy Markdown
Member

Other than that minor concern about the 'find_ambiguous' thing, this looks good to me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lukemaurer added 2 commits April 10, 2026 17:44
@lukemaurer @art-w
Support OxCaml unboxed records (ocaml#15)
5407afe
@lukemaurer @art-w
Remember the build directory from a .cmt or .cmti (ocaml#16)
6460589
lukemaurer and others added 8 commits April 10, 2026 17:44
@lukemaurer @art-w
Support OxCaml syntactic tokens in syntax highlighter (ocaml#20)
56fcf9f
@art-w
Support for splice and quote
f03d87e
@art-w
Add changelog entry
865914b
@lukemaurer @art-w
Adapt to Shape_reduce API change (ocaml#23)
16d47cb
@art-w
Fix is_elidable for module strengthening
a36c8a3
@art-w
Add CI for OxCaml to github workflows
0bfc132
@art-w
Fix CI: no bisect_ppx coverage for OxCaml
45a6404
@art-w
Update ocamlformat-ignore
6ad5936
@art-w
art-w force-pushed the upstream-oxcaml branch from 5f4ad7f to 6ad5936 Compare April 10, 2026 15:44
@art-w

art-w commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've addressed your comment :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonludlam

jonludlam commented Apr 13, 2026

Copy link
Copy Markdown
Member

Great, thanks. In it goes!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonludlam
jonludlam merged commit 380050a into ocaml:master Apr 13, 2026
11 of 12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@shonfeder shonfeder mentioned this pull request Apr 14, 2026
Add support for OxCaml #1411
Open
9 of 10 tasks
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request May 1, 2026
@jonludlam
[new release] odoc (5 packages) (3.2.0)
af658c8
CHANGES:

- Allow persistent latex macros in HTML/KaTeX backend (@dlesbre, ocaml/odoc#1391)
- `markdown-generate` command now accepts multiple `.odocl` files in a single
  invocation, eliminating the need for shell scripting (@davesnx, ocaml/odoc#1387)
- Support for OxCaml (@lukemaurer, @art-w, ocaml/odoc#1399)
- OCaml 5.5.0 support (@panglesd, @xvw, ocaml/odoc#1406)

- Fix compile-time crashing bugs ocaml/odoc#930 and ocaml/odoc#1385 (@jonludlam, ocaml/odoc#1400)
- Markdown backend assumes ocaml as langId on declarations
- Markdown backend collects all code snippets and render a single code block with comments, rather than split the variants/records per constructor/field
- Fix URL remapping for page references (@jonludlam, ocaml/odoc#1395)
- Fix ocaml/odoc#1396, which broke incrememntal builds (@jonludlam, ocaml/odoc#1402)
- Ensure all warnings turn into errors with --warn-error (@jonludlam, ocaml/odoc#1402)
- Fix missing parentheses for polymorphic arguments (@art-w, ocaml/odoc#1404)
@jonludlam jonludlam mentioned this pull request May 1, 2026
[new release] odoc (5 packages) (3.2.0) ocaml/opam-repository#29834
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jonludlam jonludlam jonludlam left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@art-w @jonludlam @lukemaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.