Skip to content

Package sedlex.3.5#27959

Closed
toots wants to merge 2 commits intoocaml:masterfrom
toots:opam-publish-sedlex.3.5
Closed

Package sedlex.3.5#27959
toots wants to merge 2 commits intoocaml:masterfrom
toots:opam-publish-sedlex.3.5

Conversation

@toots
Copy link
Contributor

@toots toots commented May 30, 2025

sedlex.3.5

An OCaml lexer generator for Unicode
sedlex is a lexer generator for OCaml. It is similar to ocamllex, but supports
Unicode. Unlike ocamllex, sedlex allows lexer specifications within regular
OCaml source files. Lexing specific constructs are provided via a ppx syntax
extension.



🐫 Pull-request generated by opam-publish v2.5.0

@mseri
Copy link
Member

mseri commented May 30, 2025

The following seem to be a new failures in the revdeps. Can you please have a look?

#=== ERROR while compiling ppx_css.v0.16.0 ====================================#
# context              2.3.0 | linux/x86_64 | ocaml-base-compiler.4.14.2 | file:///home/opam/opam-repository
# path                 ~/.opam/4.14/.opam-switch/build/ppx_css.v0.16.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_css -j 31
# exit-code            1
# env-file             ~/.opam/log/ppx_css-7-f6fdb9.env
# output-file          ~/.opam/log/ppx_css-7-f6fdb9.out
### output ###
# (cd _build/default && .ppx/6c6fd9e18b06fcb8edd0b30764292ddb/ppx.exe --cookie 'library-name="css_parser"' -o vendor/css_parser/src/lexer.pp.ml --impl vendor/css_parser/src/lexer.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "vendor/css_parser/src/lexer.ml", line 93, characters 33-49:
# 93 | let non_ascii = [%sedlex.regexp? '\160' .. '\255']
#                                       ^^^^^^^^^^^^^^^^
# Error: Sedlex: this pattern is not a valid ASCII interval regexp
#=== ERROR while compiling fstar.2025.03.25 ===================================#
# context              2.3.0 | linux/x86_64 | ocaml-base-compiler.4.14.2 | file:///home/opam/opam-repository
# path                 ~/.opam/4.14/.opam-switch/build/fstar.2025.03.25
# command              ~/.opam/opam-init/hooks/sandbox.sh build make -j 71 ADMIT=1
# exit-code            2
# env-file             ~/.opam/log/fstar-7-e0e5e7.env
# output-file          ~/.opam/log/fstar-7-e0e5e7.out
### output ###
#   STAGE 0          
#    DUNE BUILD      
#    INSTALL LIB SRC  
# (cd _build/.sandbox/7a77e5ba3510b15597c2e930948346ea/default && /home/opam/.opam/4.14/bin/menhir fstar-guts/FStarC_Parser_Parse.mly --base fstar-guts/FStarC_Parser_Parse --infer-write-query fstar-guts/FStarC_Parser_Parse__mock.ml.mock)
# File "fstar-guts/FStarC_Parser_Parse.mly", line 126, characters 60-70:
# Warning: the token LBRACK_BAR is unused.
# File "fstar-guts/FStarC_Parser_Parse.mly", line 324, characters 0-15:
# Warning: symbol decoratableDecl is unreachable from any of the start symbol(s).
# File "fstar-guts/FStarC_Parser_Parse.mly", line 307, characters 0-16:
# Warning: symbol noDecorationDecl is unreachable from any of the start symbol(s).
# (cd _build/.sandbox/574c0913d31d8503e2299ea99929a286/default && .ppx/4f1e2aad43ee1c541e03351a582d3904/ppx.exe --cookie 'library-name="fstarcompiler"' -o fstar-guts/ml/FStarC_Parser_LexFStar.pp.ml --impl fstar-guts/ml/FStarC_Parser_LexFStar.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "fstar-guts/ml/FStarC_Parser_LexFStar.ml", line 515, characters 3-8:
# 515 |  | "∃", Plus op_char ->
#          ^^^^^
# Error: Sedlex: Malformed ASCII string
# (cd _build/.sandbox/71dc11444380c164d0222f99bdf8801b/default && /home/opam/.opam/4.14/bin/menhir fstar-guts/FStarC_Parser_Parse.mly --base fstar-guts/FStarC_Parser_Parse --infer-read-reply fstar-guts/FStarC_Parser_Parse__mock.mli.inferred)
# Warning: 20 states have shift/reduce conflicts.
# Warning: 305 shift/reduce conflicts were arbitrarily resolved.
# Warning: 232 end-of-stream conflicts were arbitrarily resolved.
# make[1]: *** [Makefile:43: build] Error 1
# make: *** [Makefile:73: stage0/out/bin/fstar.exe] Error 2

