2025-08-11 12:13.23: New job: test ocaml-ppx/ppxlib https://github.com/ocaml-ppx/ppxlib.git#refs/pull/589/head (e516f47c64a6b9890c304f454a70725b8af38173) (macos-x86_64:macos-homebrew-4.14_opam-2.4)
Base: macos-homebrew-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 macos-homebrew-ocaml-4.14
# macos-homebrew-4.14_opam-2.4
USER 1000:1000
ENV CLICOLOR_FORCE="1"
ENV OPAMCOLOR="always"
RUN ln -f ~/local/bin/opam-2.4 ~/local/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 ./src/./
RUN opam pin add -yn ppxlib.dev './src/./' && \
opam pin add -yn ppxlib-tools.dev './src/./' && \
opam pin add -yn ppxlib-bench.dev './src/./'
RUN echo '(lang dune 3.0)' > './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 . ./src
RUN cd ./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-macos-homebrew-ocaml-4.14-macos-homebrew-4.14_opam-2.4-b68e9df276868c41024ba0e8680a3274"
2025-08-11 12:13.23: Using OBuilder spec:
((from macos-homebrew-ocaml-4.14)
(comment macos-homebrew-4.14_opam-2.4)
(user (uid 1000) (gid 1000))
(env CLICOLOR_FORCE 1)
(env OPAMCOLOR always)
(run (shell "ln -f ~/local/bin/opam-2.4 ~/local/bin/opam"))
(run (shell "opam init --reinit -ni"))
(run (shell "uname -rs && opam exec -- ocaml -version && opam --version"))
(run (cache (opam-archives (target /Users/mac1000/.opam/download-cache)) (homebrew (target /Users/mac1000/Library/Caches/Homebrew)))
(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 ./src/./))
(run (network host)
(shell "opam pin add -yn ppxlib.dev './src/./' && \
\nopam pin add -yn ppxlib-tools.dev './src/./' && \
\nopam pin add -yn ppxlib-bench.dev './src/./'"))
(run (network host)
(shell "echo '(lang dune 3.0)' > './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 /Users/mac1000/.opam/download-cache)) (homebrew (target /Users/mac1000/Library/Caches/Homebrew)))
(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 /Users/mac1000/.opam/download-cache)) (homebrew (target /Users/mac1000/Library/Caches/Homebrew)))
(network host)
(shell "opam install $DEPS"))
(copy (src .) (dst ./src))
(run (shell "cd ./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.23: Got resource from pool OCluster
Building on i7-worker-04
HEAD is now at b0aa3047 Expose Lexer.comments in the Parse module
HEAD is now at e516f47c TMP
(from macos-homebrew-ocaml-4.14)
2025-08-11 12:13.26 ---> using "0c60f117aee57abea8364cb033d47bb1d63ff0f68e5ee97378e032498e8442af" from cache
/: (comment macos-homebrew-4.14_opam-2.4)
/: (user (uid 1000) (gid 1000))
/: (env CLICOLOR_FORCE 1)
/: (env OPAMCOLOR always)
/: (run (shell "ln -f ~/local/bin/opam-2.4 ~/local/bin/opam"))
2025-08-11 12:13.26 ---> using "16fd332aba96a180769fbf49639a0f9a6aa6ed7d2edfa24c2b9bea4039176eb4" 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.
This version of opam requires an update to the layout of /Users/mac1000/.opam from version 2.1 to version 2.2, which can't be reverted.
You may want to back it up before going further.
Continue? [Y/n] y
[NOTE] The 'jobs' option was reset, its value was 1 and its new value will vary according to the current number of cores on your machine. You can restore the fixed value using:
opam option jobs=1 --global
Format upgrade done.
<><> Updating repositories ><><><><><><><><><><><><><><><><><><><><><><><><><><>
[default] no changes from git+file:///Users/mac1000/opam-repository
2025-08-11 12:13.26 ---> using "441082522a992e4675bb61cf184ac4d487fcb27eccab875ab68ef480e42527a0" from cache
/: (run (shell "uname -rs && opam exec -- ocaml -version && opam --version"))
Darwin 24.5.0
The OCaml toplevel, version 4.14.2
2.4.1
2025-08-11 12:13.27 ---> using "73a23ad864bce177bda3ef5ed15fdc258f712e067e25e839184501078d169a1f" from cache
/: (run (cache (opam-archives (target /Users/mac1000/.opam/download-cache)) (homebrew (target /Users/mac1000/Library/Caches/Homebrew)))
(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 git+file:///Users/mac1000/opam-repository
Everything as up-to-date as possible
The following packages are not being upgraded because the new versions conflict with other installed packages:
- ocaml.5.3.0
- ocaml-config.3
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.27 ---> using "4d983df77018508b59ce794af3c0e0fdb8e0b6642a19ffa9c4a0aa507d37712f" from cache
/: (copy (src ppxlib.opam ppxlib-tools.opam ppxlib-bench.opam) (dst ./src/./))
2025-08-11 12:13.27 ---> using "b8e7ec09da688a8688532e3e1dab4641424950520aa3a55ff6cb9ca7497b03db" from cache
/: (run (network host)
(shell "opam pin add -yn ppxlib.dev './src/./' && \
\nopam pin add -yn ppxlib-tools.dev './src/./' && \
\nopam pin add -yn ppxlib-bench.dev './src/./'"))
[ppxlib.dev] synchronised (file:///Users/mac1000/src)
ppxlib is now pinned to file:///Users/mac1000/src (version dev)
[ppxlib-tools.dev] synchronised (file:///Users/mac1000/src)
ppxlib-tools is now pinned to file:///Users/mac1000/src (version dev)
[NOTE] Package ppxlib-bench does not exist in opam repositories registered in the current switch.
[ppxlib-bench.dev] synchronised (file:///Users/mac1000/src)
ppxlib-bench is now pinned to file:///Users/mac1000/src (version dev)
2025-08-11 12:13.28 ---> using "76b304dc113c00d31a413af1037d160065f532f002d8cb2a3c252d23ce7dfbc6" from cache
/: (run (network host)
(shell "echo '(lang dune 3.0)' > './src/./dune-project'"))
2025-08-11 12:13.28 ---> using "6ec710c95ce47bdd0d5521cb1e5b368ede36c09808fc4975d29a376e6f5247d7" 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 /Users/mac1000/.opam/download-cache)) (homebrew (target /Users/mac1000/Library/Caches/Homebrew)))
(network host)
(shell "opam update --depexts && opam install --cli=2.4 --depext-only -y ppxlib.dev ppxlib-tools.dev ppxlib-bench.dev $DEPS"))
+ /usr/local/bin/brew "update"
- ==> Updating Homebrew...
- Already up-to-date.
<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
[ppxlib-tools.dev] synchronised (file:///Users/mac1000/src)
[ppxlib-bench.dev] synchronised (file:///Users/mac1000/src)
[ppxlib.dev] synchronised (file:///Users/mac1000/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.28 ---> using "bf99be202b13e17f616bade48157d5d4420c871460994dd1de5412a41748ff70" from cache
/: (run (cache (opam-archives (target /Users/mac1000/.opam/download-cache)) (homebrew (target /Users/mac1000/Library/Caches/Homebrew)))
(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)
-> installed seq.base
-> retrieved sexplib0.v0.16.0 (cached)
-> retrieved re.1.13.2 (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 ocamlfind.1.9.8
-> installed dune.3.19.1
-> installed stdlib-shims.0.3.0
-> installed ppx_derivers.1.2.1
-> installed csexp.1.5.2
-> installed yojson.3.0.0
-> installed sexplib0.v0.16.0
-> installed re.1.13.2
-> installed ocaml-compiler-libs.v0.12.4
-> installed cinaps.v0.15.1
-> installed dune-configurator.3.19.1
-> installed base.v0.16.4
Done.
# To update the current shell environment, run: eval $(opam env)
2025-08-11 12:13.29 ---> using "afe25ac920027fc4fc3ca8fa558dcf0666aa17bd254906ed893c1041300658dd" from cache
/: (copy (src .) (dst ./src))
2025-08-11 12:13.31 ---> saved as "cdba63b541d95a731d836cc8549482e91a1ec60d5d15144917807f4b77c7950e"
/: (run (shell "cd ./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/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{|
+|}]
"/usr/bin/env" "bash" "-c" "cd ./src && opam exec -- dune build @install @check @runtest && rm -rf _build" failed with exit status 1
2025-08-11 12:14.00: Job failed: Failed: Build failed