Skip to content

Conversation

@shym
Copy link
Contributor

@shym shym commented Oct 14, 2025

This PR adds support for OCaml 5.4.0.

The patches for the compiler are in plain text, so as to be compatible with whatever choice we go with, regarding our patch tool (cf #151, #154). Anyway, we are down to 3 patches, 2 of which will be in 5.5.

The third patch is there to set the limit to 1 domain (in particular to avoid allocating memory for 128 domains). I think a patch might still be the best way to change that behaviour of the compiler in the versions to come (the commit message of that patch explains an alternative, exploiting OCAMLRUNPARAM’s d parameter, but that would require some kind of sscanf in nolibc).

Small note: the example outputting Sys.unix now properly returns false, as it should, with OCaml 5.4.0 (as part of the cross-compilation patches in OCaml 5.4.0).

@hannesm
Copy link
Member

hannesm commented Oct 15, 2025

Should we really keep 5.3.0 support when 5.4.0 is available? If yes, why? I read that there are very good changes in 5.4.

@hannesm
Copy link
Member

hannesm commented Oct 15, 2025

also, Mirage CI: can we get a 5.4 builder?

@dinosaure
Copy link
Member

Small note: the example outputting Sys.unix now properly returns false, as it should, with OCaml 5.4.0 (as part of the cross-compilation patches in OCaml 5.4.0).

I hope that ocaml-solo5 still produces the same *.cmi (and its signatures) than the OCaml compiler. I will do some tests about that (and probably complete the GitHub action also).

@shym
Copy link
Contributor Author

shym commented Oct 15, 2025

Should we really keep 5.3.0 support when 5.4.0 is available? If yes, why?

It’s more that I didn’t see any compelling reasons to break support for 5.3.0 (and not everything might be compatible with 5.4.0 yet). It could make it easier to run benchmarks with the two compilers, if that’s useful. Even if I know many more GC improvements are only in the pipeline and not yet in 5.4.

I read that there are very good changes in 5.4.

Indeed.

@shym
Copy link
Contributor Author

shym commented Oct 15, 2025

I hope that ocaml-solo5 still produces the same *.cmi (and its signatures) than the OCaml compiler. I will do some tests about that

The patches left now really only enable freestanding targets, so I don’t expect they could have any impact there. So if there are differences, we’ll have a better chance of tracking their origin (some compiler configure-time options come to mind).

@Firobe
Copy link
Member

Firobe commented Oct 15, 2025

also, Mirage CI: can we get a 5.4 builder?

Should be the case as soon as ocurrent/mirage-ci#53 is merged

@Firobe
Copy link
Member

Firobe commented Nov 15, 2025

Hi, is there further work needed to merge 5.4 support?

@shym
Copy link
Contributor Author

shym commented Nov 17, 2025

Hi, is there further work needed to merge 5.4 support?

Not that I think of, on my end at least. (Maybe it would be good to schedule a new run after a merge of #154, just to be sure, if #154 is to be integrated before a new release?)

@dinosaure
Copy link
Member

I can confirm that stdlib.cmi is the same as the host compiler, for me, it's good to merge.

@shym
Copy link
Contributor Author

shym commented Nov 20, 2025

I just applied Hannes’ suggestions on the version constraints and rebased.

@shym
Copy link
Contributor Author

shym commented Nov 25, 2025

@dinosaure: we should really use git push --force-with-lease, if a force is really needed, when working concurrently on a branch: you overwrote the cleanups and fixes I had made.

Test the possibility to use an opam-installed global dependency in a
unikernel (without rebuilding it with the OCaml/Solo5 cross compiler)
Also add the run of that test with `solo5-hvt`

Co-authored-by: Samuel Hym <[email protected]>
@shym
Copy link
Contributor Author

shym commented Nov 25, 2025

I’ve merged the conflicting changes, this is now ready, I think.

Copy link
Member

@dinosaure dinosaure left a comment

Choose a reason for hiding this comment

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

Seesm perfect for me.

@hannesm
Copy link
Member

hannesm commented Nov 25, 2025

Great. I'll take the opportunity to merge and cut a release. Thanks to everybody involved.

@hannesm hannesm merged commit 53b0059 into mirage:main Nov 25, 2025
4 checks passed
hannesm added a commit to hannesm/opam-repository that referenced this pull request Nov 25, 2025
* Support OCaml 5.4.0 (@shym mirage/ocaml-solo5#155)
* Add test of (host) ocaml-installed fmt in one example (@dinosaure mirage/ocaml-solo5#155)
* Use plain text diffs, use opatch instead of git apply (@shym @dinosaure @hannesm mirage/ocaml-solo5#154)
* Cleanup opam package dependencies (@shym mirage/ocaml-solo5#156)
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.

4 participants