ocaml-wasm/wasm_of_ocaml

[BUG] stdune fails to compile from https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (Error: This variant pattern is expected to have type 'a Pp.Ast.t # There is no constructor Error within type Pp.Ast.t)

Closed this issue · 3 comments

https://github.com/mit-plv/fiat-crypto/actions/runs/10917744170/job/30305965622?pr=1958

<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] no changes from git+https://github.com/ocaml/opam-repository.git
This will pin the following packages: chrome-trace, dune-action-plugin, dune-build-info, dune-configurator, dune-glob, dune-private-libs, dune-rpc-lwt, dune-rpc, dune-site, dune, dyn, ocamlc-loc, ordering, stdune, xdg. Continue? [y/n] y
chrome-trace is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-action-plugin is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-build-info is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-configurator is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-glob is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-private-libs is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-rpc-lwt is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-rpc is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune-site is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dune is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
dyn is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
ocamlc-loc is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
ordering is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
stdune is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)
xdg is now pinned to git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml (version 3.16.0)

The following actions will be performed:
=== install 22 packages
  ∗ base-bytes         base            [required by ocplib-endian]
  ∗ chrome-trace       3.16.0 (pinned)
  ∗ cppo               1.7.0           [required by lwt]
  ∗ csexp              1.5.2           [required by dune-rpc-lwt, dune-private-libs, dune-action-plugin, etc.]
  ∗ dune               3.16.0 (pinned)
  ∗ dune-action-plugin 3.16.0 (pinned)
  ∗ dune-build-info    3.16.0 (pinned)
  ∗ dune-configurator  3.16.0 (pinned)
  ∗ dune-glob          3.16.0 (pinned)
  ∗ dune-private-libs  3.16.0 (pinned)
  ∗ dune-rpc           3.16.0 (pinned)
  ∗ dune-rpc-lwt       3.16.0 (pinned)
  ∗ dune-site          3.16.0 (pinned)
  ∗ dyn                3.16.0 (pinned)
  ∗ lwt                5.7.0           [required by dune-rpc-lwt]
  ∗ ocamlc-loc         3.16.0 (pinned)
  ∗ ocamlfind          1.9.6           [required by base-bytes]
  ∗ ocplib-endian      1.2             [required by lwt]
  ∗ ordering           3.16.0 (pinned)
  ∗ pp                 2.0.0           [required by dyn, dune-private-libs, dune-rpc, stdune]
  ∗ stdune             3.16.0 (pinned)
  ∗ xdg                3.16.0 (pinned)

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved chrome-trace.3.16.0  (no changes)
⬇ retrieved dune.3.16.0  (no changes)
⬇ retrieved cppo.1.7.0  (https://github.com/ocaml-community/cppo/archive/refs/tags/v1.7.0.tar.gz)
⬇ retrieved csexp.1.5.2  (https://github.com/ocaml-dune/csexp/releases/download/1.5.2/csexp-1.5.2.tbz)
⬇ retrieved dune-build-info.3.16.0  (no changes)
⬇ retrieved dune-action-plugin.3.16.0  (no changes)
⬇ retrieved dune-configurator.3.16.0  (no changes)
⬇ retrieved dune-private-libs.3.16.0  (no changes)
⬇ retrieved dune-glob.3.16.0  (no changes)
⬇ retrieved dune-rpc.3.16.0  (no changes)
⬇ retrieved dune-rpc-lwt.3.16.0  (no changes)
⬇ retrieved dyn.3.16.0  (no changes)
⬇ retrieved ocamlc-loc.3.16.0  (no changes)
⬇ retrieved dune-site.3.16.0  (no changes)
⬇ retrieved lwt.5.7.0  (https://github.com/ocsigen/lwt/archive/refs/tags/5.7.0.tar.gz)
⬇ retrieved ocplib-endian.1.2  (https://github.com/OCamlPro/ocplib-endian/archive/refs/tags/1.2.tar.gz)
⬇ retrieved ordering.3.16.0  (no changes)
⬇ retrieved pp.2.0.0  (https://github.com/ocaml-dune/pp/releases/download/2.0.0/pp-2.0.0.tbz)
⬇ retrieved stdune.3.16.0  (no changes)
⬇ retrieved xdg.3.16.0  (no changes)
⬇ retrieved ocamlfind.1.9.6  (http://download.camlcity.org/download/findlib-1.9.6.tar.gz)
∗ installed ocamlfind.1.9.6
∗ installed base-bytes.base
∗ installed dune.3.16.0
∗ installed csexp.1.5.2
∗ installed cppo.1.7.0
∗ installed chrome-trace.3.16.0
∗ installed dune-build-info.3.16.0
∗ installed ocplib-endian.1.2
∗ installed dune-configurator.3.16.0
∗ installed pp.2.0.0
∗ installed ordering.3.16.0
∗ installed xdg.3.16.0
∗ installed dyn.3.16.0
∗ installed lwt.5.7.0
∗ installed ocamlc-loc.3.16.0
[ERROR] The compilation of stdune.3.16.0 failed at "dune build -p stdune -j 3 @install".

#=== ERROR while compiling stdune.3.16.0 ======================================#
# context     2.2.1 | linux/x86_64 | ocaml-base-compiler.4.14.1 | pinned(git+https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml#5905f8a511dd58d7d82d49d76bee61e694ff0dcb)
# path        ~/work/fiat-crypto/fiat-crypto/_opam/.opam-switch/build/stdune.3.16.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p stdune -j 3 @install
# exit-code   1
# env-file    ~/.opam/log/stdune-12889-4b9e1f.env
# output-file ~/.opam/log/stdune-12889-4b9e1f.out
### output ###
# (cd _build/default && /home/runner/work/fiat-crypto/fiat-crypto/_opam/bin/ocamlc.opt -w -40 -alert -unstable -g -bin-annot -I otherlibs/stdune/src/.stdune.objs/byte -I /home/runner/work/fiat-crypto/fiat-crypto/_opam/lib/csexp -I /home/runner/work/fiat-crypto/fiat-crypto/_opam/lib/dyn -I /home/runner/work/fiat-crypto/fiat-crypto/_opam/lib/ordering -I /home/runner/work/fiat-crypto/fiat-crypto/_opam/lib/pp -I otherlibs/stdune/dune_filesystem_stubs/.dune_filesystem_stubs.objs/byte -no-alias-deps -open Stdune__ -o otherlibs/stdune/src/.stdune.objs/byte/stdune.cmo -c -impl otherlibs/stdune/src/stdune.ml)
# File "otherlibs/stdune/src/stdune.ml", line 39, characters 6-11:
# 39 |     | Error _ -> Dyn.variant "Contains Format" [ Dyn.opaque "<error>" ]
#            ^^^^^
# Error: This variant pattern is expected to have type 'a Pp.Ast.t
#        There is no constructor Error within type Pp.Ast.t



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build stdune 3.16.0
└─ 
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bytes        base
│ ∗ install chrome-trace      3.16.0
│ ∗ install cppo              1.7.0
│ ∗ install csexp             1.5.2
│ ∗ install dune              3.16.0
│ ∗ install dune-build-info   3.16.0
│ ∗ install dune-configurator 3.16.0
│ ∗ install dyn               3.16.0
│ ∗ install lwt               5.7.0
│ ∗ install ocamlc-loc        3.16.0
│ ∗ install ocamlfind         1.9.6
│ ∗ install ocplib-endian     1.2
│ ∗ install ordering          3.16.0
│ ∗ install pp                2.0.0
│ ∗ install xdg               3.16.0
└─ 
[NOTE] Pinning command successful, but your installed packages may be out of sync.

The former state can be restored with:
    /opt/hostedtoolcache/opam/2.2.1/x86_64/opam switch import "/home/runner/work/fiat-crypto/fiat-crypto/_opam/.opam-switch/backup/state-20240918091305.export"

Full logs at
logs_28527681981.zip

I guess this is low-priority, since I can just install dune instead

You need to install pp version 1.2.0. There are some incompatible changes in version 2.0.0.
This dependencies seems to have been fixed in the opam repository but not in the dune's github repository

ocaml/dune#10934 has been fixed so this can be closed once the wasm_of_ocaml branch of dune is updated

I have rebased the PR.