How to recreate "ocaml-variants.4.07.1+32bit+default-unsafe-string" locally?

Hi,

I would like to manually compile OCaml 4.07.1 32bit with ‘default-unsafe-string’ and also a custom patch.

I want to repeat exactly the same compilation steps as opam does when it creates the locally compiled OCaml version.

I have tried to do it and I had partial success

  • the Ocaml compilation works
  • compilation of simple ocaml-based win exe works.

But as soon as I try to compile the project itself, using this self-compiled Ocaml version, it complains that it can’t load the module:

Cannot load required shared library dllcamlstr.
Reason: C:/ocamlmgw/lib/stublibs\dllcamlstr.dll: Cannot find required module.

Ofc all required files are in place.

The same Cygwin setup with opam as the provider for OCaml is able to compile the project just fine. So my assumption is that I’m doing something wrong during OCaml compilation process.

Can you please direct me on how I could recreate the OCaml compilation process used by opam in my local Cygwin environment?

I don’t remember the precise incantation, but there’s a way to get OPAM to preserve the build log-files, and then you can look at them; they show you precisely what opam does – what commands it executes, etc. So you can do the same thing.

An alternative will be to look at the build command used in the opam file and replicate this step. You can also copy the opam file and add your patch to the list of patches and extra-files.

@octachron That looks great but can you please be more specific? Which opam file? Where I should put my extra .patch file?