Skip to content

[new release] ppx_deriving_yaml (2 packages) (0.4.1) #28052

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patricoferris
Copy link
Contributor

@patricoferris patricoferris commented Jun 20, 2025

@mseri
Copy link
Member

mseri commented Jun 21, 2025

Are those failures on 32 bit systems something to worry about?

#=== ERROR while compiling ppx_deriving_ezjsonm.0.4.1 =========================#
# context              2.3.0 | linux/arm32 | ocaml-base-compiler.5.3.0 | pinned(https://github.com/patricoferris/ppx_deriving_yaml/releases/download/v0.4.1/ppx_deriving_yaml-0.4.1.tbz)
# path                 ~/.opam/5.3/.opam-switch/build/ppx_deriving_ezjsonm.0.4.1
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_deriving_ezjsonm -j 79 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/ppx_deriving_ezjsonm-7-755365.env
# output-file          ~/.opam/log/ppx_deriving_ezjsonm-7-755365.out
### output ###
# File "src/ezjsonm/index.mld", line 1, characters 0-0:
# /usr/bin/git --no-pager diff --no-index --color=always -u _build/default/src/ezjsonm/index.mld _build/default/src/ezjsonm/.mdx/index.mld.corrected
# diff --git a/_build/default/src/ezjsonm/index.mld b/_build/default/src/ezjsonm/.mdx/index.mld.corrected
# index fb21778..e499472 100644
# --- a/_build/default/src/ezjsonm/index.mld
# +++ b/_build/default/src/ezjsonm/.mdx/index.mld.corrected
# @@ -39,13 +39,8 @@ by a single hyphen.
#      }[@@deriving ezjsonm]
#      let set_name t name = { t with name }
#    end;;
# -module Person :
# -  sig
# -    type t
# -    val to_ezjsonm : t -> Ezjsonm.value
# -    val of_ezjsonm : Ezjsonm.value -> (t, [> `Msg of string ]) result
# -    val set_name : t -> string -> t
# -  end
# +Line 8, characters 18-25:
# +Error: Cannot locate deriver ezjsonm
#  ]}
#  
#  You can then use these functions in conjunction with the {! Ezjsonm} libary to read, manipulate
# @@ -57,14 +52,16 @@ val raw_json : string = "{\"name\": \"Alice\", \"age\": 42 }"
#  # let p = Ezjsonm.value_from_string raw_json 
#    |> Person.of_ezjsonm
#    |> Result.get_ok;;
# -val p : Person.t = <abstr>
# +Line 2, characters 6-23:
# +Error: Unbound module Person
#  ]}
#  
#  Then we change the name of the person and convert back to JSON.
#  
#  {@ocaml[
#  # Person.set_name p "Bob" |> Person.to_ezjsonm |> Ezjsonm.value_to_string;;
# -- : string = "{\"name\":\"Bob\",\"age\":42}"
# +Line 1, characters 28-45:
# +Error: Unbound module Person
#  ]}
#  
#  {2 Attributes}
ppx_deriving_yaml
#=== ERROR while compiling ppx_deriving_yaml.0.4.1 ============================#
# context              2.3.0 | linux/arm32 | ocaml-base-compiler.5.3.0 | pinned(https://github.com/patricoferris/ppx_deriving_yaml/releases/download/v0.4.1/ppx_deriving_yaml-0.4.1.tbz)
# path                 ~/.opam/5.3/.opam-switch/build/ppx_deriving_yaml.0.4.1
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_deriving_yaml -j 79 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/ppx_deriving_yaml-7-62a8be.env
# output-file          ~/.opam/log/ppx_deriving_yaml-7-62a8be.out
### output ###
# (cd _build/default/test && ./test.exe)
# Testing `ppx_deriving_yaml'.
# This run has ID `6SBMQ2SO'.
# 
#   [OK]          ppx          0   test_primitives.
#   [OK]          ppx          1   test_record_list.
#   [OK]          ppx          2   test_tuple.
#   [OK]          ppx          3   test_simple_poly.
#   [OK]          ppx          4   test_var.
#   [OK]          ppx          5   test_poly_variants.
#   [OK]          ppx          6   test_attrib.
#   [OK]          ppx          7   test_unknown.
#   [OK]          ppx          8   test_recursive.
# 
# Full test results in `~/.opam/5.3/.opam-switch/build/ppx_deriving_yaml.0.4.1/_build/default/test/_build/_tests/ppx_deriving_yaml'.
# Test Successful in 0.002s. 9 tests run.
# File "src/yaml/index.mld", line 1, characters 0-0:
# /usr/bin/git --no-pager diff --no-index --color=always -u _build/default/src/yaml/index.mld _build/default/src/yaml/.mdx/index.mld.corrected
# diff --git a/_build/default/src/yaml/index.mld b/_build/default/src/yaml/.mdx/index.mld.corrected
# index 1bc6e0c..c86f24f 100644
# --- a/_build/default/src/yaml/index.mld
# +++ b/_build/default/src/yaml/.mdx/index.mld.corrected
# @@ -28,22 +28,22 @@ Here is a small example.
#  {@ocaml[
#  type person = { name : string; age : int } [@@deriving yaml]
#  type users = person list [@@deriving yaml]
# -]}
# +][
# +{err@mdx-error[
# +Line 1, characters 56-60:
# +Error: Cannot locate deriver yaml
# +]err}]}
#  
#  This will produce four functions, a [_to_yaml] and [_of_yaml] for both a person and
#  the users. For example:
#  
#  {@ocaml[
#  # person_to_yaml;;
# -- : person ->
# -    [> `O of (string * [> `Float of float | `String of string ]) list ]
# -= <fun>
# +Line 1, characters 1-15:
# +Error: Unbound value person_to_yaml
#  # users_of_yaml;;
# -- : [> `A of
# -         [> `O of (string * [> `Float of float | `String of string ]) list ]
# -         list ] ->
# -    (person list, [> `Msg of string ]) result
# -= <fun>
# +Line 1, characters 1-14:
# +Error: Unbound value users_of_yaml
#  ]}
#  
#  If your type constructors have arguments, then the functions will be
# @@ -52,22 +52,26 @@ constructor argument. For example:
#  
#  {@ocaml[
#  type 'a note = { txt : 'a } [@@deriving yaml]
# -]}
# +][
# +{err@mdx-error[
# +Line 1, characters 41-45:
# +Error: Cannot locate deriver yaml
# +]err}]}
#  
#  produces the following function.
#  
#  {@ocaml[
#  # note_to_yaml;;
# -- : ('a -> Yaml.value) -> 'a note -> [> `O of (string * Yaml.value) list ] =
# -<fun>
# +Line 1, characters 1-13:
# +Error: Unbound value note_to_yaml
#  ]}
#  
#  Finally, if you only need the encoder ([to_yaml]) or the decoder ([of_yaml]) then there are single versions of the deriver for those.
#  
#  {@ocaml[
#  # type x = { age : int }[@@deriving to_yaml];;
# -type x = { age : int; }
# -val x_to_yaml : x -> [> `O of (string * [> `Float of float ]) list ] = <fun>
# +Line 1, characters 35-42:
# +Error: Cannot locate deriver to_yaml
#  ]}
#  
#  {1 Attributes}
# @@ -83,11 +87,12 @@ override the Yaml names you can use the [[@key <string>]] and [[@name
#  # type t = {
#      camel_name : string [@key "camel-name"]
#    }[@@deriving to_yaml];;
# -type t = { camel_name : string; }
# -val to_yaml : t -> [> `O of (string * [> `String of string ]) list ] = <fun>
# +Line 3, characters 16-23:
# +Error: Cannot locate deriver to_yaml
#  
#  # Yaml.to_string_exn (to_yaml { camel_name = "Alice" });;
# -- : string = "camel-name: Alice\n"
# +Line 1, characters 21-28:
# +Error: Unbound value to_yaml
#  ]}
#  
#  {2 Default Values}
# @@ -99,13 +104,18 @@ type t = {
#    name : string;
#    age : int [@default 42]
#  }[@@deriving yaml]
# -]}
# +][
# +{err@mdx-error[
# +Line 4, characters 16-20:
# +Error: Cannot locate deriver yaml
# +]err}]}
#  
#  These will be used in the absence of any fields when decoding Yaml values into OCaml ones.
#  
#  {@ocaml[
#  # Yaml.of_string_exn "name: Alice" |> of_yaml;;
# -- : (t, [> `Msg of string ]) result = Ok {name = "Alice"; age = 42}
# +Line 1, characters 37-44:
# +Error: Unbound value of_yaml
#  ]}
#  
#  {2 Custom encoding and decoding}
# @@ -117,13 +127,18 @@ by field basis. To do so, you can use the [of_yaml] and [to_yaml] attributes.
#  type t = {
#    name : string [@to_yaml fun i -> `String ("custom-" ^ i)]
#  }[@@deriving yaml]
# -]}
# +][
# +{err@mdx-error[
# +Line 3, characters 16-20:
# +Error: Cannot locate deriver yaml
# +]err}]}
#  
#  The [to_yaml] function will use the custom encoder now instead.
#  
#  {@ocaml[
#  # Yaml.to_string_exn (to_yaml { name = "alice" });;
# -- : string = "name: custom-alice\n"
# +Line 1, characters 21-28:
# +Error: Unbound value to_yaml
#  ]}
#  
#  {1 Partially Decoding}
# @@ -145,14 +160,13 @@ If we try to do the normal decoding of this but only partially extract the field
#      name : string;
#      age : int;
#    }[@@deriving of_yaml];;
# -type t = { name : string; age : int; }
# -val of_yaml :
# -  [> `O of (string * [> `Float of float | `String of string ]) list ] ->
# -  (t, [> `Msg of string ]) result = <fun>
# +Line 4, characters 16-23:
# +Error: Cannot locate deriver of_yaml
#  
#  # Yaml.of_string_exn yaml |> of_yaml;;
# -- : (t, [> `Msg of string ]) result =
# -Error (`Msg "Failed to find the case for: misc")
# +Line 1, characters 28-35:
# +Error: Unbound value of_yaml
# +Hint: Did you mean yaml?
#  ]}
#  
#  Instead we tell the deriver to ignore unknown fields.
# @@ -162,11 +176,17 @@ type t = {
#    name : string;
#    age : int;
#  }[@@deriving of_yaml ~skip_unknown]
# -]}
# +][
# +{err@mdx-error[
# +Line 4, characters 16-23:
# +Error: Cannot locate deriver of_yaml
# +]err}]}
#  
#  {@ocaml[
#  # Yaml.of_string_exn yaml |> of_yaml;;
# -- : (t, [> `Msg of string ]) result = Ok {name = "Bob"; age = 42}
# +Line 1, characters 28-35:
# +Error: Unbound value of_yaml
# +Hint: Did you mean yaml?
#  ]}
#  
#  {1 Implementation Details}

@mseri mseri added the question label Jun 22, 2025
@patricoferris
Copy link
Contributor Author

Hey @mseri -- I think this is something that has been plaguing ppxes for a while and not related to ppx_deriving_yaml in particular. We have previously merged release with this failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants