Missing dependency?
Closed this issue · 6 comments
In Utop, for OCaml 4.06.1:
ocaml# #require "ppx_sexp_conv";;
No such package: ppx_deriving - required by `ppx_sexp_conv'
$ opam info ppx_sexp_conv
=-=- ppx_sexp_conv: information on all versions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
name ppx_sexp_conv
all-installed-versions v0.10.0 [4.05.0 4.06.1]
all-versions 113.09.00 113.24.00 113.33.00 113.33.00+4.03 113.33.01+4.03 113.33.03 v0.9.0 v0.10.0 v0.11.0
=-=- Version-specific details -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
version v0.10.0
repository default
url.src: https://ocaml.janestreet.com/ocaml-core/v0.10/files/ppx_sexp_conv-v0.10.0.tar.gz
url.checksum: md5=c14ca06337e21899ee9ea32cf52aa374
homepage: https://github.com/janestreet/ppx_sexp_conv
bug-reports: https://github.com/janestreet/ppx_sexp_conv/issues
dev-repo: git+https://github.com/janestreet/ppx_sexp_conv.git
authors: Jane Street Group, LLC <opensource@janestreet.com>
maintainer: opensource@janestreet.com
license: Apache-2.0
depends: "ocaml" {>= "4.04.1"}
"ppx_core" {>= "v0.10" & < "v0.11"}
"ppx_driver" {>= "v0.10" & < "v0.11"}
"ppx_metaquot" {>= "v0.10" & < "v0.11"}
"ppx_type_conv" {>= "v0.10" & < "v0.11"}
"sexplib" {>= "v0.10" & < "v0.11"}
"jbuilder" {build & >= "1.0+beta12"}
"ocaml-migrate-parsetree" {>= "0.4"}
synopsis Generation of S-expression conversion functions from type definitions
description Part of the Jane Street's PPX rewriters collection.
Manually installing ppx_deriving
then works.
yh that's expected. Basically ppx_sexp_conv doesn't need ppx_deriving but exposes a compatibility mode that uses ppx_deriving. The toplevel relies on this compatibility mode.
It's expected that people will encounter a missing lib when using ppx_sexp_conv
in an obvious way? Well, OK, often one will have already installed ppx_deriving
for other reasons, so maybe this won't happen very often, but perhaps at least a note about this could be added to the README.
(I worry that little things like this, encountered repeatedly in different contexts--as one does--is the sort of thing that will turn people off of OCaml before they are far enough into it to appreciate it.)
Is there a way to intercept this missing library error and print a user friendly message? Perhaps using some compilation flags at build time?
I don't understand everything that's going on, but this sounds like a widespread issue that affects many ppxes.
For example here a user is reasonably(ish) describing a related issue as a bug, but it's in ppx_deriving_json
.
Not sure what the right solution is, maybe it's just phasing out findlib.
Actually, closing it as a duplicate of #30.