caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] findlib gives warning that compiler doesn't
@ 2015-08-04 20:49 Ashish Agarwal
  2015-08-05 15:36 ` Gerd Stolpmann
  0 siblings, 1 reply; 3+ messages in thread
From: Ashish Agarwal @ 2015-08-04 20:49 UTC (permalink / raw)
  To: Caml List

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

With the file structure shown below, assume you're in directory libb. Then:

$ ocamlc -I ../liba -c a.ml
(* no warnings *)

$ ocamlfind ocamlc -I ../liba -c a.ml
findlib: [WARNING] Interface a.cmi occurs in several directories: ., ../liba

Why does findlib do an extra check that the compiler is okay with? This is
causing problems in a project where I'd like to build several packed
libraries, and one reason for doing so is precisely to reuse module names.
Am I going about this wrong? My goal is that within libb, the only module
from liba that should be visible is Liba.


├── liba
│   ├── a.cmi
│   ├── a.cmo
│   ├── a.ml
│   ├── b.cmi
│   ├── b.cmo
│   ├── b.ml
│   ├── liba.cma
│   ├── liba.cmi
│   └── liba.cmo
└── libb
    ├── a.cmi
    ├── a.cmo
    └── a.ml

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

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

* Re: [Caml-list] findlib gives warning that compiler doesn't
  2015-08-04 20:49 [Caml-list] findlib gives warning that compiler doesn't Ashish Agarwal
@ 2015-08-05 15:36 ` Gerd Stolpmann
  2015-08-06 19:03   ` Ashish Agarwal
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Stolpmann @ 2015-08-05 15:36 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: Caml List

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

Am Dienstag, den 04.08.2015, 16:49 -0400 schrieb Ashish Agarwal:
> With the file structure shown below, assume you're in directory libb.
> Then:
> 
> 
> $ ocamlc -I ../liba -c a.ml
> (* no warnings *)
> 
> 
> $ ocamlfind ocamlc -I ../liba -c a.ml
> findlib: [WARNING] Interface a.cmi occurs in several
> directories: ., ../liba
> 
> 
> Why does findlib do an extra check that the compiler is okay with?
> This is causing problems in a project where I'd like to build several
> packed libraries, and one reason for doing so is precisely to reuse
> module names. Am I going about this wrong? My goal is that within
> libb, the only module from liba that should be visible is Liba.

The compiler has always been okay with multiple cmis in different
directories because the assumption is that you have full control over
the directories, and that the search path resolves any conflicts. This
is different when you use findlib. Typically you use libraries from
third parties, and cmi conflicts would remain unnoticed if findlib
didn't check.

This feature, however, is older than packed modules, and findlib doesn't
take packed modules into account. It is a little bit unclear to me how
the check could be made better. Any ideas?

Gerd

> 
> 
> ├── liba
> │   ├── a.cmi
> │   ├── a.cmo
> │   ├── a.ml
> │   ├── b.cmi
> │   ├── b.cmo
> │   ├── b.ml
> │   ├── liba.cma
> │   ├── liba.cmi
> │   └── liba.cmo
> └── libb
>     ├── a.cmi
>     ├── a.cmo
>     └── a.ml
> 
> 
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [Caml-list] findlib gives warning that compiler doesn't
  2015-08-05 15:36 ` Gerd Stolpmann
@ 2015-08-06 19:03   ` Ashish Agarwal
  0 siblings, 0 replies; 3+ messages in thread
From: Ashish Agarwal @ 2015-08-06 19:03 UTC (permalink / raw)
  To: Gerd Stolpmann; +Cc: Caml List

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

> It is a little bit unclear to me how the check could be made better. Any
ideas?

I'm not sure. I'm working around the problem by putting the output of
packing in a different directory, which gives this layout:

├── liba
│   ├── a.cmi
│   ├── a.cmo
│   ├── a.ml
│   ├── b.cmi
│   ├── b.cmo
│   └── b.ml
├── liba.cma
├── liba.cmi
├── liba.cmo
└── libb
    ├── a.cmi
    └── a.ml

Now I can do

$ ocamlfind ocamlc -I .. -c a.ml

thereby avoiding reference to the liba/ directory entirely.


On Wed, Aug 5, 2015 at 11:36 AM, Gerd Stolpmann <info@gerd-stolpmann.de>
wrote:

> Am Dienstag, den 04.08.2015, 16:49 -0400 schrieb Ashish Agarwal:
> > With the file structure shown below, assume you're in directory libb.
> > Then:
> >
> >
> > $ ocamlc -I ../liba -c a.ml
> > (* no warnings *)
> >
> >
> > $ ocamlfind ocamlc -I ../liba -c a.ml
> > findlib: [WARNING] Interface a.cmi occurs in several
> > directories: ., ../liba
> >
> >
> > Why does findlib do an extra check that the compiler is okay with?
> > This is causing problems in a project where I'd like to build several
> > packed libraries, and one reason for doing so is precisely to reuse
> > module names. Am I going about this wrong? My goal is that within
> > libb, the only module from liba that should be visible is Liba.
>
> The compiler has always been okay with multiple cmis in different
> directories because the assumption is that you have full control over
> the directories, and that the search path resolves any conflicts. This
> is different when you use findlib. Typically you use libraries from
> third parties, and cmi conflicts would remain unnoticed if findlib
> didn't check.
>
> This feature, however, is older than packed modules, and findlib doesn't
> take packed modules into account. It is a little bit unclear to me how
> the check could be made better. Any ideas?
>
> Gerd
>
> >
> >
> > ├── liba
> > │   ├── a.cmi
> > │   ├── a.cmo
> > │   ├── a.ml
> > │   ├── b.cmi
> > │   ├── b.cmo
> > │   ├── b.ml
> > │   ├── liba.cma
> > │   ├── liba.cmi
> > │   └── liba.cmo
> > └── libb
> >     ├── a.cmi
> >     ├── a.cmo
> >     └── a.ml
> >
> >
> >
>
> --
> ------------------------------------------------------------
> Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
> My OCaml site:          http://www.camlcity.org
> Contact details:        http://www.camlcity.org/contact.html
> Company homepage:       http://www.gerd-stolpmann.de
> ------------------------------------------------------------
>

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

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

end of thread, other threads:[~2015-08-06 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-04 20:49 [Caml-list] findlib gives warning that compiler doesn't Ashish Agarwal
2015-08-05 15:36 ` Gerd Stolpmann
2015-08-06 19:03   ` Ashish Agarwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).