Hi @yawaramin thx for your help
As additional info
Support ReasonML with Nix (without use ESY) require to install these packages from Nixpkgs
- ocaml
- reason
- ocamlPackages.findlib
- ocamlPackages.zarith
After that it’s necessary set the following env variables where envZarith
is the path to the Zarith nix pkg (from /nix/store)
export OCAMLPATH="${envZarith}/lib/ocaml/4.12.0/site-lib/"
export CAML_LD_LIBRARY_PATH="${envZarith}/lib/ocaml/4.12.0/site-lib/stublibs"
to compile with zarith library you need to run like this
ocamlfind ocamlc -package zarith -linkpkg -o test -pp "refmt -p ml" -impl test.re
To support this in a pipeline I use a framework called Makes that simplify a lot the work https://github.com/fluidattacks/makes
To support with ESY hello-world template https://github.com/esy-ocaml/hello-reason
You will find a file in lib/dune
inside you need to add the library Zarith
(library
(name lib)
(flags
(-w -40 -w +26))
(public_name hello-reason)
(libraries pastel.lib zarith))
then in the file package.json you will find a section of dependencies, add zarith
"dependencies": {
"@opam/dune": ">=2.6",
"@reason-native/console": "*",
"@reason-native/pastel": "*",
"@esy-ocaml/reason": ">= 3.6.0 < 4.0.0",
"ocaml": "~4.11.0",
"@opam/zarith": ">=1.12"
},