Skip to content

Commit

Permalink
Merge pull request #272 from avsm/fix-406
Browse files Browse the repository at this point in the history
Fix pre-4.07 code generation with stdlib-shims
  • Loading branch information
avsm authored Nov 24, 2019
2 parents cf75247 + e7cdfe5 commit 2dfc521
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
ocaml-version: ${{ matrix.ocaml-version }}
- run: opam pin add -n .
- name: Packages
run: opam depext -yt cstruct cstruct-sexp cstruct-unix cstruct-lwt
run: opam depext -yt cstruct cstruct-sexp cstruct-unix cstruct-lwt ppx_cstruct
- name: Build
run: opam install -t cstruct cstruct-sexp cstruct-unix cstruct-lwt
run: opam install -t cstruct cstruct-sexp cstruct-unix cstruct-lwt ppx_cstruct
async:
name: Async
runs-on: ${{ matrix.operating-system }}
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v5.1.1 2019-11-23
-----------------

This is a point release to fix a regression in 5.1.0
on compilers earlier than 4.07.

The release also fixes the test suite and CI on compilers
greater than 4.07.

v5.1.0 2019-11-23
-----------------

Expand Down
2 changes: 1 addition & 1 deletion ppx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(public_name ppx_cstruct)
(kind ppx_rewriter)
(wrapped false)
(ppx_runtime_libraries cstruct)
(ppx_runtime_libraries cstruct stdlib-shims)
(preprocess
(pps ppx_tools_versioned.metaquot_404))
(libraries sexplib ocaml-migrate-parsetree ppx_tools_versioned
Expand Down
1 change: 1 addition & 0 deletions ppx_cstruct.opam
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ depends: [
"ppx_sexp_conv" {with-test}
"sexplib" {>="v0.9.0"}
"cstruct-sexp" {with-test}
"cppo" {with-test}
"cstruct-unix" {with-test & =version}
"stdlib-shims"
]
Expand Down
2 changes: 2 additions & 0 deletions ppx_test/errors/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(executable
(name pp)
(modules pp)
(preprocess (action
(run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file})))
(libraries
ppx_cstruct
ocaml-migrate-parsetree))
Expand Down
1 change: 1 addition & 0 deletions ppx_test/errors/gen_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let output_stanzas name =

let is_test = function
| "pp.ml" -> false
| "pp.pp.ml" -> false
| "gen_tests.ml" -> false
| e -> Filename.check_suffix e ".ml"

Expand Down
4 changes: 4 additions & 0 deletions ppx_test/errors/pp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
external sys_exit : int -> 'a = "caml_sys_exit"
let () = at_exit (fun () -> sys_exit 0)

#if OCAML_VERSION >= (4,8,0)
let () = Clflags.(error_style := Some Short)
#endif

let () = Migrate_parsetree.Driver.run_main ()

0 comments on commit 2dfc521

Please sign in to comment.