Skip to content

tyxml-ppx.4.6.0: allow ppxlib 0.36 and 0.37#29460

Closed
davesnx wants to merge 3 commits intoocaml:masterfrom
davesnx:tyxml-ppx-ppxlib-036
Closed

tyxml-ppx.4.6.0: allow ppxlib 0.36 and 0.37#29460
davesnx wants to merge 3 commits intoocaml:masterfrom
davesnx:tyxml-ppx-ppxlib-036

Conversation

@davesnx
Copy link
Contributor

@davesnx davesnx commented Feb 25, 2026

No description provided.

Copy link
Member

@jmid jmid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the relaxed ppxlib bound I see this failing across the board (0 workflows passed), e.g.
https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/e9243d54b894f2ff7d6624033a71869eda8f9a19/variant/compilers,5.4,tyxml-ppx.4.6.0

[...]
-> installed ppxlib.0.37.0
-> installed tyxml-syntax.4.6.0
[ERROR] The compilation of tyxml-ppx.4.6.0 failed at "dune build -p tyxml-ppx -j 71 @install".

#=== ERROR while compiling tyxml-ppx.4.6.0 ====================================#
# context              2.5.0 | linux/x86_64 | ocaml-base-compiler.5.4.0 | pinned(https://github.com/ocsigen/tyxml/releases/download/4.6.0/tyxml-4.6.0.tbz)
# path                 ~/.opam/5.4/.opam-switch/build/tyxml-ppx.4.6.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p tyxml-ppx -j 71 @install
# exit-code            1
# env-file             ~/.opam/log/tyxml-ppx-7-a64ed7.env
# output-file          ~/.opam/log/tyxml-ppx-7-a64ed7.out
### output ###
# (cd _build/default && /home/opam/.opam/5.4/bin/ocamlopt.opt -w -40 -safe-string -open Ppxlib -w -9 -g -I ppx/.tyxml_ppx.objs/byte -I ppx/.tyxml_ppx.objs/native -I /home/opam/.opam/5.4/lib/markup -I /home/opam/.opam/5.4/lib/ocaml-compiler-libs/common -I /home/opam/.opam/5.4/lib/ocaml-compiler-libs/shadow -I /home/opam/.opam/5.4/lib/ocaml/compiler-libs -I /home/opam/.opam/5.4/lib/ppx_derivers -I /home/opam/.opam/5.4/lib/ppxlib -I /home/opam/.opam/5.4/lib/ppxlib/ast -I /home/opam/.opam/5.4/lib/ppxlib/astlib -I /home/opam/.opam/5.4/lib/ppxlib/print_diff -I /home/opam/.opam/5.4/lib/ppxlib/stdppx -I /home/opam/.opam/5.4/lib/ppxlib/traverse_builtins -I /home/opam/.opam/5.4/lib/re -I /home/opam/.opam/5.4/lib/re/str -I /home/opam/.opam/5.4/lib/sexplib0 -I /home/opam/.opam/5.4/lib/stdlib-shims -I /home/opam/.opam/5.4/lib/tyxml-syntax -I /home/opam/.opam/5.4/lib/uutf -cmi-file ppx/.tyxml_ppx.objs/byte/tyxml_ppx.cmi -no-alias-deps -o ppx/.tyxml_ppx.objs/native/tyxml_ppx.cmx -c -impl ppx/tyxml_ppx.pp.ml)
# File "ppx/tyxml_ppx.ml", line 381, characters 4-12:
# 381 |   | Pexp_fun (label,def,pat,content) ->
#           ^^^^^^^^
# Error: This variant pattern is expected to have type
#          Ppxlib.Parsetree.expression_desc
#        There is no constructor Pexp_fun within type Ppxlib.Parsetree.expression_desc
# Hint:             Did you mean Pexp_for?
# (cd _build/default && /home/opam/.opam/5.4/bin/ocamlc.opt -w -40 -safe-string -open Ppxlib -w -9 -g -bin-annot -bin-annot-occurrences -I ppx/.tyxml_ppx.objs/byte -I /home/opam/.opam/5.4/lib/markup -I /home/opam/.opam/5.4/lib/ocaml-compiler-libs/common -I /home/opam/.opam/5.4/lib/ocaml-compiler-libs/shadow -I /home/opam/.opam/5.4/lib/ocaml/compiler-libs -I /home/opam/.opam/5.4/lib/ppx_derivers -I /home/opam/.opam/5.4/lib/ppxlib -I /home/opam/.opam/5.4/lib/ppxlib/ast -I /home/opam/.opam/5.4/lib/ppxlib/astlib -I /home/opam/.opam/5.4/lib/ppxlib/print_diff -I /home/opam/.opam/5.4/lib/ppxlib/stdppx -I /home/opam/.opam/5.4/lib/ppxlib/traverse_builtins -I /home/opam/.opam/5.4/lib/re -I /home/opam/.opam/5.4/lib/re/str -I /home/opam/.opam/5.4/lib/sexplib0 -I /home/opam/.opam/5.4/lib/stdlib-shims -I /home/opam/.opam/5.4/lib/tyxml-syntax -I /home/opam/.opam/5.4/lib/uutf -cmi-file ppx/.tyxml_ppx.objs/byte/tyxml_ppx.cmi -no-alias-deps -o ppx/.tyxml_ppx.objs/byte/tyxml_ppx.cmo -c -impl ppx/tyxml_ppx.pp.ml)
# File "ppx/tyxml_ppx.ml", line 381, characters 4-12:
# 381 |   | Pexp_fun (label,def,pat,content) ->
#           ^^^^^^^^
# Error: This variant pattern is expected to have type
#          Ppxlib.Parsetree.expression_desc
#        There is no constructor Pexp_fun within type Ppxlib.Parsetree.expression_desc
# Hint:             Did you mean Pexp_for?

