And here is a more detailed report of what fails. Like always its a ppx dependency. Can you really not living without those?
In my personal opinion, the continuous troubles with PPX dependencies at least in its current form, stops Ocaml from getting the usage it deserves.
but here are all infos and steps involved, beginning with my env:
gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ocaml setup:
cd ~
rm -rf .opam
opam --version
2.1.4
opam init
eval (opam init)
ocamlc --version
5.0.0
according to the readme:
git clone https://github.com/jchavarri/jsoo-react-realworld-example-app.git
cd jsoo-react-realworld-example-app
yarn install # install JavaScript dependencies
make create-switch # create Opam local switch
eval (opam init)
ocamlc -version
4.13.1
make init # install OCaml dependencies
# this is opam install . --deps-only --with-test
# see error message below
error message from make init
which translates to opam install . --deps-only --with-test
[ERROR] The compilation of ppx_jsobject_conv.dev failed at "dune build -p ppx_jsobject_conv -j 15".
∗ installed js_of_ocaml-ppx.3.10.0
∗ installed jsoo-react.dev
∗ installed promise_jsoo.0.3.1
#=== ERROR while compiling ppx_jsobject_conv.dev ==============================#
# context 2.1.4 | macos/x86_64 | ocaml-base-compiler.4.13.1 | pinned(git+https://github.com/little-arhat/ppx_jsobject_conv.git#b1c43be#b1c43be2)
# path jsoo-react-realworld-example-app/_opam/.opam-switch/build/ppx_jsobject_conv.dev
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_jsobject_conv -j 15
# exit-code 1
# env-file ~/.opam/log/ppx_jsobject_conv-88423-af26c1.env
# output-file ~/.opam/log/ppx_jsobject_conv-88423-af26c1.out
### output ###
# ocamlc src/.ppx_jsobject_conv.objs/byte/ppx_jsobject_conv.{cmi,cmo,cmt} (exit 2)
# (cd _build/default && jsoo-react-realworld-example-app/_opam/bin/ocamlc.opt -w -40 -safe-string -g -bin-annot -I src/.ppx_jsobject_conv.objs/byte -I /ocaml-joo-s[...]
# File "src/ppx_jsobject_conv.ml", line 573, characters 12-39:
# 573 | | Pext_decl (cons_args, ctyp) ->
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: The constructor Pext_decl expects 3 argument(s),
# but is applied here to 2 argument(s)
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build ppx_jsobject_conv dev
So it seems like a problem with this version:
opam search ppx_jsobject_conv
# Packages matching: match(*ppx_jsobject_conv*)
# Name # Installed # Synopsis
ppx_jsobject_conv -- pinned to version dev at git+https://github.com/little-arhat/ppx_jsobject_conv.git#b1c43be
Because with with the latest ocaml version it works
ocamlc -version
5.0.0
opam install ppx_jsobject_conv
So like always I tried to solve it by fiddling with dune-project
and jsoo-react-realworld-example.opam
which I find extremely annoying. Sorry.