
I have an draft rewrite of bootstrap.sh in haskell. I've tried to improve the maintainability of the code and reliability of running the bootstrap. https://github.com/JakeWheat/cabal/blob/bootstrap-hs/cabal-install/Bootstrap... Any feedback is appreciated!

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.
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.
* We need to make sure it works on supported platforms: Linux, OS X, and
Windows. This is mostly about testing.
* How can I test it in the current state? As mentioned above,
bootstrapping in the master branch didn't work.
* We should output a message once the install is done to tell the user how
to use the bootstrapped binary. In particular, we might want to tell the
user to use it to reinstall cabal-install not in a sandbox.
On Sat, Jan 10, 2015 at 12:52 PM, Jake Wheat
I have an draft rewrite of bootstrap.sh in haskell. I've tried to improve the maintainability of the code and reliability of running the bootstrap.
https://github.com/JakeWheat/cabal/blob/bootstrap-hs/cabal-install/Bootstrap...
Any feedback is appreciated!
_______________________________________________ cabal-devel mailing list cabal-devel@haskell.org http://www.haskell.org/mailman/listinfo/cabal-devel

On 11 January 2015 at 14:35, Johan Tibell
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.

On Sun, Jan 11, 2015 at 1:10 PM, Jake Wheat
Can travis test on all these systems? What about e.g. Solaris or FreeBSD, which have had binary releases of GHC in the past?
Travis cannot test on Windows and has only a limited number of OS X builders (last I checked, a couple weeks ago, they were not accepting new applications for OS X builds). -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

I've made an application for OS X builds for cabal.
On Sun, Jan 11, 2015 at 8:39 PM, Brandon Allbery
On Sun, Jan 11, 2015 at 1:10 PM, Jake Wheat
wrote: Can travis test on all these systems? What about e.g. Solaris or FreeBSD, which have had binary releases of GHC in the past?
Travis cannot test on Windows and has only a limited number of OS X builders (last I checked, a couple weeks ago, they were not accepting new applications for OS X builds).
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

If you could polish this into a pull request I'd be happy to review it and
merge it when it's ready.
On Sun, Jan 11, 2015 at 8:51 PM, Johan Tibell
I've made an application for OS X builds for cabal.
On Sun, Jan 11, 2015 at 8:39 PM, Brandon Allbery
wrote: On Sun, Jan 11, 2015 at 1:10 PM, Jake Wheat
wrote: Can travis test on all these systems? What about e.g. Solaris or FreeBSD, which have had binary releases of GHC in the past?
Travis cannot test on Windows and has only a limited number of OS X builders (last I checked, a couple weeks ago, they were not accepting new applications for OS X builds).
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (3)
-
Brandon Allbery
-
Jake Wheat
-
Johan Tibell