So I think we can conclude it doesn't work with ppxlib.0.37.
Perhaps we can get away with ppxlib.0.36 though? 🤔

@mseri
Copy link
Member

mseri commented Feb 26, 2026

It only seem to fail on some ocaml 4.14 cases now:

#=== ERROR while compiling tyxml-ppx.4.6.0 ====================================#
# context              2.2.1 | linux/x86_64 | ocaml-base-compiler.4.14.2 | pinned(https://github.com/ocsigen/tyxml/releases/download/4.6.0/tyxml-4.6.0.tbz)
# path                 ~/.opam/4.14/.opam-switch/build/tyxml-ppx.4.6.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p tyxml-ppx -j 255 @install
# exit-code            1
# env-file             ~/.opam/log/tyxml-ppx-7-0ab5bd.env
# output-file          ~/.opam/log/tyxml-ppx-7-0ab5bd.out
### output ###
# (cd _build/default && /home/opam/.opam/4.14/bin/ocamlopt.opt -w -40 -safe-string -open Ppxlib -w -9 -g -I ppx/.tyxml_ppx.objs/byte -I ppx/.tyxml_ppx.objs/native -I /home/opam/.opam/4.14/lib/markup -I /home/opam/.opam/4.14/lib/ocaml-compiler-libs/common -I /home/opam/.opam/4.14/lib/ocaml-compiler-libs/shadow -I /home/opam/.opam/4.14/lib/ocaml/compiler-libs -I /home/opam/.opam/4.14/lib/ppx_derivers -I /home/opam/.opam/4.14/lib/ppxlib -I /home/opam/.opam/4.14/lib/ppxlib/ast -I /home/opam/.opam/4.14/lib/ppxlib/astlib -I /home/opam/.opam/4.14/lib/ppxlib/print_diff -I /home/opam/.opam/4.14/lib/ppxlib/stdppx -I /home/opam/.opam/4.14/lib/ppxlib/traverse_builtins -I /home/opam/.opam/4.14/lib/re -I /home/opam/.opam/4.14/lib/re/str -I /home/opam/.opam/4.14/lib/sexplib0 -I /home/opam/.opam/4.14/lib/stdlib-shims -I /home/opam/.opam/4.14/lib/tyxml-syntax -I /home/opam/.opam/4.14/lib/uutf -intf-suffix .ml -no-alias-deps -o ppx/.tyxml_ppx.objs/native/tyxml_ppx.cmx -c -impl ppx/tyxml_ppx.pp.ml)
# File "ppx/tyxml_ppx.ml", line 381, characters 4-12:
# 381 |   | Pexp_fun (label,def,pat,content) ->
#           ^^^^^^^^
# Error: This variant pattern is expected to have type
#          Ppxlib.Parsetree.expression_desc
#        There is no constructor Pexp_fun within type Ppxlib.Parsetree.expression_desc
# Hint: Did you mean Pexp_for?
# (cd _build/default && /home/opam/.opam/4.14/bin/ocamlc.opt -w -40 -safe-string -open Ppxlib -w -9 -g -bin-annot -I ppx/.tyxml_ppx.objs/byte -I /home/opam/.opam/4.14/lib/markup -I /home/opam/.opam/4.14/lib/ocaml-compiler-libs/common -I /home/opam/.opam/4.14/lib/ocaml-compiler-libs/shadow -I /home/opam/.opam/4.14/lib/ocaml/compiler-libs -I /home/opam/.opam/4.14/lib/ppx_derivers -I /home/opam/.opam/4.14/lib/ppxlib -I /home/opam/.opam/4.14/lib/ppxlib/ast -I /home/opam/.opam/4.14/lib/ppxlib/astlib -I /home/opam/.opam/4.14/lib/ppxlib/print_diff -I /home/opam/.opam/4.14/lib/ppxlib/stdppx -I /home/opam/.opam/4.14/lib/ppxlib/traverse_builtins -I /home/opam/.opam/4.14/lib/re -I /home/opam/.opam/4.14/lib/re/str -I /home/opam/.opam/4.14/lib/sexplib0 -I /home/opam/.opam/4.14/lib/stdlib-shims -I /home/opam/.opam/4.14/lib/tyxml-syntax -I /home/opam/.opam/4.14/lib/uutf -intf-suffix .ml -no-alias-deps -o ppx/.tyxml_ppx.objs/byte/tyxml_ppx.cmo -c -impl ppx/tyxml_ppx.pp.ml)
# File "ppx/tyxml_ppx.ml", line 381, characters 4-12:
# 381 |   | Pexp_fun (label,def,pat,content) ->
#           ^^^^^^^^
# Error: This variant pattern is expected to have type
#          Ppxlib.Parsetree.expression_desc
#        There is no constructor Pexp_fun within type Ppxlib.Parsetree.expression_desc
# Hint: Did you mean Pexp_for?

@jmid
Copy link
Member

jmid commented Feb 26, 2026

AFAICS, the green workflows install ppxlib.0.35 and pass.
They do so because they respect flags: [ avoid-version ] in ppxlib.0.36.0 and ppxlib.0.36.2.
Older opam 2.0, 2.1, 2.2 don't respect flags: [ avoid-version ] apparently, then install ppxlib.0.36.2 and fail to compile tyxml-ppx.4.6.0. As such, I believe the PR should be closed, as the constraint cannot be relaxed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants