Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] Virtual packages in findlib
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Virtual packages in findlib


> Can you explain that? I don't see why virtual packages can resolve
> ordering problems.

Because without virtual packages, one cannot list the true dependencies
of a package, thus causing ordering problems.

Consider the minimal example of there being two packages: A and B, with
B depending on A, and therefore having to be linked after.  However, A is
not a real package, but instead a virtual one instantiated by either
A1, A2, A3, etc.

But alas, there is no virtual package support in findlib (I assume).
Because of this, the META file for B does not list A as a dependency.
(Yes, the META is "wrong", but how could it be made right?)

Now, we tell ocamlbuild that the project depends on A1 (for instance) and B.
Because there is no *declared* dependency between A1 and B (though in fact
there should be), ocamlbuild probably assumes that it is indifferent to
link "A1; B" or "B; A1".  However, the latter case will cause an error.

Therefore, there are two solutions to this problem:

a) Make ocamlbuild preserve the order of the given packages *when there
   is no explicit dependency among them*.  (Obviously if there are dependencies
   then Ocamlbuild should re-order the packages as fit).

b) Find some virtual package mechanism in findlib (thus rendering the
   hack a) moot).

Dario Teixeira