Skip to content

Failure("unknown variant: options") #58

@MisterDA

Description

@MisterDA
2023-01-19 22:28.50: >>> Failure("unknown variant: options") (score = 30)
2023-01-19 22:28.50: >>> Failure("unknown variant: options") (score = 30)
2023-01-19 22:28.50: unknown variant: options

https://ci.ocamllabs.io/github/ocsigen/lwt/commit/3d6f0fac4fed71d3c9cbdc5b90d6a443949bb0d6/variant/(analysis)

This issue seems to come from

with_variant t (Some "options")

the only place afaict that introduces the variant "options". It is however not present in
let of_string = function
| "afl" -> Some `Afl
| "flambda" -> Some `Flambda
| "default-unsafe-string" -> Some `Default_unsafe_string
| "domains" -> Some `Domains
| "effects" -> Some `Effects
| "force-safe-string" -> Some `Force_safe_string
| "fp" -> Some `Frame_pointer
| "multicore" -> Some `Multicore
| "no-effect-syntax" -> Some `Multicore_no_effect_syntax
| "nnp" -> Some `No_naked_pointers
| "nnpchecker" -> Some `No_naked_pointers_checker
| "no-flat-float-array" -> Some `Disable_flat_float_array
| _ -> None

so there's an error at
let of_t t =
match t.extra with None -> Ok [] | Some extra ->
String.split_on_char '+' extra |>
List.map (fun b -> match of_string b with
| None -> Error (`Msg ("unknown variant: " ^ b))
| Some v -> Ok v) |>

I can't manage to prove that this is where the "options" variant was introduced in the version value, nor find another place where it might have, nor figure out why the extra field isn't None in Opam.V2.package.

cc @benmandrew who first found the issue.
cc @dra27 who might have a clue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions