Cabal Release Candidate

Isaac Jones ijones at syntaxpolice.org
Fri Jul 15 03:15:55 EDT 2005


"Simon Marlow" <simonmar at microsoft.com> writes:

> On 14 July 2005 14:45, Simon Marlow wrote:
>
>> When I installed the new Cabal globally (onto GHC 6.4), the old one
>> was hidden automatically, so the suggestion for unregistering the old
>> one in the README is unecessary.
>
> I take it back.  If you don't unregister the old one, then "-package
> Cabal" results in an error from GHC ("Cabal matches multiple packages"),
> and building GHC fails.  In hindsight this was a bad choice, I'm going
> to change it so that -package P picks the latest version of P if a
> particular version isn't specified.

Sounds good.

> However, upgrading Cabal might still cause problems for GHC, because our
> build system relies on knowing what version of GHC you're building with
> to know what version of Cabal you're using.  This is not really Cabal's
> problem.

Hmm.  I guess this can't be determined at GHC's build time.  What is
this info used for?

(snip)
> I've made the following changes for 6.4.1:
>
>   - -package P picks the latest version of P, instead of complaining
>     if P is ambiguous.
>
>   - -hide-package P hides all versions of P, instead of complaining
>     if P is ambiguous.
>
>   - -package P hides all other versions of P (this was advertised
>     in the documentation, but wasn't actually implemented in 6.4)
>
>   - if multiple packages with the same name are still exposed after
>     the flags have been processed, then all except the latest version
>     are hidden.

We basically have three dimensions of a single package to consider:
  - hidden vs. exposed
  - user vs. global vs. -package-conf
  - versions

I propose that -package-conf packages have priority over user packages
which have priority over global packages (are all three considered at
the same time?)

What do we do if multiple "dimensions" of the same package are
exposed?  Right now, ghc just quits, right?  I propose:

  Pick the Exposed -package-conf package with greatest version number

  if none, the exposed user package with greatest version number

  if none, the exposed system package with the greatest version
  number.

This is the same whether they use the -package flag for this package
or not, since it's already exposed.

If they use the -package-related flags, I propose:

  - -package P picks the latest version of P, (with -package-conf
    vs. user vs. global preferences as above) , instead of complaining
    if P is ambiguous.

  - -hide-package P hides all versions of P (including -package-conf,
    user and global packages), instead of complaining if P is
    ambiguous.

  - -package P hides all other versions of P (including -package-conf,
    user and global packages) (this was advertised in the
    documentation, but wasn't actually implemented in 6.4)

  - if multiple packages with the same name are still exposed after
    the flags have been processed, then all except the latest version
    are hidden, competing as above.

peace,

  isaac


More information about the Libraries mailing list