···248248https://editorconfig.org/#download[plugins].
249249250250[#opam-switch]
251251-=== Testing with `opam`
251251+=== Testing with opam
252252253253If you are working on a development version of the compiler, you can create an
254254opam switch from it by running the following from the development repository:
···267267opam pin add ocaml-variants git+https://$REPO#branch
268268----
269269270270-==== Incremental builds with `opam`
270270+==== Incremental builds with opam
271271272272This section documents some tips to speed up your workflow when you need to
273273alternate between testing your branch and patching the compiler.
···276276===== Initial setup
277277278278For the rest of the section to work, you'll need your compiler to be
279279-configured in the same way as `opam` would have configured it. The simplest
279279+configured in the same way as opam would have configured it. The simplest
280280way is to run the normal commands for the switch initialization, with the extra
281281`--inplace-build` flag:
282282···287287288288However, if you need specific configuration options, you can also configure it
289289manually, as long as you make sure that the configuration prefix is the one
290290-where `opam` would install the compiler.
290290+where opam would install the compiler.
291291You will then need to install the compiler, either from the working directory
292292(that you must build yourself) or using the regular sandboxed builds.
293293···309309===== Basic workflow
310310311311We will assume that the workflow alternates between work on the compiler and
312312-external (`opam`-related) commands.
312312+external (opam-related) commands.
313313As an example, debugging an issue in the compiler can be done by a first step
314314-that triggers the issue (by installing a given `opam` package), then adding
314314+that triggers the issue (by installing a given opam package), then adding
315315some logging to the compiler, re-trigger the issue, and based on the logs either
316316add more logging, or try a patch, and so on.
317317···328328329329In our case, we need to build the compiler, and when we've built everything
330330that we need then we run `opam custom-install ocaml-variants -- make install`.
331331-This will make `opam` remove the previously installed version of the compiler
331331+This will make opam remove the previously installed version of the compiler
332332(if any), then install the new one in its stead.
333333334334-----
···336336opam custom-install ocaml-variants -- make install
337337-----
338338339339-Since most `opam` packages depend on the compiler, this will trigger a
339339+Since most opam packages depend on the compiler, this will trigger a
340340reinstallation of all the packages in the switch.
341341If you want to avoid that (for instance, your patch only adds some logging
342342so you expect the core libraries and all the already compiled packages to be
···352352353353Note about the first installation:
354354When you start from an empty switch, and install a compiler (in our case,
355355-the `ocaml-variants` package provided by the compiler's `opam` file), then
355355+the `ocaml-variants` package provided by the compiler's opam file), then
356356a number of additional packages are installed to ensure that the switch
357357will work correctly. Mainly, the `ocaml` package needs to be installed,
358358-and while it's done automatically when using regular `opam` commands, the
358358+and while it's done automatically when using regular opam commands, the
359359`custom-install` plugin will not force installation of dependencies.
360360Moreover, if you try to fix the problem by manually installing the `ocaml`
361361-package, `opam` will try to recompile `ocaml-variants`, using the default
361361+package, opam will try to recompile `ocaml-variants`, using the default
362362instructions. You can get around this by running
363363`opam reinstall --forget-pending` just after the `opam custom-install` command
364364and just before the `opam install ocaml command`.
···381381bytecode tools are installed, whereas with a raw `make install` you will have
382382stale native binaries remaining in your switch.
383383Since it's significantly faster to build the bytecode version of the tools,
384384-and many `opam` packages will pick the native version of the compilers if
384384+and many opam packages will pick the native version of the compilers if
385385present and the bytecode version otherwise, you can build your initial switch
386386with the native versions (to get quickly to a state where a bug appears),
387387then clean your working directory and start building bytecode tools only
···389389390390===== Without `opam-custom-install`
391391392392-You can achieve some improvements using built-in `opam` commands.
392392+You can achieve some improvements using built-in opam commands.
393393394394Using `opam install . --assume-built` will simply remove the
395395package for the compiler, then run the installation instructions
···400400401401You can also run `make install` manually, which will not trigger a
402402recompilation, but will not remove the previous version either and can
403403-mess with `opam`'s tracking of installed files.
403403+mess with opam's tracking of installed files.
404404405405=== Useful Makefile targets and options
406406
+1-1
INSTALL.adoc
···205205generates code for a different machine, named the _target_. To build a cross
206206compiler you first need to have a non-cross compiler of the same version
207207installed in your `$PATH`. You can install that standard non-cross compiler by
208208-any means, for instance using `opam` or compiling it manually from source. Note
208208+any means, for instance using opam or compiling it manually from source. Note
209209though that the version of the non-cross compiler must match the version of the
210210cross compiler since the cross compiler will be compiled by the non-cross
211211compiler: the cross compiler will combine code compiled from source with the
+2-2
README.adoc
···152152== Separately maintained components
153153154154Some libraries and tools which used to be part of the OCaml distribution are
155155-now maintained separately and distributed as OPAM packages.
155155+now maintained separately and distributed as opam packages.
156156Please use the issue trackers at their respective new homes:
157157158158|====
159159-| Library | Removed since | OPAM package
159159+| Library | Removed since | opam package
160160161161| https://github.com/ocaml/camlp-streams/issues[The Stream and Genlex standard library modules] | OCaml 5.0 | `camlp-streams`
162162| https://github.com/ocaml/graphics/issues[The Graphics library] | OCaml 4.09 | `graphics`