Bootstrap.hs

Jake Wheat jakewheatmail at gmail.com
Sun Jan 11 18:10:48 UTC 2015


On 11 January 2015 at 14:35, Johan Tibell <johan.tibell at gmail.com> wrote:

> Overall I like this approach. One problem the old script suffered from was
> that its goals and, in particular, non-goals weren't clearly stated. Lets
> state the goal clearly:
>
>   Goal: Be able to bootstrap a cabal-install binary of a bare GHC install
> from https://www.haskell.org/ghc/download
>   Non-goal: Be able to bootstrap using a modified global package DB or
> using a user DB in an arbitrary state.
>

I would like to add a goal:
Boostrap on a modified GHC install, as long as the global packages which
come with GHC are not modified. It will ignore any packages added to
global, or added to the user package database. I think this is useful for
testing and for more convenient recovery if you delete cabal-install. (It
already does this.)

I think it would be a good idea if the platforms it is expected to work on
nailed down a bit more clearly as part of the goals also - not sure what to
do about Linux, but we can say which versions of Windows and OSX it is
tested on.


>
> The latter is a non-goal because doing that well requires a constraint
> solver. We've tried to to emulate that using regexes in the past and that
> has become more and more untenable. The goal is met by the new Bootstrap.hs
> by nailing down the exact version numbers to use.
>
> Questions about Bootstrap.sh:
>
>  * Can we make it work in-tree? I tried it on master now and that didn't
> work (because it tried to install Cabal-1.23 from Hackage, which doesn't
> exist.) This is needed to we can run it on Travis to test it.
>

This is on my todo for this to work automatically. I think it will be
pretty easy.


>  * We need to make sure it works on supported platforms: Linux, OS X, and
> Windows. This is mostly about testing.
>

Can travis test on all these systems? What about e.g. Solaris or FreeBSD,
which have had binary releases of GHC in the past?


>
 * How can I test it in the current state? As mentioned above,
> bootstrapping in the master branch didn't work.
>

The current work-around needs a working cabal-install, run 'cabal sdist' in
the Cabal/ dir, then copy the .tar.gz to cabal-install/ and the
Bootstrap.hs will pick it up.


>  * We should output a message once the install is done to tell the user
> how to use the bootstrapped binary.
>

There is a small message, it can be changed/added easily.


> In particular, we might want to tell the user to use it to reinstall
> cabal-install not in a sandbox.
>

Is there any reason to do this? Won't the bootstrapped cabal install binary
work fine for most users? Alternatively, it could rerun cabal-install
automatically or optionally as part of the bootstrap, or it could copy the
bootstrap binary to ~/.cabal/bin/ or something if this is desired.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/cabal-devel/attachments/20150111/408064f6/attachment.html>


More information about the cabal-devel mailing list