ocaml / ocamlbuild

The legacy OCamlbuild build manager
Other
122 stars 82 forks source link

Remove the light mode #332

Closed hhugo closed 5 months ago

hhugo commented 5 months ago

The light mode is not installed anyway. The change simplify the code, remove the "duplicated" implementation of "implem" and remove the degraded mode.

In practice, the content of ocamlbuild_unix_plugin.ml was moved inside my_unix.ml.

kit-ty-kate commented 5 months ago

Previously the interface for Ocamlbuild_executor and Ocamlbuild_unix_plugin would have been installed. Were they used or accessible from anywhere?

Here is the diff in the installed files:

--- /tmp/before 2024-05-29 13:01:07.088805668 +0100
+++ /tmp/after  2024-05-29 13:01:13.373818218 +0100
@@ -1,9 +1,6 @@
 META
 ocamlbuild.cmo
 ocamlbuild.cmx
-ocamlbuild_executor.cmi
-ocamlbuild_executor.cmx
-ocamlbuild_executor.o
 ocamlbuildlib.a
 ocamlbuildlib.cma
 ocamlbuildlib.cmxa
@@ -13,9 +10,6 @@
 ocamlbuild_plugin.cmi
 ocamlbuild_plugin.cmx
 ocamlbuild_plugin.o
-ocamlbuild_unix_plugin.cmi
-ocamlbuild_unix_plugin.cmx
-ocamlbuild_unix_plugin.o
 opam
 signatures.cmi
 signatures.cmti
gasche commented 5 months ago

The light mode can go away. I think it was meant to make it possible to build the compiler distribution with ocamlbuild (the original goal) and work well in semi-bootstrapped, Unix-less environments. I don't think that any user of ocamlbuild needs this anymore.

On the other hand, the use of the plugin to build your own ocamlbuild "shim" is something that some people might be doing still, I am not sure. (Maybe it is possible to analyze opam to find out. I remember an impressive ocamlbuild plugin for building C projects, was/is it using this mechanism?) So preserving the list of available modules in the plugin, as @kit-ty-kate, sounds like a safer approach.

kit-ty-kate commented 5 months ago

Also removing Ocamlbuild_unix_plugin seems to be a breaking change for a number of packages:

hhugo commented 5 months ago

Previously the interface for Ocamlbuild_executor and Ocamlbuild_unix_plugin would have been installed. Were they used or accessible from anywhere?

Here is the diff in the installed files:

--- /tmp/before   2024-05-29 13:01:07.088805668 +0100
+++ /tmp/after    2024-05-29 13:01:13.373818218 +0100
@@ -1,9 +1,6 @@
 META
 ocamlbuild.cmo
 ocamlbuild.cmx
-ocamlbuild_executor.cmi
-ocamlbuild_executor.cmx
-ocamlbuild_executor.o
 ocamlbuildlib.a
 ocamlbuildlib.cma
 ocamlbuildlib.cmxa
@@ -13,9 +10,6 @@
 ocamlbuild_plugin.cmi
 ocamlbuild_plugin.cmx
 ocamlbuild_plugin.o
-ocamlbuild_unix_plugin.cmi
-ocamlbuild_unix_plugin.cmx
-ocamlbuild_unix_plugin.o
 opam
 signatures.cmi
 signatures.cmti
hhugo commented 5 months ago

I've restored the ocamlbuild_unix_plugin module ! Do we really need to restore the ocamlbuild_executor one ?

gasche commented 5 months ago

My impression is that it is probably safe to assume that no one explicitly relies on accessing Ocamlbuild_executor directly as a plugin module. (It would be nice to have a pool of ocamlbuild-using projects to test this on, but I am too lazy to consider doing something like that. We will get opam-repository testing on the next release, but by then it will be a bit late.) I am in favor of moving to merge this, if @kit-ty-kate also agrees.

kit-ty-kate commented 5 months ago

I used both https://sherlocode.com/ and opam grep and only found:

bsbnative matches your regexp.
ocamlbuild matches your regexp.
rmlbuild matches your regexp.

all of which are forks of ocamlbuild, so i think this is safe to remove Ocamlbuild_executor

gasche commented 5 months ago

Thanks! Merged.