Notice for package authors

kahl at cas.mcmaster.ca kahl at cas.mcmaster.ca
Thu Jun 4 05:13:25 EDT 2009


[Not replying to haskell-cafe since not subscribed.]

Duncan wrote:
 > 
 > There is no way for the tools to discover if you mean base 3 or 4 and
 > yet most packages break when we pick the wrong one. You must specify an
 > upper bound so that your package does not break when the next major
 > version of the base library is released.
 > 
 > For example, if you've tested with base 3 and 4 then use:
 > 
 >         build-depends: base >= 3 && < 5

Then ``build-depends'' is a misnomer because most packages will most likely
not DEPEND on the fact that the used base package has version less than 5.

This misnomer is one major source of my uneasiness with cabal.


I would like to propose ``tested-with'' as a better name,
and would like to see a way for users to easily test with a version
I did not have avaliable, and report that back (perhaps to hackage).
E.g.,

  ./Setup configure --accept="base==5.9"
  ./Setup build
  ./Setup install
  ./Setup test
  ./Setup report-build-and-test-to-hackage

     (long name to make sure users know they are going to send a message.)

The flag --accept would add a disjunction to the ``tested-with'' formula
(to allow the build), in contrast with the semantics documented
for the flag --constraint in the output of ./Setup --configure --help,
which adds a conjunction.

Probably a ``--force="base==5.9"'' would also make sense,
it would then be an abbreviation for
``--accept="base==5.9" --constraint="base==5.9"''.
(Sequence of the two flags would matter!)


Of ocurse, I can, for example, honestly only write

  tested-with: base `elem` [2.1.1, 3.0.1.0, 3.0.3.1, 4.1.0.0]

because those are the versions I happen to have lying around,
and you probably would like to allow building with

  == 2.1.1.* || == 3.0.1.* || (>= 3.0.3.1 && < 3.0.4) || == 4.1.*

without hesitation, and at least trying with

  (>= 2.1.1 && < 2.2) || (>= 3.0.1 && < 3.1) || == 4.1.*

according to the version convention.
But in general there is no guarantee that a give package actually
implements that, or does hackage test for compliance with the
version convention?


Yet another problem is that if I write

   tested-with:
      pkg1 == v1_1 || == v1_2
      ...
      pkg9 == v9_1 || == v9_2

, I probably won't have tested all 2^9 combinations...
So I really want to write something like:

   tested-with:
      (pkg1 == v1_1 && pkg2 == v2_1) ||
      (pkg1 == v1_1 && pkg2 == v2_2) ||
      (pkg1 == v1_2 && pkg2 == v2_2)

Then you may want to at least warn the user who has only
      (pkg1 == v1_2 && pkg2 == v2_1)
installed...



Wolfram


More information about the Libraries mailing list