[Haskell-cafe] Re: Examples
John Lato
jwlato at gmail.com
Tue Aug 11 07:51:19 EDT 2009
Hello,
Looking at just examples, there are a few separate issues here.
1. Installation of example source for review
2. Building/installation of example programs
For the second issue, the buildExamples flag suggested by Henning
works well to actually build the examples with cabal, but the install
location is still a problem. Most users wouldn't want example
executables to go into their bin directory, especially not in the case
of global installs. To the best of my knowledge, Cabal currently
doesn't support separate installation locations for multiple
executables, nor does it support building but not installing
executables.
With the first issue, the problem is simpler. There's no location for
source code to be installed to. Users can download the package and
unpack it themselves, or the developer can include demo source as a
"data file" and install it to the datadir (IMO a poor choice).
One option is to add support for different installation locations for
each executable. Perhaps the --installdir flag could be extended to
support a syntax like the following:
--installdir=executableName:/path/to/install
where if executableName matches one of the executables known to cabal,
it will install just that executable to the specified location. This
puts a larger burden on users, however, since they would need to know
the name(s) of all the demo executables. It also doesn't address the
issue of source location.
Another way is to add a special type of executable for tests and demo
programs to cabal. A user would specify a directory in the .cabal
file (or command-line) to which tests would be installed. Cabal would
then build the identified tests/demos for the package and put them
into that specific directory, as well as the source code. This also
answers the question of where to put executables that are Buildable
but not Installable.
Thoughts?
Cheers,
John Lato
> Date: Sun, 9 Aug 2009 21:07:53 -0400
> From: "John D. Ramsdell" <ramsdell0 at gmail.com>
> Subject: Re: [Haskell-cafe] Examples
> To: Haskell Cafe <haskell-cafe at haskell.org>
> Message-ID:
> <7687290b0908091807y1d4a5329w6b452c6a3af5e044 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Maybe in addition to having a buildable boolean in a library or
> executable section, there should be an installable boolean. It would
> default to true, but when false, the library or executable section is
> ignored during package installation.
>
> John
>
More information about the Haskell-Cafe
mailing list