Skip to content

feat(pkg): use the relocatable compiler#14357

Draft
Alizter wants to merge 2 commits intoocaml:mainfrom
Alizter:push-vkkkwyxwsotw
Draft

feat(pkg): use the relocatable compiler#14357
Alizter wants to merge 2 commits intoocaml:mainfrom
Alizter:push-vkkkwyxwsotw

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented Apr 27, 2026

This PR enables the relocatable compiler by making it the default. It does so by using David's relocatable opam-repository as a second set of overlays.

The order is now overlay, relocatable, upstream.

This is part of the work on:

The following need to be done:

  • changelog
  • documentation
  • testing with:

In order to test, clone your favourite OCaml project. Run dune build --pkg enabled and wait. Then when it's finished delete _build/ and run again. If all goes well (and your cache is actually enabled) it should restore from cache.

Any issues please report here together with your first and second trace files. _build/trace.csexp and _build/trace.csexp.old.

@Alizter Alizter mentioned this pull request Apr 27, 2026
15 tasks
@Alizter Alizter force-pushed the push-vkkkwyxwsotw branch from a2b87f1 to dba99db Compare April 27, 2026 15:35
Alizter added 2 commits April 28, 2026 11:54
Signed-off-by: Ali Caglayan <alizter@gmail.com>
The relocatable-compiler package installs libraries (including threads,
str, unix) under target/lib/ocaml/, matching the layout of other compiler
packages. Without being listed in compiler_package_names, install_roots
did not append the /ocaml subdirectory to its lib_root, causing dev-tools
like utop to fail with "Library threads not found".

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Leonidas-from-XIV
Copy link
Copy Markdown
Collaborator

Can you fill me in with the current state? The way I was explained this many months ago is that OCaml 5.5 is relocatable by default and the relocatable patches will be backported to older compilers in point releases. in such case it would just work out of the box for everyone without need for more overlays.

Is that not the case anymore?

@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Apr 30, 2026

@Leonidas-from-XIV That is the case for OCaml 5.5 which is yet to be released. You can constrain your dependencies to use it. The support provided by David's repository is for older versions to at least 4.14. It takes time for patches to make their way to the compiler branch, and I'm not even certain that it has been agreed yet that this will be the case. For users of dune pkg, we can and should make use of it however.

@Leonidas-from-XIV
Copy link
Copy Markdown
Collaborator

Yes, but my question was about the backports to older compiler releases. Are these not planned anymore?

@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Apr 30, 2026

I don't know. I don't know if it has been discussed with the compiler developers yet and I also don't know if these discussions have happened with opam. My point is that we don't need to know any of this to make use of it in dune.

@Leonidas-from-XIV
Copy link
Copy Markdown
Collaborator

@dra27 could you provide us with some insight on what the plan is for the backporting (or lack thereof) for older compilers?

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.

Always use the relocatable compiler over the older OCaml ones.

2 participants