@toots
Copy link
Contributor Author

toots commented May 30, 2025

Thanks for pointing those out. We have added new checks for encodings in pattern matching and it looks like those two errors are legit. I'm gonna put a version upper-bound for those dependencies. cc/ @hhugo

@toots
Copy link
Contributor Author

toots commented May 30, 2025

Actually let me see if we should change some of this: https://github.com/ocaml-community/sedlex/pull/127/files#r2115965034

@hhugo
Copy link
Contributor

hhugo commented May 31, 2025

I think we should add constraint for ppx_css 0.15,0.16 and 0.17 because their use of sedlex is suspicious. It was fixed on master.

I suspect the fstar failure is just exposing a bug but I need to confirm this.

I need to check the owi failure

Styled-ppx is similar to ppx_css but is not fixed upstream.

@toots
Copy link
Contributor Author

toots commented May 31, 2025

I think we should add constraint for ppx_css 0.15,0.16 and 0.17 because their use of sedlex is suspicious. It was fixed on master.

I suspect the fstar failure is just exposing a bug but I need to confirm this.

I need to check the owi failure

Styled-ppx is similar to ppx_css but is not fixed upstream.

I started doing the version limitation but realized that, if the behavior we're flagging as erroneous now used to work we should instead update our changes to be backward-compatible.

@hhugo
Copy link
Contributor

hhugo commented May 31, 2025

For ppx_css styled_css and fstar, it used to compile but was not doing the right thing I claim.

@toots
Copy link
Contributor Author

toots commented Jun 1, 2025

Ok I can confirm that "∃" was not a working pattern. I'll add the version restrictions.

@hhugo
Copy link
Contributor

hhugo commented Jun 2, 2025

FStarLang/FStar#3860 fixes Fstar

@hhugo
Copy link
Contributor

hhugo commented Jun 2, 2025

styled-ppx fix in davesnx/styled-ppx#555

@mseri
Copy link
Member

mseri commented Jun 2, 2025

Thanks a lot. One last thing and we can merge.
Can you have a look if this is an issue in the new version?


#=== ERROR while compiling owi.0.1 ============================================#
# context              2.3.0 | linux/x86_64 | ocaml-base-compiler.4.14.2 | file:///home/opam/opam-repository
# path                 ~/.opam/4.14/.opam-switch/build/owi.0.1
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p owi -j 255 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/owi-7-99beb9.env
# output-file          ~/.opam/log/owi-7-99beb9.out
### output ###
# File "test/dune", line 2, characters 7-11:
# 2 |  (name main)
#            ^^^^
# (cd _build/default/test && ./main.exe)
# testing directory: `passing`
# testing file     : `passing/42.wast`... OK !
# testing file     : `passing/duplicated_mod_name.wast`... OK !
# testing file     : `passing/duplicated_register.wast`... OK !
# testing file     : `passing/elem.wast`... OK !
[...]
# testing file     : `reference/memory_trap.wast`... OK !
# testing file     : `reference/names.wast`... Fatal error: exception Sedlexing.MalFormed

@hhugo
Copy link
Contributor

hhugo commented Jun 2, 2025

@toots, the owi error is caused by ocaml-community/sedlex#168.

@hhugo
Copy link
Contributor

hhugo commented Jun 2, 2025

The owi runtest error is also present on the main branch

@hhugo
Copy link
Contributor

hhugo commented Jun 2, 2025

https://github.com/WebAssembly/testsuite/blob/main/names.wast is the file responsible for the failure.

@hhugo
Copy link
Contributor

hhugo commented Jun 2, 2025

There my be a bug in ocaml-community/sedlex#168

@hhugo
Copy link
Contributor

hhugo commented Jun 2, 2025

sedlex fix in ocaml-community/sedlex#171

@toots
Copy link
Contributor Author

toots commented Jun 3, 2025

I think that we should do another release with the new fix. @hhugo do you have another concern w.r.t. to the current code base?

@hhugo
Copy link
Contributor

hhugo commented Jun 3, 2025

I think that we should do another release with the new fix. @hhugo do you have another concern w.r.t. to the current code base?

sounds good.

@toots toots closed this Jun 5, 2025
@toots toots deleted the opam-publish-sedlex.3.5 branch June 5, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants