Skip to content

[new release] elpi (3.5.0)#29470

Closed
gares wants to merge 1 commit intoocaml:masterfrom
gares:release-elpi-v3.5.0
Closed

[new release] elpi (3.5.0)#29470
gares wants to merge 1 commit intoocaml:masterfrom
gares:release-elpi-v3.5.0

Conversation

@gares
Copy link
Contributor

@gares gares commented Feb 26, 2026

ELPI - Embeddable λProlog Interpreter

CHANGES:

Requires Menhir 20211230 and OCaml 4.14 or above on Linux, Windows and
MacOS 14 (Sonoma). MacOS 15 (Sequoia) and later require OCaml 5.4.

  • Typechecker:

    • Change: disallow undeclared data constructors and predicates
  • Compiler:

    • New allow builtins to be declared in extension units (not just in the
      base)
  • Typechecker:

    • Fix error messages when there is an arity mismatch, i.e. suggest some
      arguments may be missing
    • Change symbols without a declared signature raise a fatal error. Only
      undeclared predicates are tolerated, and only when the inferred type is
      unambiguously prop

CHANGES:

Requires Menhir 20211230 and OCaml 4.14 or above on Linux, Windows and
MacOS 14 (Sonoma). MacOS 15 (Sequoia) and later require OCaml 5.4.

- Typechecker:
  - Change: disallow undeclared data constructors and predicates

- Compiler:
  - New allow builtins to be declared in extension units (not just in the
    base)

- Typechecker:
  - Fix error messages when there is an arity mismatch, i.e. suggest some
    arguments may be missing
  - Change symbols without a declared signature raise a fatal error. Only
    undeclared predicates are tolerated, and only when the inferred type is
    unambiguously `prop`
@raphael-proust
Copy link
Contributor

4.14.2 on arm64 error:

#=== ERROR while compiling elpi.3.5.0 =========================================#
# context              2.5.0 | linux/arm64 | ocaml-base-compiler.4.14.2 | pinned(https://github.com/LPCIC/elpi/releases/download/v3.5.0/elpi-3.5.0.tbz)
# path                 ~/.opam/4.14/.opam-switch/build/elpi.3.5.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build make tests DUNE_OPTS=-p elpi SKIP=performance_HO SKIP+=performance_FO SKIP+=elpi_api_performance
# exit-code            2
# env-file             ~/.opam/log/elpi-7-0744e2.env
# output-file          ~/.opam/log/elpi-7-0744e2.out
### output ###
# make build
# make[1]: Entering directory '/home/opam/.opam/4.14/.opam-switch/build/elpi.3.5.0'
# dune build -p elpi @all
# make[1]: Leaving directory '/home/opam/.opam/4.14/.opam-switch/build/elpi.3.5.0'
# dune runtest
# File "src/parser/.elpi_parser.objs/native/_unknown_", line 1, characters 0-0:
# (cd _build/default && /home/opam/.opam/4.14/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -w -9 -w -27 -warn-error -A -g -I src/parser/.elpi_parser.objs/byte -I src/parser/.elpi_parser.objs/native -I /home/opam/.opam/4.14/lib/menhirLib -I /home/opam/.opam/4.14/lib/ppx_deriving/runtime -I /home/opam/.opam/4.14/lib/re -I /home/opam/.opam/4.14/lib/re/str -I /home/opam/.opam/4.14/lib/stdlib-shims -I src/parser/.elpi_lexer_config.objs/byte -I src/parser/.elpi_lexer_config.objs/native -I src/utils/.elpi_util.objs/byte -I src/utils/.elpi_util.objs/native -intf-suffix .ml -no-alias-deps -opaque -open Elpi_parser -o src/parser/.elpi_parser.objs/native/elpi_parser__Grammar.cmx -c -impl src/parser/grammar.ml)
# /opam-tmp/build_809c18_dune/camlasm3ff1a2.s: Assembler messages:
# /opam-tmp/build_809c18_dune/camlasm3ff1a2.s:151445: Error: conditional branch out of range
# File "src/parser/grammar.ml", line 1:
# Error: Assembler error, input left in file /opam-tmp/build_809c18_dune/camlasm3ff1a2.s
# make: *** [Makefile:86: tests] Error 1

It doesn't seem like your grammar.mly is particularly big. I guess potentially the inlines might cause some code-size explosion?

I made ocaml/ocaml#14599 to report the error upstream.

@xavierleroy
Copy link
Contributor

This is an OCaml 4 bug, indeed. It's fixed in the 4.14 branch.

In the meantime, one way to avoid this bug (which only happens with very large functions) could be to use the "table" mode of Menhir instead of the default "code" mode. (menhir --table). For medium-size to large language grammars, the table mode generates much smaller OCaml code, while remaining quite fast.

@avsm
Copy link
Member

avsm commented Feb 28, 2026

Just noting here that the fix will be in 4.14.4 (it missed the 4.14.3 window, and the CI is still on 4.14.2 due to slightly older base images). Would you like to spin a new release @gares to follow Xavier's suggestion above, or just go ahead and merge this as it only affects the 4.14.x branch on arm64 and will be fixed in due time as the next minor release gets put out?

@avsm avsm added the question label Feb 28, 2026
@xavierleroy
Copy link
Contributor

All the options proposed by Anil are valid. I'll add one: put a constraint "ocaml >= 4.14.4" so that this new version of ELPI cannot be used with OCaml 4.14 until a minor version that fixes the issue reported here is released.

@gares
Copy link
Contributor Author

gares commented Mar 1, 2026

Thanks for the suggestions, I'll bump the constraint.

I think I did see assembler-related failures in my CI also for the 5.x series, up to 5.3, on osx (see the first paragraph in the release notes). Here an example: https://github.com/LPCIC/elpi/actions/runs/22354111742/job/64688762944
So my conclusion was to not run CI on osx for 4.14 and only on 5.4. Note that it was working fine, but I believe github images got bumped, and that broke it.

@gares
Copy link
Contributor Author

gares commented Mar 1, 2026

Thanks for the suggestions, I'll bump the constraint.

I changed my mind, I have 3.6 in the pipeline and I'll sneak in the --table option. (and close this PR)

@gares gares closed this Mar 2, 2026
@gares gares deleted the release-elpi-v3.5.0 branch March 2, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants