caml-list - the Caml user's mailing list
 help / color / Atom feed
From: "Jocelyn Sérot" <jocelyn.serot@uca.fr>
To: Caml Mailinglist <caml-list@inria.fr>
Subject: [Caml-list] A (silly ?) question about opam and ocamlfind
Date: Wed, 14 Aug 2019 15:20:11 +0200
Message-ID: <8D32A371-FD47-434F-928A-C07D002BB712@uca.fr> (raw)

[-- 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 --]

<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Dear Camlers,<div><br></div><div>I’ve been fighting for one entire day with a problem without success and the more i dig, the more confused i am :(</div><div><br></div><div>Suppose i define a small opam package - let’s call it « dummy&nbsp;» :</div><div><br></div><div><div>opam-version: "2.0"</div><div>name: "dummy"</div><div>version: "0.0"</div><div>synopsis: "A dummy OPAM package"</div><div>maintainer: "JS"</div><div>authors: "JS"</div><div>license: "MIT"</div><div>depends: [ "ocaml" "ocamlfind" ]</div><div>build: [</div><div>&nbsp; [make]</div><div>]</div></div><div><br></div><div>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).</div><div><br></div><div>What is the correct way to make this package available to other programs :</div><div><br></div><div><div>[opam pin add .]&nbsp;</div></div><div><br></div><div>or&nbsp;</div><div><br></div><div>[opam install .]</div><div><br></div><div>?</div><div><br></div><div>I’ve tried both solutions but systematically get :</div><div><br></div><div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">ocamlfind ocamlc -package dummy -linkpkg -o main main.ml</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">ocamlfind: Package `dummy' not found</div></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><br></div><div style="margin: 0px;">when trying to compile [main.ml], where this file contains, for example :&nbsp;«&nbsp;let _ = Mylib.dump ()&nbsp;» (and where [dump] is a function defined in mylib.ml&nbsp;»&nbsp;</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">When simply pinning the package, [opam info dummy] gives :</div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(52, 187, 199);">&lt;&gt;&lt;&gt;<span style="color: #000000"> dummy: information on all versions </span>&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;<span style="color: #000000">&nbsp; </span><span style="color: #afad24">🐫&nbsp;</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">name</span> &nbsp; &nbsp; &nbsp; &nbsp; dummy</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(83, 48, 225);">all-versions<span style="color: #000000"> 0.0</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; min-height: 14px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(52, 187, 199);">&lt;&gt;&lt;&gt;<span style="color: #000000"> Version-specific details </span>&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;<span style="color: #000000">&nbsp; </span><span style="color: #afad24">🐫&nbsp;</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">version</span> &nbsp; &nbsp; 0.0</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">pin</span> &nbsp; &nbsp; &nbsp; &nbsp; <a href="file:///Users/jserot/Dev/ml/opam/simple/build/raw">file:///Users/jserot/Dev/ml/opam/simple/build/raw</a></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">url.src:</span>&nbsp; &nbsp; "<a href="file:///Users/jserot/Dev/ml/opam/simple/build/raw">file:///Users/jserot/Dev/ml/opam/simple/build/raw</a>"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">authors:</span>&nbsp; &nbsp; "JS"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(83, 48, 225);">maintainer:<span style="color: #000000"> "JS"</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">license:</span>&nbsp; &nbsp; "MIT"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">depends:</span>&nbsp; &nbsp; "ocaml" "ocamlfind"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">synopsis</span>&nbsp; &nbsp; A dummy OPAM package</div><div><br></div><div>which tends does not show any installed version of the package (and hence could explain why ocamlfind does not find it ?)</div><div><br></div><div>After installing the package ([opam install .]), [opam info dummy] gives :</div><div><br></div><div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">$ opam info dummy</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; min-height: 14px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(52, 187, 199);">&lt;&gt;&lt;&gt;<span style="color: #000000"> dummy: information on all versions </span>&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;<span style="color: #000000">&nbsp; </span><span style="color: #afad24">🐫&nbsp;</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">name</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="text-decoration: underline">dummy</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(83, 48, 225);">all-installed-versions<span style="color: #000000"> </span><span style="color: #d53bd3">0.0</span><span style="color: #000000"> [4.06.0]</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(83, 48, 225);">all-versions<span style="color: #000000"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #d53bd3">0.0</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; min-height: 14px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(52, 187, 199);">&lt;&gt;&lt;&gt;<span style="color: #000000"> Version-specific details </span>&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;<span style="color: #000000">&nbsp; </span><span style="color: #afad24">🐫&nbsp;</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(83, 48, 225);">version<span style="color: #000000"> &nbsp; &nbsp; </span><span style="color: #d53bd3">0.0</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">pin</span> &nbsp; &nbsp; &nbsp; &nbsp; <a href="file:///Users/jserot/Dev/ml/opam/simple/build/raw">file:///Users/jserot/Dev/ml/opam/simple/build/raw</a></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">url.src:</span>&nbsp; &nbsp; "<a href="file:///Users/jserot/Dev/ml/opam/simple/build/raw">file:///Users/jserot/Dev/ml/opam/simple/build/raw</a>"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">authors:</span>&nbsp; &nbsp; "JS"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(83, 48, 225);">maintainer:<span style="color: #000000"> "JS"</span></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">license:</span>&nbsp; &nbsp; "MIT"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">depends:</span>&nbsp; &nbsp; "ocaml" "ocamlfind"</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><span style="color: #5330e1">synopsis</span>&nbsp; &nbsp; A dummy OPAM package</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">$&nbsp;</div></div><div><br></div><div>which now seems to indicates that the package is «&nbsp;installed&nbsp;» (though i do not fully understand the distinction between the former case..).</div><div>But i still get the message&nbsp;</div></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><div style="margin: 0px; font-size: 10px; font-family: Monaco;">ocamlfind ocamlc -package dummy -linkpkg -o main main.ml</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">ocamlfind: Package `dummy' not found</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><br></div><div style="margin: 0px;">There must be sth i’m doing wrong (or have not understood in the way opam works)..</div><div style="margin: 0px;">Any help appreciated.</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">Jocelyn</div><div style="margin: 0px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><br></div></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"><br></div></body></html>

             reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 13:20 Jocelyn Sérot [this message]
2019-08-14 13:42 ` Kakadu
2019-08-14 19:08 ` rixed
2019-08-15  6:26   ` Jocelyn Sérot
2019-08-15  8:25   ` Malcolm Matalka

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8D32A371-FD47-434F-928A-C07D002BB712@uca.fr \
    --to=jocelyn.serot@uca.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

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

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.caml-list


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