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] grace (0.2.0) #25956

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

johnyob
Copy link
Contributor

@johnyob johnyob commented May 28, 2024

A fancy diagnostics library that allows your compilers to exit with grace

CHANGES:
  • fix(renderer): remove uncessary underlines when printing a unique 'multi-line Top marker' (johnyob/grace#31)
  • fix(renderer): replace unicode chars with ASCII in Config.ascii (johnyob/grace#27)
  • feat(renderer): add NO_COLOR and TERM support to Config (johnyob/grace#8)
  • feat(core,renderer): add support for error codes (johnyob/grace#30)
  • feat(renderer): add support for UTF8 encoding 🚀 (johnyob/grace#25)
  • feat(renderer): re-introduce support for compact diagnostic rendering (johnyob/grace#28)
  • refactor(renderer)!: move grace.renderer library to grace.ansi_renderer (johnyob/grace#29)

BREAKING CHANGE

  • Grace_rendering has been removed. Use Grace_ansi_renderer instead.

@shonfeder
Copy link
Collaborator

Hi! :)

Expect tests are failing of OCaml 5.2:

# +[@@expect.uncaught_exn {|
# +  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
# +     This is strongly discouraged as backtraces are fragile.
# +     Please change this test to not include a backtrace. *)
# +
# +  (Invalid_argument "Format.pp_set_geometry: margin >= pp_infinity")
# +  Raised at Stdlib__Format.pp_set_geometry in file "format.ml", line 844, characters 4-63
# +  Called from Grace_ansi_renderer__Snippet_renderer.pp_snippet in file "lib/ansi_renderer/snippet_renderer.ml", line 702, characters 2-64
# +  Called from Test_ansi_renderer.pr_diagnostics.(fun) in file "test/ansi_renderer/test_ansi_renderer.ml", line 21, characters 8-47
# +  Called from Stdlib__List.iter in file "list.ml", line 112, characters 12-15
# +  Called from Test_ansi_renderer.(fun) in file "test/ansi_renderer/test_ansi_renderer.ml", line 118, characters 2-28
# +  Called from Expect_test_collector.Make.Instance_io.exec in file "collector/expect_test_collector.ml", line 234, characters 12-19 |}]
#  ;;

The expected output looks great, btw! Do you think you'll be able to get 5.2 compatibility?

@johnyob
Copy link
Contributor Author

johnyob commented May 30, 2024

Seems like a breaking change in Format introduced in OCaml 5.2. Will fix (using ppx_optcomp) to use Format.pp_infinity - 1 in OCaml 5.2 (and above) and then re-release

CHANGES:

* fix(renderer): remove uncessary underlines when printing a unique 'multi-line `Top` marker' ([johnyob/grace#31](johnyob/grace#31))
* fix(renderer): replace unicode chars with ASCII in `Config.ascii` ([johnyob/grace#27](johnyob/grace#27))
* feat(renderer): add `NO_COLOR` and `TERM` support to `Config` ([johnyob/grace#8](johnyob/grace#8))
* feat(core,renderer): add support for error codes ([johnyob/grace#30](johnyob/grace#30))
* feat(renderer): add support for UTF8 encoding 🚀 ([johnyob/grace#25](johnyob/grace#25))
* feat(renderer): re-introduce support for compact diagnostic rendering ([johnyob/grace#28](johnyob/grace#28))
* refactor(renderer)!: move `grace.renderer` library to `grace.ansi_renderer` ([johnyob/grace#29](johnyob/grace#29))

### BREAKING CHANGE

* `Grace_rendering` has been removed. Use `Grace_ansi_renderer` instead.
@johnyob
Copy link
Contributor Author

johnyob commented May 30, 2024

I've re-released (with a green run on my own CI (which now tests OCaml 5.2) https://github.com/johnyob/grace/actions/runs/9308056494). Hopefully this should pass opam-ci 🤞

@johnyob
Copy link
Contributor Author

johnyob commented May 31, 2024

@shonfeder seems like CI failed due to issues with bin_prot, any ideas?

@shonfeder
Copy link
Collaborator

Here are the errors, for reference:

On OpenSUSE with OCaml 5.2 we have

#=== ERROR while compiling bin_prot.v0.17.0 ===================================#
# context              2.2.0~beta3~dev | linux/x86_64 | ocaml-base-compiler.5.2.0 | file:///home/opam/opam-repository
# path                 ~/.opam/5.2/.opam-switch/build/bin_prot.v0.17.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p bin_prot -j 255
# exit-code            1
# env-file             ~/.opam/log/bin_prot-7-1d174a.env
# output-file          ~/.opam/log/bin_prot-7-1d174a.out
### output ###
# (cd _build/default/xen && /usr/bin/bash -e -u -o pipefail -c './cflags.sh > cflags.sexp')
# Package mirage-xen was not found in the pkg-config search path.
# Perhaps you should add the directory containing `mirage-xen.pc'
# to the PKG_CONFIG_PATH environment variable
# No package 'mirage-xen' found
# File "xen/dune", line 8, characters 0-215:
#  8 | (library
#  9 |  (foreign_stubs
# 10 |   (language c)
# 11 |   (flags
# 12 |    (:include cflags.sexp)))
# 13 |  (name bin_prot_xen)
# 14 |  (public_name bin_prot.xen)
# 15 |  (optional)
# 16 |  (virtual_deps mirage-xen-ocaml)
# 17 |  (libraries)
# 18 |  (preprocess no_preprocessing))
# (cd _build/default && /home/opam/.opam/5.2/bin/ocamlmklib -g -o xen/bin_prot_xen_stubs xen/blit_stubs.o)
# /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: xen/blit_stubs.o: warning: relocation against `caml_leave_blocking_section' in read-only section `.text'
# /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: xen/blit_stubs.o: relocation R_X86_64_PC32 against symbol `memcpy@@GLIBC_2.14' can not be used when making a shared object; recompile with -fPIC
# /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: final link failed: bad value
# collect2: error: ld returned 1 exit status


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build bin_prot v0.17.0
+-

And on FreeBSD with OCaml 5.2

#=== ERROR while compiling bin_prot.v0.17.0 ===================================#
# context              2.2.0~beta3~dev | freebsd/x86_64 | ocaml-base-compiler.5.2.0 | file:///home/opam/opam-repository
# path                 ~/.opam/5.2.0/.opam-switch/build/bin_prot.v0.17.0
# command              ~/.opam/5.2.0/bin/dune build -p bin_prot -j 15
# exit-code            1
# env-file             ~/.opam/log/bin_prot-54960-fb980c.env
# output-file          ~/.opam/log/bin_prot-54960-fb980c.out
### output ###
# File "xen/dune", line 1, characters 0-111:
# 1 | (rule
# 2 |  (targets cflags.sexp)
# 3 |  (deps
# 4 |   (:first_dep cflags.sh))
# 5 |  (action
# 6 |   (bash "./%{first_dep} > %{targets}")))
# (cd _build/default/xen && /usr/local/bin/bash -e -u -o pipefail -c './cflags.sh > cflags.sexp')
# /usr/local/bin/bash: line 1: ./cflags.sh: cannot execute: required file not found



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build bin_prot v0.17.0

@shonfeder
Copy link
Collaborator

shonfeder commented Jun 1, 2024

You're inheriting bin_prot from core's dependency on it, and the most recent release of core in https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/5d4264ba7c374fec017fae14707f1809bea0669a is also failing on this dependency on the exact same platforms: #25957 (comment)

I've reported the issue with bin_prot here #26005 and upstream.

This LGTM and I'm recommending it for merge. Thanks :)

@mseri
Copy link
Member

mseri commented Jun 3, 2024

The issue is indeed independent of this. Thanks!

@mseri mseri merged commit 32b4b1f into ocaml:master Jun 3, 2024
1 of 2 checks passed
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