I also tried pinning to a version I have used in esy based projects:
β― opam pin add num https://github.com/dune-universe/num.git#bdb2d7653e927e142b701b51d89f393471279713
[num.1.4] synchronised (git+https://github.com/dune-universe/num.git#bdb2d7653e927e142b701b51d89f393471279713)
[WARNING] Failed checks on num package definition from source at
git+https://github.com/dune-universe/num.git#bdb2d7653e927e142b701b51d89f393471279713:
warning 62: License doesn't adhere to the SPDX standard, see https://spdx.org/licenses/: "LGPL 2.1 with OCaml linking exception"
num is now pinned to git+https://github.com/dune-universe/num.git#bdb2d7653e927e142b701b51d89f393471279713 (version 1.4)
The following actions will be performed:
β install num 1.4*
Do you want to continue? [Y/n] y
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> π«
β¬ retrieved num.1.4 (no changes)
[ERROR] The compilation of num.1.4 failed at "dune subst".
#=== ERROR while compiling num.1.4 ============================================#
# context 2.1.0 | macos/x86_64 | ocaml-system.4.12.0 | pinned(git+https://github.com/dune-universe/num.git#bdb2d7653e927e142b701b51d89f393471279713#bdb2d765)
# path ~/Github/CAAS/update-frontend/_opam/.opam-switch/build/num.1.4
# command ~/.opam/opam-init/hooks/sandbox.sh build dune subst
# exit-code 1
# env-file ~/.opam/log/num-56006-d66f1c.env
# output-file ~/.opam/log/num-56006-d66f1c.out
### output ###
# Error: The project name is not defined, please add a (name <name>) field to
# your dune-project file.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> π«
ββ The following actions failed
β Ξ» build num 1.4
ββ
βΆβ No changes have been performed
[NOTE] Pinning command successful, but your installed packages may be out of sync.
~/Github/CAAS/update-frontend update-frontend β 31 9s ξΎ 3.0.1
β― opam install num
<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><> π«
[num.1.4] synchronised (no changes)
The following actions will be performed:
β install num 1.4*
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> π«
β¬ retrieved num.1.4 (no changes)
[ERROR] The compilation of num.1.4 failed at "dune subst".
#=== ERROR while compiling num.1.4 ============================================#
# context 2.1.0 | macos/x86_64 | ocaml-system.4.12.0 | pinned(git+https://github.com/dune-universe/num.git#bdb2d7653e927e142b701b51d89f393471279713#bdb2d765)
# path ~/Github/CAAS/update-frontend/_opam/.opam-switch/build/num.1.4
# command ~/.opam/opam-init/hooks/sandbox.sh build dune subst
# exit-code 1
# env-file ~/.opam/log/num-56473-9c6494.env
# output-file ~/.opam/log/num-56473-9c6494.out
### output ###
# Error: The project name is not defined, please add a (name <name>) field to
# your dune-project file.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> π«
ββ The following actions failed
β Ξ» build num 1.4
ββ
βΆβ No changes have been performed
Can you show the output of opam show num ? Your pinned version shows errors while building with dune, but the official numpackage does not depend on dune, so I suspect youβre not installing the official package.
opam list --depends-on num will list dependencies that depend on num. If you add the --recursive flag it will list all transitive dependencies as opposed to just direct dependencies.
What was the error log of that first installation?
I think I had a similar issue recently where num would failed to install because of the already existing (but empty) _opam/lib/num and _opam/lib/num-top (this was a local switch).
I have no idea why or how I ended up with these, but deleting folders solved the issue.