2025-08-11 12:13.23: New job: test ocaml-ppx/ppxlib https://github.com/ocaml-ppx/ppxlib.git#refs/pull/589/head (e516f47c64a6b9890c304f454a70725b8af38173) (openbsd-amd64:openbsd-77-amd64-4.14_opam-2.4)
Base: openbsd-77-amd64-ocaml-4.14
Opam project build
To reproduce locally:
git clone --recursive "https://github.com/ocaml-ppx/ppxlib.git" && cd "ppxlib" && git fetch origin "refs/pull/589/head" && git reset --hard e516f47c
cat > Dockerfile <<'END-OF-DOCKERFILE'
FROM openbsd-77-amd64-ocaml-4.14
# openbsd-77-amd64-4.14_opam-2.4
USER 1000:1000
ENV CLICOLOR_FORCE="1"
ENV OPAMCOLOR="always"
RUN doas ln -f /usr/bin/opam-2.4 /usr/bin/opam
RUN opam init --reinit -ni
RUN uname -rs && opam exec -- ocaml -version && opam --version
RUN cd ~/opam-repository && (git cat-file -e b8021439f8c57ba6435bc2263f6596671f4f4466 || git fetch origin master) && git reset -q --hard b8021439f8c57ba6435bc2263f6596671f4f4466 && git log --no-decorate -n1 --oneline && opam update -u
COPY --chown=1000:1000 ppxlib.opam ppxlib-tools.opam ppxlib-bench.opam /home/opam/src/./
RUN opam pin add -yn ppxlib.dev '/home/opam/src/./' && \
opam pin add -yn ppxlib-tools.dev '/home/opam/src/./' && \
opam pin add -yn ppxlib-bench.dev '/home/opam/src/./'
RUN echo '(lang dune 3.0)' > '/home/opam/src/./dune-project'
ENV DEPS="base.v0.16.4 base-bigarray.base base-threads.base base-unix.base cinaps.v0.15.1 cmdliner.1.3.0 csexp.1.5.2 dune.3.19.1 dune-configurator.3.19.1 ocaml.4.14.2 ocaml-base-compiler.4.14.2 ocaml-compiler-libs.v0.12.4 ocaml-config.2 ocaml-options-vanilla.1 ocamlfind.1.9.8 ppx_derivers.1.2.1 re.1.13.2 seq.base sexplib0.v0.16.0 stdlib-shims.0.3.0 yojson.3.0.0"
ENV CI="true"
ENV OCAMLCI="true"
RUN opam update --depexts && opam install --cli=2.4 --depext-only -y ppxlib.dev ppxlib-tools.dev ppxlib-bench.dev $DEPS
RUN opam install $DEPS
COPY --chown=1000:1000 . /home/opam/src
RUN cd /home/opam/src && opam exec -- dune build @install @check @runtest && rm -rf _build
END-OF-DOCKERFILE
docker build .
END-REPRO-BLOCK
2025-08-11 12:13.23: Using cache hint "ocaml-ppx/ppxlib-openbsd-77-amd64-ocaml-4.14-openbsd-77-amd64-4.14_opam-2.4-b68e9df276868c41024ba0e8680a3274"
2025-08-11 12:13.23: Using OBuilder spec:
((from openbsd-77-amd64-ocaml-4.14)
(comment openbsd-77-amd64-4.14_opam-2.4)
(user (uid 1000) (gid 1000))
(env CLICOLOR_FORCE 1)
(env OPAMCOLOR always)
(run (shell "doas ln -f /usr/bin/opam-2.4 /usr/bin/opam"))
(run (shell "opam init --reinit -ni"))
(run (shell "uname -rs && opam exec -- ocaml -version && opam --version"))
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "cd ~/opam-repository && (git cat-file -e b8021439f8c57ba6435bc2263f6596671f4f4466 || git fetch origin master) && git reset -q --hard b8021439f8c57ba6435bc2263f6596671f4f4466 && git log --no-decorate -n1 --oneline && opam update -u"))
(copy (src ppxlib.opam ppxlib-tools.opam ppxlib-bench.opam)
(dst /home/opam/src/./))
(run (network host)
(shell "opam pin add -yn ppxlib.dev '/home/opam/src/./' && \
\nopam pin add -yn ppxlib-tools.dev '/home/opam/src/./' && \
\nopam pin add -yn ppxlib-bench.dev '/home/opam/src/./'"))
(run (network host)
(shell "echo '(lang dune 3.0)' > '/home/opam/src/./dune-project'"))
(env DEPS "base.v0.16.4 base-bigarray.base base-threads.base base-unix.base cinaps.v0.15.1 cmdliner.1.3.0 csexp.1.5.2 dune.3.19.1 dune-configurator.3.19.1 ocaml.4.14.2 ocaml-base-compiler.4.14.2 ocaml-compiler-libs.v0.12.4 ocaml-config.2 ocaml-options-vanilla.1 ocamlfind.1.9.8 ppx_derivers.1.2.1 re.1.13.2 seq.base sexplib0.v0.16.0 stdlib-shims.0.3.0 yojson.3.0.0")
(env CI true)
(env OCAMLCI true)
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam update --depexts && opam install --cli=2.4 --depext-only -y ppxlib.dev ppxlib-tools.dev ppxlib-bench.dev $DEPS"))
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam install $DEPS"))
(copy (src .) (dst /home/opam/src))
(run (shell "cd /home/opam/src && opam exec -- dune build @install @check @runtest && rm -rf _build"))
)
2025-08-11 12:13.23: Waiting for resource in pool OCluster
2025-08-11 12:13.23: Waiting for worker…
2025-08-11 12:13.41: Got resource from pool OCluster
Building on oregano
All commits already cached
HEAD is now at e516f47c TMP
(from openbsd-77-amd64-ocaml-4.14)
2025-08-11 12:13.41 ---> using "00579f8dea230f94ca5972e50ed0dc70167d1c0e96cfe76e645642677774f17f" from cache
/: (comment openbsd-77-amd64-4.14_opam-2.4)
/: (user (uid 1000) (gid 1000))
/: (env CLICOLOR_FORCE 1)
/: (env OPAMCOLOR always)
/: (run (shell "doas ln -f /usr/bin/opam-2.4 /usr/bin/opam"))
2025-08-11 12:13.41 ---> using "8054e5d0929fce63b2e622c1fc2caefa9b5f6e503f9fc7599e0bc40c0bb8a3e7" from cache
/: (run (shell "opam init --reinit -ni"))
No configuration file found, using built-in defaults.
Checking for available remotes: rsync and local, git.
- you won't be able to use mercurial repositories unless you install the hg command on your system.
- you won't be able to use darcs repositories unless you install the darcs command on your system.
<><> Updating repositories ><><><><><><><><><><><><><><><><><><><><><><><><><><>
[default] no changes from file:///home/opam/opam-repository
2025-08-11 12:13.41 ---> using "8a35e9584a9ed6dcc739329957f608077d9c3bd6b56dee5b8d5c3bdd8dab57f7" from cache
/: (run (shell "uname -rs && opam exec -- ocaml -version && opam --version"))
OpenBSD 7.7
The OCaml toplevel, version 4.14.2
2.4.1
2025-08-11 12:13.41 ---> using "b0cd4eee5840b9ccd2075fddbf7c93660c8c159436f71f3bf2f9c12998bdaf67" from cache
/: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "cd ~/opam-repository && (git cat-file -e b8021439f8c57ba6435bc2263f6596671f4f4466 || git fetch origin master) && git reset -q --hard b8021439f8c57ba6435bc2263f6596671f4f4466 && git log --no-decorate -n1 --oneline && opam update -u"))
b8021439f8 Merge pull request #28261 from kit-ty-kate/deploy-fix-25819
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] synchronised from file:///home/opam/opam-repository
Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).
However, you may "opam upgrade" these packages explicitly at these versions (e.g. "opam upgrade ocaml.5.3.0"), which will ask permission to downgrade or uninstall the conflicting packages.
Nothing to do.
# To update the current shell environment, run: eval $(opam env)
2025-08-11 12:13.41 ---> using "421dbd4b4f88471f47f8c9c01040b34c6b435684a75777652574583650e5faff" from cache
/: (copy (src ppxlib.opam ppxlib-tools.opam ppxlib-bench.opam)
(dst /home/opam/src/./))
2025-08-11 12:13.41 ---> using "94a49725ca3af8b14ee5ad8687e6d72ddb68b933f22c2cdc29ee679373c4f5da" from cache
/: (run (network host)
(shell "opam pin add -yn ppxlib.dev '/home/opam/src/./' && \
\nopam pin add -yn ppxlib-tools.dev '/home/opam/src/./' && \
\nopam pin add -yn ppxlib-bench.dev '/home/opam/src/./'"))
[ppxlib.dev] synchronised (file:///home/opam/src)
ppxlib is now pinned to file:///home/opam/src (version dev)
[ppxlib-tools.dev] synchronised (file:///home/opam/src)
ppxlib-tools is now pinned to file:///home/opam/src (version dev)
[NOTE] Package ppxlib-bench does not exist in opam repositories registered in the current switch.
[ppxlib-bench.dev] synchronised (file:///home/opam/src)
ppxlib-bench is now pinned to file:///home/opam/src (version dev)
2025-08-11 12:13.41 ---> using "e1d22ec36b83a57741d99b4581c24a09c7ba91394c6e537b1d02f1138a04c716" from cache
/: (run (network host)
(shell "echo '(lang dune 3.0)' > '/home/opam/src/./dune-project'"))
2025-08-11 12:13.41 ---> using "c78850e9bb86660a8e56a9786852f270bdd266c03646f9997c738b2571c44587" from cache
/: (env DEPS "base.v0.16.4 base-bigarray.base base-threads.base base-unix.base cinaps.v0.15.1 cmdliner.1.3.0 csexp.1.5.2 dune.3.19.1 dune-configurator.3.19.1 ocaml.4.14.2 ocaml-base-compiler.4.14.2 ocaml-compiler-libs.v0.12.4 ocaml-config.2 ocaml-options-vanilla.1 ocamlfind.1.9.8 ppx_derivers.1.2.1 re.1.13.2 seq.base sexplib0.v0.16.0 stdlib-shims.0.3.0 yojson.3.0.0")
/: (env CI true)
/: (env OCAMLCI true)
/: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam update --depexts && opam install --cli=2.4 --depext-only -y ppxlib.dev ppxlib-tools.dev ppxlib-bench.dev $DEPS"))
[WARNING] Unknown update command for bsd, skipping system update
<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
[ppxlib-tools.dev] synchronised (file:///home/opam/src)
[ppxlib-bench.dev] synchronised (file:///home/opam/src)
[ppxlib.dev] synchronised (file:///home/opam/src)
[NOTE] Package ocaml-options-vanilla is already installed (current version is 1).
[NOTE] Package ocaml-config is already installed (current version is 2).
[NOTE] Package ocaml-base-compiler is already installed (current version is 4.14.2).
[NOTE] Package ocaml is already installed (current version is 4.14.2).
[NOTE] Package base-unix is already installed (current version is base).
[NOTE] Package base-threads is already installed (current version is base).
[NOTE] Package base-bigarray is already installed (current version is base).
2025-08-11 12:13.41 ---> using "b1b522d2cf7a6ca08a74920da5353d74417bafb50daa1c788b691c6d1167d684" from cache
/: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam install $DEPS"))
[NOTE] Package ocaml-options-vanilla is already installed (current version is 1).
[NOTE] Package ocaml-config is already installed (current version is 2).
[NOTE] Package ocaml-base-compiler is already installed (current version is 4.14.2).
[NOTE] Package ocaml is already installed (current version is 4.14.2).
[NOTE] Package base-unix is already installed (current version is base).
[NOTE] Package base-threads is already installed (current version is base).
[NOTE] Package base-bigarray is already installed (current version is base).
The following actions will be performed:
=== install 14 packages
- install base v0.16.4
- install cinaps v0.15.1
- install cmdliner 1.3.0
- install csexp 1.5.2
- install dune 3.19.1
- install dune-configurator 3.19.1
- install ocaml-compiler-libs v0.12.4
- install ocamlfind 1.9.8
- install ppx_derivers 1.2.1
- install re 1.13.2
- install seq base
- install sexplib0 v0.16.0
- install stdlib-shims 0.3.0
- install yojson 3.0.0
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved cmdliner.1.3.0 (cached)
-> retrieved csexp.1.5.2 (cached)
-> retrieved cinaps.v0.15.1 (cached)
-> retrieved base.v0.16.4 (cached)
-> retrieved ocaml-compiler-libs.v0.12.4 (cached)
-> retrieved ppx_derivers.1.2.1 (cached)
-> retrieved ocamlfind.1.9.8 (cached)
-> retrieved seq.base (cached)
-> retrieved re.1.13.2 (cached)
-> retrieved sexplib0.v0.16.0 (cached)
-> retrieved stdlib-shims.0.3.0 (cached)
-> retrieved yojson.3.0.0 (cached)
-> retrieved dune.3.19.1, dune-configurator.3.19.1 (cached)
-> installed cmdliner.1.3.0
-> installed dune.3.19.1
-> installed ocamlfind.1.9.8
-> installed csexp.1.5.2
-> installed ocaml-compiler-libs.v0.12.4
-> installed dune-configurator.3.19.1
-> installed ppx_derivers.1.2.1
-> installed seq.base
-> installed sexplib0.v0.16.0
-> installed re.1.13.2
-> installed base.v0.16.4
-> installed cinaps.v0.15.1
-> installed stdlib-shims.0.3.0
-> installed yojson.3.0.0
Done.
# To update the current shell environment, run: eval $(opam env)
2025-08-11 12:13.41 ---> using "3953257f959128b7cd16a36cc9ddf14ef5c442790f703c693e7fb4d65b4693a1" from cache
/: (copy (src .) (dst /home/opam/src))
2025-08-11 12:14.25 ---> saved as "0794589f63eae9717fb7442f091702a453320aec390c69bf39e2e990d1df9670"
/: (run (shell "cd /home/opam/src && opam exec -- dune build @install @check @runtest && rm -rf _build"))
(cd _build/default && .bin/expect-test test/ast_builder_value_binding/test.ml)
Cannot find type Topdirs.printer_type_new.
Cannot find type Topdirs.printer_type_new.
Cannot find type Topdirs.printer_type_new.
File "test/ast_builder_value_binding/test.ml", line 1, characters 0-0:
/usr/local/bin/git --no-pager diff --no-index --color=always -u _build/default/test/ast_builder_value_binding/test.ml _build/default/test/ast_builder_value_binding/test.ml.corrected
diff --git a/_build/default/test/ast_builder_value_binding/test.ml b/_build/default/test/ast_builder_value_binding/test.ml.corrected
index 4cc4564..b6a1c2a 100644
--- a/_build/default/test/ast_builder_value_binding/test.ml
+++ b/_build/default/test/ast_builder_value_binding/test.ml.corrected
@@ -26,32 +26,155 @@ let vb =
[%%expect{|
val vb : structure_item =
- Pstr_value
- ( Nonrecursive
- , [ { pvb_pat = Ppat_var "f"
- ; pvb_expr =
- Pexp_function
- ( [ { pparam_loc = __loc
- ; pparam_desc = Pparam_val ( Nolabel, None, Ppat_var "x")
- }
- ]
- , None
- , Pfunction_body
- (Pexp_apply
- ( Pexp_ident (Lident "+")
- , [ ( Nolabel, Pexp_ident (Lident "x"))
- ; ( Nolabel
- , Pexp_constant (Pconst_integer ( "1", None))
- )
- ]
- ))
- )
- ; pvb_constraint = None
- ; pvb_attributes = __attrs
- ; pvb_loc = __loc
- }
- ]
- )
+ {Ppxlib__.Import.pstr_desc =
+ Ppxlib__.Import.Pstr_value (Ppxlib__.Import.Nonrecursive,
+ [{Ppxlib__.Import.pvb_pat =
+ {Ppxlib__.Import.ppat_desc =
+ Ppxlib__.Import.Ppat_var
+ {Ppxlib__.Import.txt = "f";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ ppat_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ ppat_loc_stack = []; ppat_attributes = []};
+ pvb_expr =
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_function
+ ([{Ppxlib__.Import.pparam_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pparam_desc =
+ Ppxlib__.Import.Pparam_val (Ppxlib__.Import.Nolabel, None,
+ {Ppxlib__.Import.ppat_desc =
+ Ppxlib__.Import.Ppat_var
+ {Ppxlib__.Import.txt = "x";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ ppat_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ppat_loc_stack = []; ppat_attributes = []})}],
+ None,
+ Ppxlib__.Import.Pfunction_body
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_apply
+ ({Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_ident
+ {Ppxlib__.Import.txt = Ppxlib__.Import.Lident "+";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []},
+ [(Ppxlib__.Import.Nolabel,
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_ident
+ {Ppxlib__.Import.txt = Ppxlib__.Import.Lident "x";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []});
+ (Ppxlib__.Import.Nolabel,
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_constant
+ (Ppxlib__.Import.Pconst_integer ("1", None));
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []})]);
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []});
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []};
+ pvb_constraint = None; pvb_attributes = [];
+ pvb_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}]);
+ pstr_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}
|}]
(* As expected here, the [pvb_constraint] field is none, the pattern and
@@ -69,21 +192,85 @@ let vb =
[%%expect{|
val vb : structure_item =
- Pstr_value
- ( Nonrecursive
- , [ { pvb_pat = Ppat_var "x"
- ; pvb_expr = Pexp_constant (Pconst_integer ( "12", None))
- ; pvb_constraint =
- Some
- (Pvc_constraint
- { locally_abstract_univars = []
- ; typ = Ptyp_constr ( Lident "int", [])
- })
- ; pvb_attributes = __attrs
- ; pvb_loc = __loc
- }
- ]
- )
+ {Ppxlib__.Import.pstr_desc =
+ Ppxlib__.Import.Pstr_value (Ppxlib__.Import.Nonrecursive,
+ [{Ppxlib__.Import.pvb_pat =
+ {Ppxlib__.Import.ppat_desc =
+ Ppxlib__.Import.Ppat_var
+ {Ppxlib__.Import.txt = "x";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ ppat_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ ppat_loc_stack = []; ppat_attributes = []};
+ pvb_expr =
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_constant
+ (Ppxlib__.Import.Pconst_integer ("12", None));
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []};
+ pvb_constraint =
+ Some
+ (Ppxlib__.Import.Pvc_constraint
+ {Ppxlib__.Import.locally_abstract_univars = [];
+ typ =
+ {Ppxlib__.Import.ptyp_desc =
+ Ppxlib__.Import.Ptyp_constr
+ ({Ppxlib__.Import.txt = Ppxlib__.Import.Lident "int";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}},
+ []);
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []}});
+ pvb_attributes = [];
+ pvb_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}]);
+ pstr_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}
|}]
(* --------- poly Ppat_constraint to pvb_constraint --------- *)
@@ -105,37 +292,177 @@ let vb =
[%%expect{|
val vb : structure_item =
- Pstr_value
- ( Nonrecursive
- , [ { pvb_pat = Ppat_var "f"
- ; pvb_expr =
- Pexp_function
- ( [ { pparam_loc = __loc
- ; pparam_desc = Pparam_val ( Nolabel, None, Ppat_var "x")
- }
- ]
- , None
- , Pfunction_body (Pexp_ident (Lident "unit"))
- )
- ; pvb_constraint =
- Some
- (Pvc_constraint
- { locally_abstract_univars = []
- ; typ =
- Ptyp_poly
- ( [ "a"]
- , Ptyp_arrow
- ( Nolabel
- , Ptyp_var "a"
- , Ptyp_constr ( Lident "unit", [])
- )
- )
- })
- ; pvb_attributes = __attrs
- ; pvb_loc = __loc
- }
- ]
- )
+ {Ppxlib__.Import.pstr_desc =
+ Ppxlib__.Import.Pstr_value (Ppxlib__.Import.Nonrecursive,
+ [{Ppxlib__.Import.pvb_pat =
+ {Ppxlib__.Import.ppat_desc =
+ Ppxlib__.Import.Ppat_var
+ {Ppxlib__.Import.txt = "f";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ ppat_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ ppat_loc_stack = []; ppat_attributes = []};
+ pvb_expr =
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_function
+ ([{Ppxlib__.Import.pparam_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pparam_desc =
+ Ppxlib__.Import.Pparam_val (Ppxlib__.Import.Nolabel, None,
+ {Ppxlib__.Import.ppat_desc =
+ Ppxlib__.Import.Ppat_var
+ {Ppxlib__.Import.txt = "x";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ ppat_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ppat_loc_stack = []; ppat_attributes = []})}],
+ None,
+ Ppxlib__.Import.Pfunction_body
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_ident
+ {Ppxlib__.Import.txt = Ppxlib__.Import.Lident "unit";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []});
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []};
+ pvb_constraint =
+ Some
+ (Ppxlib__.Import.Pvc_constraint
+ {Ppxlib__.Import.locally_abstract_univars = [];
+ typ =
+ {Ppxlib__.Import.ptyp_desc =
+ Ppxlib__.Import.Ptyp_poly
+ ([{Ppxlib__.Import.txt = "a";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}}],
+ {Ppxlib__.Import.ptyp_desc =
+ Ppxlib__.Import.Ptyp_arrow (Ppxlib__.Import.Nolabel,
+ {Ppxlib__.Import.ptyp_desc = Ppxlib__.Import.Ptyp_var "a";
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []},
+ {Ppxlib__.Import.ptyp_desc =
+ Ppxlib__.Import.Ptyp_constr
+ ({Ppxlib__.Import.txt = Ppxlib__.Import.Lident "unit";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_";
+ pos_lnum = 0; pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_";
+ pos_lnum = 0; pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}},
+ []);
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []});
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []});
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []}});
+ pvb_attributes = [];
+ pvb_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}]);
+ pstr_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}
|}]
(* --------- desugared locally abstract univars to pvb_constraint --------- *)
@@ -157,34 +484,167 @@ let vb =
[%%expect{|
val vb : structure_item =
- Pstr_value
- ( Nonrecursive
- , [ { pvb_pat = Ppat_var "f"
- ; pvb_expr =
- Pexp_function
- ( [ { pparam_loc = __loc
- ; pparam_desc = Pparam_val ( Nolabel, None, Ppat_any)
- }
- ]
- , None
- , Pfunction_body (Pexp_ident (Lident "unit"))
- )
- ; pvb_constraint =
- Some
- (Pvc_constraint
- { locally_abstract_univars = [ "a"]
- ; typ =
- Ptyp_arrow
- ( Nolabel
- , Ptyp_constr ( Lident "a", [])
- , Ptyp_constr ( Lident "unit", [])
- )
- })
- ; pvb_attributes = __attrs
- ; pvb_loc = __loc
- }
- ]
- )
+ {Ppxlib__.Import.pstr_desc =
+ Ppxlib__.Import.Pstr_value (Ppxlib__.Import.Nonrecursive,
+ [{Ppxlib__.Import.pvb_pat =
+ {Ppxlib__.Import.ppat_desc =
+ Ppxlib__.Import.Ppat_var
+ {Ppxlib__.Import.txt = "f";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ ppat_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ ppat_loc_stack = []; ppat_attributes = []};
+ pvb_expr =
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_function
+ ([{Ppxlib__.Import.pparam_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pparam_desc =
+ Ppxlib__.Import.Pparam_val (Ppxlib__.Import.Nolabel, None,
+ {Ppxlib__.Import.ppat_desc = Ppxlib__.Import.Ppat_any;
+ ppat_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ppat_loc_stack = []; ppat_attributes = []})}],
+ None,
+ Ppxlib__.Import.Pfunction_body
+ {Ppxlib__.Import.pexp_desc =
+ Ppxlib__.Import.Pexp_ident
+ {Ppxlib__.Import.txt = Ppxlib__.Import.Lident "unit";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}};
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []});
+ pexp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true};
+ pexp_loc_stack = []; pexp_attributes = []};
+ pvb_constraint =
+ Some
+ (Ppxlib__.Import.Pvc_constraint
+ {Ppxlib__.Import.locally_abstract_univars =
+ [{Ppxlib__.Import.txt = "a";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}}];
+ typ =
+ {Ppxlib__.Import.ptyp_desc =
+ Ppxlib__.Import.Ptyp_arrow (Ppxlib__.Import.Nolabel,
+ {Ppxlib__.Import.ptyp_desc =
+ Ppxlib__.Import.Ptyp_constr
+ ({Ppxlib__.Import.txt = Ppxlib__.Import.Lident "a";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}},
+ []);
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []},
+ {Ppxlib__.Import.ptyp_desc =
+ Ppxlib__.Import.Ptyp_constr
+ ({Ppxlib__.Import.txt = Ppxlib__.Import.Lident "unit";
+ loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true}},
+ []);
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []});
+ ptyp_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0;
+ pos_bol = 0; pos_cnum = -1};
+ loc_ghost = true};
+ ptyp_loc_stack = []; ptyp_attributes = []}});
+ pvb_attributes = [];
+ pvb_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}]);
+ pstr_loc =
+ {Ppxlib__.Import.loc_start =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_end =
+ {Ppxlib__.Import.pos_fname = "_none_"; pos_lnum = 0; pos_bol = 0;
+ pos_cnum = -1};
+ loc_ghost = true}}
|}]
(* As expected here, the matching constraint from the pattern and expression or
@@ -194,3 +654,5 @@ val vb : structure_item =
(* --------- coercion to pvb_constraint --------- *)
(*TODO*)
+[%%expect{|
+|}]
"cd /home/opam/src && opam exec -- dune build @install @check @runtest && rm -rf _build" failed with exit status 1
2025-08-11 12:16.05: Job failed: Failed: Build failed