The logic to create utop from utop-full is as follows:
use ocamlobjinfo on utop-full to determine which modules are used
use ocamlobjinfo on ocamlcommon, ocamlbytecomp, and ocamltoplevel to
determine which modules to exclude (a priori)
compute the set used - (exclude - {Topmain,Toploop,Topdirs})
call expunge with this set of modules
Previously, this was all done in expunge/expunge.ml, meaning core logic
process handling.
What this PR does is offload the process handling to dune: calling
ocamlobjinfo and expunge is done instead in dune rules, and
expunge/modules.ml is just about reading sets of module names and
outputing the result.
Besides simplicity and portability, the other advantage is that the
intermediate modules.txt can be inspected directly.
The logic to create utop from utop-full is as follows:
Previously, this was all done in expunge/expunge.ml, meaning core logic
Besides simplicity and portability, the other advantage is that the intermediate modules.txt can be inspected directly.