caml-list - the Caml user's mailing list
 help / Atom feed
* [Caml-list] A (silly ?) question about opam and ocamlfind
@ 2019-08-14 13:20 Jocelyn Sérot
  2019-08-14 13:42 ` Kakadu
  2019-08-14 19:09 ` rixed
  0 siblings, 2 replies; 5+ messages in thread
From: Jocelyn Sérot @ 2019-08-14 13:20 UTC (permalink / raw)
  To: Caml Mailinglist

[-- Attachment #1: Type: text/plain, Size: 2714 bytes --]

Dear Camlers,

I’ve been fighting for one entire day with a problem without success and the more i dig, the more confused i am :(

Suppose i define a small opam package - let’s call it « dummy » :

opam-version: "2.0"
name: "dummy"
version: "0.0"
synopsis: "A dummy OPAM package"
maintainer: "JS"
authors: "JS"
license: "MIT"
depends: [ "ocaml" "ocamlfind" ]
build: [
  [make]
]

where [make] simply builds the library files [mylib.cma] and [mylib.cmxa] (by directly calling ocamlc/opt or using dune - this does not matter here).

What is the correct way to make this package available to other programs :

[opam pin add .] 

or 

[opam install .]

?

I’ve tried both solutions but systematically get :

ocamlfind ocamlc -package dummy -linkpkg -o main main.ml
ocamlfind: Package `dummy' not found

when trying to compile [main.ml], where this file contains, for example : « let _ = Mylib.dump () » (and where [dump] is a function defined in mylib.ml » 

When simply pinning the package, [opam info dummy] gives :

<><> dummy: information on all versions <><><><><><><><><><><><><><><><><><>  🐫 
name         dummy
all-versions 0.0

<><> Version-specific details <><><><><><><><><><><><><><><><><><><><><><><>  🐫 
version     0.0
pin         file:///Users/jserot/Dev/ml/opam/simple/build/raw
url.src:    "file:///Users/jserot/Dev/ml/opam/simple/build/raw"
authors:    "JS"
maintainer: "JS"
license:    "MIT"
depends:    "ocaml" "ocamlfind"
synopsis    A dummy OPAM package

which tends does not show any installed version of the package (and hence could explain why ocamlfind does not find it ?)

After installing the package ([opam install .]), [opam info dummy] gives :

$ opam info dummy

<><> dummy: information on all versions <><><><><><><><><><><><><><><><><><>  🐫 
name                   dummy
all-installed-versions 0.0 [4.06.0]
all-versions           0.0

<><> Version-specific details <><><><><><><><><><><><><><><><><><><><><><><>  🐫 
version     0.0
pin         file:///Users/jserot/Dev/ml/opam/simple/build/raw
url.src:    "file:///Users/jserot/Dev/ml/opam/simple/build/raw"
authors:    "JS"
maintainer: "JS"
license:    "MIT"
depends:    "ocaml" "ocamlfind"
synopsis    A dummy OPAM package
$ 

which now seems to indicates that the package is « installed » (though i do not fully understand the distinction between the former case..).
But i still get the message 

ocamlfind ocamlc -package dummy -linkpkg -o main main.ml
ocamlfind: Package `dummy' not found

There must be sth i’m doing wrong (or have not understood in the way opam works)..
Any help appreciated.

Jocelyn







[-- Attachment #2: Type: text/html, Size: 9305 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14 13:20 [Caml-list] A (silly ?) question about opam and ocamlfind Jocelyn Sérot
2019-08-14 13:42 ` Kakadu
2019-08-14 19:09 ` rixed
2019-08-15  6:27   ` Jocelyn Sérot
2019-08-15  8:25   ` Malcolm Matalka

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox