From 8f951068f08b1a8febb4b6df8762f8179d46e8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 11:05:34 +0200 Subject: [PATCH 01/12] Add sexp_of cenum attribute, use sexplib0 The sexp_of_* functions now return Sexplib0.Sexp.t instead of Sexplib.Sexp.t. The cenum attribute [@@sexp_of] is like [@@sexp] except it only produces the sexp_of* function. This allows for generating sexp_of converters without depending on the full sexplib library. --- ppx/ppx_cstruct.ml | 24 ++++++++++++------- ppx_test/with-sexp-of/dune | 11 +++++++++ .../with-sexp-of/ppx_cstruct_and_sexp_of.ml | 6 +++++ 3 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 ppx_test/with-sexp-of/dune create mode 100644 ppx_test/with-sexp-of/ppx_cstruct_and_sexp_of.ml diff --git a/ppx/ppx_cstruct.ml b/ppx/ppx_cstruct.ml index 3525db8..c4b10ad 100644 --- a/ppx/ppx_cstruct.ml +++ b/ppx/ppx_cstruct.ml @@ -392,7 +392,7 @@ type cenum = { name : string Loc.t; fields : (string Loc.t * int64) list; prim : prim; - sexp : bool; + sexp : [ `None | `Sexp_of | `Sexp ]; } let enum_op_name cenum = @@ -429,7 +429,7 @@ let enum_integer ~loc {prim; _} = let declare_enum_expr ~loc ({fields; _} as cenum) = function | Enum_to_sexp -> - [%expr fun x -> Sexplib.Sexp.Atom ([%e Ast.evar ~loc (enum_op_name cenum Enum_print)] x) ] + [%expr fun x -> Sexplib0.Sexp.Atom ([%e Ast.evar ~loc (enum_op_name cenum Enum_print)] x) ] | Enum_of_sexp -> [%expr fun x -> @@ -474,12 +474,15 @@ let enum_ops_for {sexp; _} = Enum_compare :: Enum_print :: Enum_parse :: - if sexp then + match sexp with + | `None -> [] + | `Sexp_of -> + [ Enum_to_sexp ] + | `Sexp -> + [ Enum_to_sexp ; Enum_of_sexp ] - else - [] let enum_type_decl {name; fields; _} = let decls = List.map (fun (f,_) -> Type.constructor f) fields in @@ -508,7 +511,7 @@ let enum_op_type ~loc {name; prim; _} = | Enum_set -> [%type: [%t cty] -> [%t oty]] | Enum_print -> [%type: [%t cty] -> string] | Enum_parse -> [%type: string -> [%t cty] option] - | Enum_to_sexp -> [%type: [%t cty] -> Sexplib.Sexp.t] + | Enum_to_sexp -> [%type: [%t cty] -> Sexplib0.Sexp.t] | Enum_of_sexp -> [%type: Sexplib.Sexp.t -> [%t cty]] | Enum_compare -> [%type: [%t cty] -> [%t cty] -> int] @@ -598,11 +601,14 @@ let cenum decl = in let width, sexp = match attrs with - | ({attr_name = {txt = width; _};attr_payload= PStr [];_}) + | ({attr_name = {txt = width; _};attr_payload= PStr [];_}) :: ({attr_name = {txt = "sexp"; _};attr_payload = PStr []; _}) :: [] -> - width, true + width, `Sexp + | ({attr_name = {txt = width; _};attr_payload= PStr [];_}) + :: ({attr_name = {txt = "sexp_of"; _};attr_payload = PStr []; _}) :: [] -> + width, `Sexp_of | ({attr_name = {txt = width; _};attr_payload= PStr [];_}) :: [] -> - width, false + width, `None | _ -> loc_err loc "invalid cenum attributes" in diff --git a/ppx_test/with-sexp-of/dune b/ppx_test/with-sexp-of/dune new file mode 100644 index 0000000..a096fd3 --- /dev/null +++ b/ppx_test/with-sexp-of/dune @@ -0,0 +1,11 @@ +(executable + (name ppx_cstruct_and_sexp_of) + (preprocess + (pps ppx_cstruct ppx_sexp_conv -- -no-check)) + (libraries cstruct sexplib0 cstruct-sexp)) + +(rule + (alias runtest) + (package ppx_cstruct) + (action + (run ./ppx_cstruct_and_sexp_of.exe))) diff --git a/ppx_test/with-sexp-of/ppx_cstruct_and_sexp_of.ml b/ppx_test/with-sexp-of/ppx_cstruct_and_sexp_of.ml new file mode 100644 index 0000000..6539c84 --- /dev/null +++ b/ppx_test/with-sexp-of/ppx_cstruct_and_sexp_of.ml @@ -0,0 +1,6 @@ +(* inspect output with [dune describe pp ppx_test/with-sexp-of/ppx_cstruct_and_sexp_of.ml] *) +[%%cenum +type enum = + | One [@id 1] + | Three [@id 3] +[@@uint8_t][@@sexp_of]] From e62b27380b52b107b81f61644f267b17b54abaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 11:22:16 +0200 Subject: [PATCH 02/12] cstruct-sexp: use sexplib0 over sexplib --- cstruct-sexp.opam | 3 ++- lib/cstruct_sexp.ml | 13 ++++++++----- lib/cstruct_sexp.mli | 8 ++++---- lib/dune | 2 +- lib_test/dune | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cstruct-sexp.opam b/cstruct-sexp.opam index 3cfbbcd..2dc8a07 100644 --- a/cstruct-sexp.opam +++ b/cstruct-sexp.opam @@ -18,9 +18,10 @@ build: [ depends: [ "ocaml" {>= "4.08.0"} "dune" {>= "2.0.0"} - "sexplib" + "sexplib0" "cstruct" {=version} "alcotest" {with-test} + "sexplib" {with-test} ] synopsis: "S-expression serialisers for C-like structures" description: """ diff --git a/lib/cstruct_sexp.ml b/lib/cstruct_sexp.ml index d3c8def..7e1f917 100644 --- a/lib/cstruct_sexp.ml +++ b/lib/cstruct_sexp.ml @@ -14,21 +14,18 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *) -open Sexplib +open Sexplib0 type buffer = Cstruct.buffer type t = Cstruct.t -let buffer_of_sexp b = Conv.bigstring_of_sexp b -let sexp_of_buffer b = Conv.sexp_of_bigstring b - let t_of_sexp = function | Sexp.Atom str -> let n = String.length str in let t = Cstruct.create_unsafe n in Cstruct.blit_from_string str 0 t 0 n ; t - | sexp -> Conv.of_sexp_error "Cstruct.t_of_sexp: atom needed" sexp + | sexp -> Sexp_conv.of_sexp_error "Cstruct.t_of_sexp: atom needed" sexp let sexp_of_t t = let n = Cstruct.length t in @@ -36,3 +33,9 @@ let sexp_of_t t = Cstruct.blit_to_bytes t 0 str 0 n ; (* The following call is safe, since str is not visible elsewhere. *) Sexp.Atom (Bytes.unsafe_to_string str) + +let buffer_of_sexp b = + (t_of_sexp b).Cstruct.buffer + +let sexp_of_buffer b = + sexp_of_t (Cstruct.of_bigarray b) diff --git a/lib/cstruct_sexp.mli b/lib/cstruct_sexp.mli index 62f2842..cb816b8 100644 --- a/lib/cstruct_sexp.mli +++ b/lib/cstruct_sexp.mli @@ -19,19 +19,19 @@ type buffer = Cstruct.buffer (** [buffer] is an alias for the corresponding {!type:Cstruct.buffer} type *) -val sexp_of_buffer : Cstruct.buffer -> Sexplib.Sexp.t +val sexp_of_buffer : Cstruct.buffer -> Sexplib0.Sexp.t (** [sexp_of_buffer b] returns the s-expression representation of the raw memory buffer [b] *) -val buffer_of_sexp : Sexplib.Sexp.t -> Cstruct.buffer +val buffer_of_sexp : Sexplib0.Sexp.t -> Cstruct.buffer (** [buffer_of_sexp s] returns a fresh memory buffer from the s-expression [s]. [s] should have been constructed using {!sexp_of_buffer}. *) type t = Cstruct.t (** [t] is an alias for the corresponding {!Cstruct.t} type *) -val sexp_of_t : t -> Sexplib.Sexp.t +val sexp_of_t : t -> Sexplib0.Sexp.t (** [sexp_of_t t] returns the s-expression representation of the Cstruct [t] *) -val t_of_sexp : Sexplib.Sexp.t -> t +val t_of_sexp : Sexplib0.Sexp.t -> t (** [t_of_sexp s] returns a fresh {!Cstruct.t} that represents the s-expression previously serialised by {!sexp_of_t}. *) diff --git a/lib/dune b/lib/dune index c1fa1de..cddb67f 100644 --- a/lib/dune +++ b/lib/dune @@ -13,4 +13,4 @@ (name cstruct_sexp) (public_name cstruct-sexp) (modules cstruct_sexp) - (libraries cstruct sexplib)) + (libraries cstruct sexplib0)) diff --git a/lib_test/dune b/lib_test/dune index 16fb7d9..aab3156 100644 --- a/lib_test/dune +++ b/lib_test/dune @@ -1,5 +1,5 @@ (executable - (libraries cstruct alcotest cstruct-sexp) + (libraries cstruct alcotest cstruct-sexp sexplib) (modules bounds tests) (name tests)) From 890772b70034bd9062710665829627436dc7ca30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 11:37:01 +0200 Subject: [PATCH 03/12] ppx_cstruct: use sexplib0 instead of sexplib --- ppx/ppx_cstruct.ml | 8 ++++---- ppx_cstruct.opam | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ppx/ppx_cstruct.ml b/ppx/ppx_cstruct.ml index c4b10ad..46cf06b 100644 --- a/ppx/ppx_cstruct.ml +++ b/ppx/ppx_cstruct.ml @@ -434,12 +434,12 @@ let declare_enum_expr ~loc ({fields; _} as cenum) = function [%expr fun x -> match x with - | Sexplib.Sexp.List _ -> - raise (Sexplib.Pre_sexp.Of_sexp_error (Failure "expected Atom, got List", x)) + | Sexplib0.Sexp.List _ -> + raise (Sexplib0.Sexp.Of_sexp_error (Failure "expected Atom, got List", x)) | Sexplib.Sexp.Atom v -> match [%e Ast.evar ~loc (enum_op_name cenum Enum_parse)] v with | None -> - raise (Sexplib.Pre_sexp.Of_sexp_error (Failure "unable to parse enum string", x)) + raise (Sexplib0.Sexp.Of_sexp_error (Failure "unable to parse enum string", x)) | Some r -> r ] | Enum_get -> @@ -512,7 +512,7 @@ let enum_op_type ~loc {name; prim; _} = | Enum_print -> [%type: [%t cty] -> string] | Enum_parse -> [%type: string -> [%t cty] option] | Enum_to_sexp -> [%type: [%t cty] -> Sexplib0.Sexp.t] - | Enum_of_sexp -> [%type: Sexplib.Sexp.t -> [%t cty]] + | Enum_of_sexp -> [%type: Sexplib0.Sexp.t -> [%t cty]] | Enum_compare -> [%type: [%t cty] -> [%t cty] -> int] let output_enum_sig loc (cenum:cenum) = diff --git a/ppx_cstruct.opam b/ppx_cstruct.opam index 264ad41..06366e1 100644 --- a/ppx_cstruct.opam +++ b/ppx_cstruct.opam @@ -22,12 +22,13 @@ depends: [ "ounit" {with-test} "ppxlib" {>= "0.16.0"} "ppx_sexp_conv" {with-test} - "sexplib" {>="v0.9.0"} + "sexplib0" "cstruct-sexp" {with-test} "cppo" {with-test} "cstruct-unix" {with-test & =version} "ocaml-migrate-parsetree" {>= "2.1.0" & with-test} "lwt_ppx" {>= "2.0.2" & with-test} + "sexplib0" {>="v0.9.0" & with-test} ] synopsis: "Access C-like structures directly from OCaml" description: """ From 20d9b0cb0a555ed51409492affb0c2738f457350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 11:37:25 +0200 Subject: [PATCH 04/12] =?UTF-8?q?CI:=20exclude=20macos=20=C3=97=20ocaml.4.?= =?UTF-8?q?08.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7d0667..e060320 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,9 @@ jobs: matrix: ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest, windows-latest] + exclude: + - operating-system: macos-latest + ocaml-version: '4.08.1' steps: - uses: actions/checkout@v2 - uses: avsm/setup-ocaml@v1 @@ -27,6 +30,9 @@ jobs: matrix: ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest, windows-latest] + exclude: + - operating-system: macos-latest + ocaml-version: '4.08.1' steps: - uses: actions/checkout@v2 - uses: avsm/setup-ocaml@v1 @@ -45,6 +51,9 @@ jobs: matrix: ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest] + exclude: + - operating-system: macos-latest + ocaml-version: '4.08.1' steps: - uses: actions/checkout@v2 - uses: avsm/setup-ocaml@v1 From 67e17d1292b143ee0de51ca9cd9bd467eb367b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 11:41:17 +0200 Subject: [PATCH 05/12] CI: skip entirely macos apparently it's not available at all?! --- .github/workflows/test.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e060320..198f8b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,10 +8,7 @@ jobs: fail-fast: false matrix: ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] - operating-system: [macos-latest, ubuntu-latest, windows-latest] - exclude: - - operating-system: macos-latest - ocaml-version: '4.08.1' + operating-system: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 - uses: avsm/setup-ocaml@v1 @@ -29,10 +26,7 @@ jobs: fail-fast: false matrix: ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] - operating-system: [macos-latest, ubuntu-latest, windows-latest] - exclude: - - operating-system: macos-latest - ocaml-version: '4.08.1' + operating-system: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 - uses: avsm/setup-ocaml@v1 @@ -50,10 +44,7 @@ jobs: fail-fast: false matrix: ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] - operating-system: [macos-latest, ubuntu-latest] - exclude: - - operating-system: macos-latest - ocaml-version: '4.08.1' + operating-system: [ubuntu-latest] steps: - uses: actions/checkout@v2 - uses: avsm/setup-ocaml@v1 From 484bbede826f68342070930c95d29c297c402ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 12:38:31 +0200 Subject: [PATCH 06/12] Fix --- ppx/dune | 2 +- ppx/ppx_cstruct.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ppx/dune b/ppx/dune index c16ee84..98500c5 100644 --- a/ppx/dune +++ b/ppx/dune @@ -6,4 +6,4 @@ (ppx_runtime_libraries cstruct) (preprocess (pps ppxlib.metaquot)) - (libraries sexplib ppxlib)) + (libraries sexplib0 ppxlib)) diff --git a/ppx/ppx_cstruct.ml b/ppx/ppx_cstruct.ml index 46cf06b..defd9c7 100644 --- a/ppx/ppx_cstruct.ml +++ b/ppx/ppx_cstruct.ml @@ -436,7 +436,7 @@ let declare_enum_expr ~loc ({fields; _} as cenum) = function match x with | Sexplib0.Sexp.List _ -> raise (Sexplib0.Sexp.Of_sexp_error (Failure "expected Atom, got List", x)) - | Sexplib.Sexp.Atom v -> + | Sexplib0.Sexp.Atom v -> match [%e Ast.evar ~loc (enum_op_name cenum Enum_parse)] v with | None -> raise (Sexplib0.Sexp.Of_sexp_error (Failure "unable to parse enum string", x)) From 23914033d2150d3f65dbf2d1d5eba42f46c3db29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 12:51:31 +0200 Subject: [PATCH 07/12] More fixes --- ppx_test/basic.ml | 2 +- ppx_test/with-sexp/ppx_cstruct_and_sexp.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ppx_test/basic.ml b/ppx_test/basic.ml index 02131da..e49624f 100644 --- a/ppx_test/basic.ml +++ b/ppx_test/basic.ml @@ -185,7 +185,7 @@ let tests () = assert(get_foo_b be = 44); assert(get_foo_a be = 7); hexdump_foo be; - print_endline (Sexplib.Sexp.to_string_hum (Cstruct_sexp.sexp_of_t be)); + print_endline (Sexplib0.Sexp.to_string_hum (Cstruct_sexp.sexp_of_t be)); hexdump_with_ignored_field (Cstruct.of_hex "010203") let () = tests () diff --git a/ppx_test/with-sexp/ppx_cstruct_and_sexp.ml b/ppx_test/with-sexp/ppx_cstruct_and_sexp.ml index fb88625..ba71d7c 100644 --- a/ppx_test/with-sexp/ppx_cstruct_and_sexp.ml +++ b/ppx_test/with-sexp/ppx_cstruct_and_sexp.ml @@ -2,7 +2,7 @@ magic: uint8_t [@len 16]; }[@@little_endian]] -open Sexplib.Std +open Sexplib0.Sexp_conv type t = int [@@deriving sexp] type bar = { From 3340ea490f0b940bb213fa8b3c99ec432d56132f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 9 Sep 2024 13:00:55 +0200 Subject: [PATCH 08/12] Ahhh more fixes --- ppx_test/dune | 2 +- ppx_test/with-sexp/dune | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ppx_test/dune b/ppx_test/dune index 3f85e8c..d4045d3 100644 --- a/ppx_test/dune +++ b/ppx_test/dune @@ -1,7 +1,7 @@ (tests (names pcap basic enum) (deps http.cap) - (libraries cstruct-unix sexplib cstruct-sexp) + (libraries cstruct-unix sexplib0 cstruct-sexp) (preprocess (pps ppx_cstruct)) (package ppx_cstruct)) diff --git a/ppx_test/with-sexp/dune b/ppx_test/with-sexp/dune index b247296..b252fc4 100644 --- a/ppx_test/with-sexp/dune +++ b/ppx_test/with-sexp/dune @@ -2,7 +2,7 @@ (name ppx_cstruct_and_sexp) (preprocess (pps ppx_cstruct ppx_sexp_conv -- -no-check)) - (libraries cstruct sexplib cstruct-sexp)) + (libraries cstruct sexplib0 cstruct-sexp)) (rule (alias runtest) From ea44d26a5a768ce3e6736cd3d1850118e3f52bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Tue, 10 Sep 2024 11:48:32 +0200 Subject: [PATCH 09/12] Try update CI --- .github/workflows/test.yml | 41 +++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 198f8b6..3415b4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,34 +7,31 @@ jobs: strategy: fail-fast: false matrix: - ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] - operating-system: [ubuntu-latest, windows-latest] + ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] + operating-system: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@v2 - - uses: avsm/setup-ocaml@v1 + - uses: actions/checkout@v4 + - uses: ocaml/setup-ocaml@v3 with: - ocaml-version: ${{ matrix.ocaml-version }} - - run: opam pin add -n . - - name: Packages - run: opam depext -yt cstruct cstruct-sexp cstruct-unix cstruct-lwt + ocaml-compiler: ${{ matrix.ocaml-version }} + - run: opam install . --deps-only --with-test - name: Build - run: opam install -t cstruct cstruct-sexp cstruct-unix cstruct-lwt + run: opam exec -- dune build + - run: opam exec -- dune runtest ppx: name: PPX runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false matrix: - ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] - operating-system: [ubuntu-latest, windows-latest] + ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] + operating-system: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@v2 - - uses: avsm/setup-ocaml@v1 + - uses: actions/checkout@v4 + - uses: ocaml/setup-ocaml@v3 with: - ocaml-version: ${{ matrix.ocaml-version }} + ocaml-compiler: ${{ matrix.ocaml-version }} - run: opam pin add -n . - - name: Packages - run: opam depext -yt ppx_cstruct - name: Build run: opam install -t ppx_cstruct async: @@ -43,15 +40,13 @@ jobs: strategy: fail-fast: false matrix: - ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ] - operating-system: [ubuntu-latest] + ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] + operating-system: [macos-latest, ubuntu-latest] steps: - - uses: actions/checkout@v2 - - uses: avsm/setup-ocaml@v1 + - uses: actions/checkout@v4 + - uses: ocaml/setup-ocaml@v3 with: - ocaml-version: ${{ matrix.ocaml-version }} + ocaml-compiler: ${{ matrix.ocaml-version }} - run: opam pin add -n . - - name: Packages - run: opam depext -yt cstruct-async - name: Dependencies run: opam install -t cstruct-async From 335666b8fda102c4d892c2d36fb19bdcdec4082f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 11 Sep 2024 12:57:42 +0200 Subject: [PATCH 10/12] ppx_cstruct tests depend on ppxlib And no longer ocaml-migrate-parsetree. --- ppx_cstruct.opam | 1 - ppx_test/errors/dune | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ppx_cstruct.opam b/ppx_cstruct.opam index 06366e1..74a7c64 100644 --- a/ppx_cstruct.opam +++ b/ppx_cstruct.opam @@ -26,7 +26,6 @@ depends: [ "cstruct-sexp" {with-test} "cppo" {with-test} "cstruct-unix" {with-test & =version} - "ocaml-migrate-parsetree" {>= "2.1.0" & with-test} "lwt_ppx" {>= "2.0.2" & with-test} "sexplib0" {>="v0.9.0" & with-test} ] diff --git a/ppx_test/errors/dune b/ppx_test/errors/dune index ed51ce0..c9f5831 100644 --- a/ppx_test/errors/dune +++ b/ppx_test/errors/dune @@ -4,7 +4,7 @@ (preprocess (action (run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file}))) - (libraries ppx_cstruct ocaml-migrate-parsetree)) + (libraries ppx_cstruct ppxlib)) (executable (name gen_tests) From c7287d10a444ec4c76e011519ec9f74e2f0ab4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 11 Sep 2024 12:58:10 +0200 Subject: [PATCH 11/12] CI: exclude older compiler versions for macos the macos-latest target seems to be arm64... --- .github/workflows/test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3415b4c..cfae424 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,9 @@ jobs: matrix: ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest, windows-latest] + exclude: + operating-system: macos-latest + ocaml-version: ['4.10.0', '4.08.1'] steps: - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v3 @@ -26,6 +29,9 @@ jobs: matrix: ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest, windows-latest] + exclude: + operating-system: macos-latest + ocaml-version: ['4.10.0', '4.08.1'] steps: - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v3 @@ -42,6 +48,9 @@ jobs: matrix: ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest] + exclude: + operating-system: macos-latest + ocaml-version: ['4.10.0', '4.08.1'] steps: - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v3 From d1a8d575cecb200f9b8f53643d11f333f6c42372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 11 Sep 2024 13:01:38 +0200 Subject: [PATCH 12/12] Fix CI yaml --- .github/workflows/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfae424..2a37012 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,8 +10,8 @@ jobs: ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest, windows-latest] exclude: - operating-system: macos-latest - ocaml-version: ['4.10.0', '4.08.1'] + - operating-system: macos-latest + ocaml-version: ['4.10.0', '4.08.1'] steps: - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v3 @@ -30,8 +30,8 @@ jobs: ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest, windows-latest] exclude: - operating-system: macos-latest - ocaml-version: ['4.10.0', '4.08.1'] + - operating-system: macos-latest + ocaml-version: ['4.10.0', '4.08.1'] steps: - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v3 @@ -49,8 +49,8 @@ jobs: ocaml-version: [ '5', '4', '4.10.0', '4.08.1' ] operating-system: [macos-latest, ubuntu-latest] exclude: - operating-system: macos-latest - ocaml-version: ['4.10.0', '4.08.1'] + - operating-system: macos-latest + ocaml-version: ['4.10.0', '4.08.1'] steps: - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v3