Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new release] ppx_deriving_yaml (0.2.2) #25040

Conversation

patricoferris
Copy link
Contributor

CHANGES:

 - Embed errors in the AST (patricoferris/ppx_deriving_yaml#51, @patricoferris and special thanks to @panglesd
   for the detailed issue in patricoferris/ppx_deriving_yaml#48)
@mseri
Copy link
Member

mseri commented Jan 10, 2024

Are the test failures on bytecode-only compilers expected?
https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/39d4a56c83e6d31ded687f77734bf5ef184271d3

@patricoferris
Copy link
Contributor Author

Hmm thanks for the info @mseri -- I didn't realise that's what distinguished those compilers. I tried locally with something like:

opam switch create 5.1.0-bytes --packages=ocaml-variants.5.1.0+options,ocaml-option-bytecode-only

And then trying to install and run the tests, but can't make cmdliner happy for some reason. Just posting here in case this has come up before maybe ?

➜  ppx_deriving_yaml git:(main) opam install alcotest
Constructing initial basis...
Number of 0-1 knapsack inequalities = 649
Constructing conflict graph...
Conflict graph has 255 + 103 = 358 vertices
The following actions will be performed:
  ∗ install   cmdliner 1.2.0 [required by alcotest]
  ∗ install   uutf     1.0.3 [required by alcotest]
  ↻ recompile fmt      0.9.0 [uses cmdliner]
  ∗ install   alcotest 1.7.0
  ↻ recompile logs     0.7.0 [uses cmdliner]
  ↻ recompile bos      0.2.1 [uses fmt]
  ↻ recompile yaml     3.2.0 [uses bos]
===== ∗ 3   ↻ 4 =====
Do you want to continue? [Y/n] Y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
⬇ retrieved bos.0.2.1  (cached)
⬇ retrieved cmdliner.1.2.0  (cached)
⬇ retrieved logs.0.7.0  (cached)
⬇ retrieved fmt.0.9.0  (cached)
⬇ retrieved uutf.1.0.3  (cached)
⬇ retrieved alcotest.1.7.0  (cached)
⬇ retrieved yaml.3.2.0  (cached)
⊘ removed   yaml.3.2.0
⊘ removed   bos.0.2.1
⊘ removed   logs.0.7.0
⊘ removed   fmt.0.9.0
∗ installed cmdliner.1.2.0
[ERROR] The compilation of uutf.1.0.3 failed at "ocaml pkg/pkg.ml build --dev-pkg false --with-cmdliner true".
[ERROR] The compilation of fmt.0.9.0 failed at "ocaml pkg/pkg.ml build --dev-pkg false --with-base-unix true --with-cmdliner true".

#=== ERROR while compiling uutf.1.0.3 =========================================#
# context     2.1.3 | macos/arm64 | ocaml-option-bytecode-only.1 ocaml-variants.5.1.0+options | https://opam.ocaml.org#e0d5a913
# path        ~/.opam/5.1.0-bytes/.opam-switch/build/uutf.1.0.3
# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --dev-pkg false --with-cmdliner true
# exit-code   1
# env-file    ~/.opam/log/uutf-70702-d41ee3.env
# output-file ~/.opam/log/uutf-70702-d41ee3.out
### output ###
# [...]
# ocamlfind ocamldep -package unix -package cmdliner -modules test/utftrip.ml > test/utftrip.ml.depends
# ocamlfind ocamlc -c -g -bin-annot -safe-string -package unix -package cmdliner -I test -I src -o test/utftrip.cmo test/utftrip.ml
# + ocamlfind ocamlc -c -g -bin-annot -safe-string -package unix -package cmdliner -I test -I src -o test/utftrip.cmo test/utftrip.ml
# File "test/utftrip.ml", line 1:
# Error: /Users/patrickferris/.opam/5.1.0-bytes/lib/cmdliner/cmdliner.cmi
#        is not a compiled interface for this version of OCaml.
# It seems to be for an older version of OCaml.
# Command exited with code 2.
# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'
#      '-build-dir' '_build' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md'
#      'README.md' 'src/uutf.cma' 'src/uutf.cmi' 'src/uutf.mli'
#      'test/utftrip.byte']: exited with 10


#=== ERROR while compiling fmt.0.9.0 ==========================================#
# context     2.1.3 | macos/arm64 | ocaml-option-bytecode-only.1 ocaml-variants.5.1.0+options | https://opam.ocaml.org#e0d5a913
# path        ~/.opam/5.1.0-bytes/.opam-switch/build/fmt.0.9.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --dev-pkg false --with-base-unix true --with-cmdliner true
# exit-code   1
# env-file    ~/.opam/log/fmt-70702-a9dd12.env
# output-file ~/.opam/log/fmt-70702-a9dd12.out
### output ###
# [...]
# ocamlfind ocamlc -c -g -bin-annot -safe-string -package cmdliner -I src -I test -o src/fmt_cli.cmi src/fmt_cli.mli
# + ocamlfind ocamlc -c -g -bin-annot -safe-string -package cmdliner -I src -I test -o src/fmt_cli.cmi src/fmt_cli.mli
# File "src/fmt_cli.mli", line 1:
# Error: /Users/patrickferris/.opam/5.1.0-bytes/lib/cmdliner/cmdliner.cmi
#        is not a compiled interface for this version of OCaml.
# It seems to be for an older version of OCaml.
# Command exited with code 2.
# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'
#      '-build-dir' '_build' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md'
#      'README.md' 'src/fmt.cma' 'src/fmt.cmi' 'src/fmt.mli' 'src/fmt_tty.cma'
#      'src/fmt_tty.cmi' 'src/fmt_tty.mli' 'src/fmt_cli.cma' 'src/fmt_cli.cmi'
#      'src/fmt_cli.mli' 'src/fmt_top.cma' 'src/fmt_tty_top_init.ml']: exited with 10



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build fmt  0.9.0
│ λ build uutf 1.0.3
└─ 
┌─ The following changes have been performed (the rest was aborted)
│ ⊘ remove  bos      0.2.1
│ ⊘ remove  fmt      0.9.0
│ ⊘ remove  logs     0.7.0
│ ⊘ remove  yaml     3.2.0
│ ∗ install cmdliner 1.2.0
└─ 

@patricoferris
Copy link
Contributor Author

Blergh! Nevermind, a rogue ~/.opam/4.14.0/bin was in my path and that was probably providing an ocamlopt and then later something was using ocamlc from ~/.opam/5.1.0-bytes/bin or something along those lines. Sorry for the noise.

@patricoferris
Copy link
Contributor Author

Hmm yeh this reproduces the problem -- something up with bytecode only toplevels getting ppxes. You see it just using ocaml and #require "ppx_deriving_{yaml,yojson, etc.}" and then trying to use it. Same in utop as well.

"ocaml" {>= "4.08.1"}
"ppxlib" {>= "0.25.0"}
"odoc" {with-doc}
]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
]
]
conflicts: [
"ocaml-option-bytecode-only"
]

For the moment we could solve it this way and release. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even if it is only the MDX based tests that are failing, I wonder if I can do some dune magic to disable them if it detects byte code. Thanks for the help so far, I'll get back to you shortly :))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the patience @mseri -- I've re-released 0.2.2 over at #25072 where hopefully I have some dune checks to disable byte code MDX tests. Thanks for the help in getting a good release into opam, let's hope the tests are all green !

@patricoferris patricoferris deleted the release-ppx_deriving_yaml-v0.2.2 branch January 13, 2024 15:40
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.

None yet

2 participants