na4zagin3 / satyrographos

Package manager for SATySFi
GNU Lesser General Public License v3.0
44 stars 13 forks source link

Inconpatible serialization in OCaml 4.08 and earlier #88

Closed na4zagin3 closed 4 years ago

na4zagin3 commented 4 years ago

Annotation [@sexp.option] is interpreted only when it is compiled in OCaml 4.09 and later.

(* library.ml *)
type t = {
  (* TODO (gh-50) make name and version into non-optional *)
  name: string option [@sexp.option];
  version: string option [@sexp.option];

  hashes: (string list * Json.t) LibraryFiles.t [@sexp.omit_nil];
  files: string LibraryFiles.t [@sexp.omit_nil];
  compatibility: Compatibility.t [@sexp.omit_nil];
  dependencies: Dependency.t [@sexp.omit_nil];
}
[@@deriving sexp, compare]

That leads incompatible serialization:

;; In OCaml 4.09 and later
((name abc) (version 0.1) ...)
;; In OCaml 4.08 and earlier
((name (abc)) (version (0.1)) ...)

This is not a practical problem as this can affect only people using pin subcommand, which is disabled by default.