rgrinberg / opium

Sinatra like web toolkit for OCaml
MIT License
755 stars 67 forks source link

Incompatible with base >= v0.13 (and other Jane Street libs) on ocaml >= 4.08 #119

Closed shonfeder closed 4 years ago

shonfeder commented 4 years ago

Can recreate with:

$ opam switch create . ocaml-system.4.08.1

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-system.4.08.1
∗ installed ocaml-config.1
∗ installed ocaml.4.08.1
Done.
$ opam install opium base=v0.13.0
The following dependencies couldn't be met:
  - opium → cohttp < 0.99 → uri < 1.5.0 → ocaml < 4.06.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → uri < 1.5.0 → sexplib < 113.01.00 → ocaml < 4.03.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → sexplib < 113.01.00 → ocaml < 4.03.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → pa_sexp_conv → ocaml < 4.03
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → fieldslib < 113.01.00 → ocaml < 4.03
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → fieldslib < 113.01.00 → type_conv < 109.20.00 → ocaml < 4.03.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → cstruct < 0.6.0 → ocaml < 4.06.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → pa_sexp_conv < v0.9.0 → ocaml < 4.03
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → ppx_driver → ppxlib < 0.3.0 → ocaml < 4.08.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → ppx_driver → ppx_core → base < v0.11 → ocaml < 4.07.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → ppx_driver → ppx_core → ocaml < 4.06.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → ppx_driver → ppx_core → ppx_ast < v0.10 → ocaml < 4.08.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → ppx_driver → ppx_core → ppxlib < 0.3.0 → ocaml < 4.08.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → ppx_driver → ocaml < 4.06.0
      base of this switch (use `--unlock-base' to force)
  - opium → cohttp < 0.99 → conduit < 0.16.0 → sexplib < 113.24.00 → ocaml < 4.03.0
      base of this switch (use `--unlock-base' to force)
  - opium → cow < 2.0.0 → ocaml < 4.06.0
      base of this switch (use `--unlock-base' to force)
  - opium → lwt < 4.0.0 → ocaml < 4.08.0
      base of this switch (use `--unlock-base' to force)
  - opium → ppx_fields_conv < v0.13 → ppx_core → base < v0.11 → ocaml < 4.07.0
      base of this switch (use `--unlock-base' to force)
  - opium → ppx_fields_conv < v0.13 → ppx_core → ocaml < 4.06.0
      base of this switch (use `--unlock-base' to force)
  - opium → ppx_fields_conv < v0.13 → ppx_core → ppx_ast < v0.10 → ocaml < 4.08.0
      base of this switch (use `--unlock-base' to force)
  - opium → ppx_fields_conv < v0.13 → ppx_core → ppxlib < 0.3.0 → ocaml < 4.08.0
      base of this switch (use `--unlock-base' to force)
  - opium → ppx_fields_conv < v0.13 → ocaml < 4.03
      base of this switch (use `--unlock-base' to force)
  - opium → ppx_fields_conv < v0.13 → base < v0.13 → ocaml < 4.08.0
      base of this switch (use `--unlock-base' to force)
  - opium → sexplib < 113.01.00 → ocaml < 4.03.0
      base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
  - No available version of base satisfies the constraints

No solution found, exiting

This limitation means (at least) that we cannot use the binding operator syntax introduced in 4.08, since Jane Street's ppxs libs prior to v0.13 can't handle it.

anuragsoni commented 4 years ago

Thanks for reporting this. This looks a little strange and i'll need to try this myself. In the published opam package the constraint for cohttp is >= 0.99 so i'm not sure why its trying to install < 0.99

anuragsoni commented 4 years ago

The error was a little confusing, but the reason you can't use v0.13 versions of Janestreet libraries is because cohttp-lwt has a constraint for sexplib0 to be < 0.13 (http://opam.ocaml.org/packages/cohttp-lwt/cohttp-lwt.2.4.0/). Base uses sexplib0 so it in turn gets constrained to versions < 0.13. Once cohttp-lwt is updated to support the janestreet v0.13 packages opium should automatically start working with those.

I'm closing this issue for now, but feel free to re-open if you notice problems once cohttp-lwt is updated.