The bootstrap.sh script has to go

Hi all, I've spent more time on the bootstrap.sh script than anything else, making it emulate cabal flag resolution for the network-uri split and make it deal with the fact that network-uri makes Haddock choke. this release. That feels like a somewhat wasteful activity and I'm tired of maintain a stinking pile of shell script. Unless someone is willing to rewrite it as a Haskell program (that could be run using runhaskell), I vote we dump it and instead encourage users to bootstrap using e.g. the Haskell Platform. -- Johan

I have some ideas about how to improve the bootstrap.sh situation. Rewriting in haskell sounds like a good idea to avoid the shell script mess. Simplify the bootstrap.sh process: * always use a fixed set of versions of packages for the dependencies * always bootstrap in a sandbox, and ignore packages in the global and user package database - only reuse an existing package if it is in the bootstrap sandbox and is the exact version expected * possibly the set of versions of packages can be in an external file, and possibly bootstrap can optionally try to download a new dependencies version file when bootstrap.sh is run * possibly the set of dependency package versions can be different for different versions of ghc * there could even be a process which uses a cabal-install to generate the list of bootstrap.sh dependency versions in some automatic way * choose the bootstrap to always do shared or non shared (not sure which is best). Don't have options to do profiling, haddock, change the prefix, etc. at all. * if any dependency packages need specific flags, then this can be hardcoded in some way linked to in the dependency package versions This allows more reliable bootstrapping on a new system, and more reliable bootstrapping e.g. if you delete the cabal-install binary and also happen to have all sorts of stuff in your user package database. In this system, if you want the latest cabal-install and you want it with the latest packages, or with profiling, haddock, etc. then you can just bootstrap.sh, then use the cabal-install binary to build a latest and greatest cabal-install with the full constraint solver and any options you want. I think this is a reasonable compromise to allow easy maintenance and a reliable and painless bootstrap.sh process. I can work on some variation of this if it sounds acceptable.

On 2014-12-30 at 21:23:19 +0100, Jake Wheat wrote: [...]
Simplify the bootstrap.sh process:
* always use a fixed set of versions of packages for the dependencies
For me, the primary use-case of `bootstrap.sh` is to be able to build a matching `cabal-install` executable for a given major GHC version w/o requiring having an existing cabal-install executable compatible w/ the GHC version I'm trying to bootstrap cabal-install with. (If I had an older `cabal-install` executable, I would use that to bootstrap the new one) So, if a given cabal-install's bootstrap.sh would only support bootstrapping via its associated GHC major version (e.g. cabal-install-1.22.x would require GHC 7.10.x) then I guess the bootstrap.sh wouldn't need to perform any significant package version resolving, and could just use such a single fixed set of versions (and preferably in a sandbox to ignore any user pkg-db) as you seem to propose. Alternatively, GHC could start bundling cabal-install, which would IMHO eliminate the need for a bootstrap.sh in the first place (but we had that discussion already, and it would also require to pull cabal-install's dependencies into the GHC distribution, while OTOH GHC is trying to avoid acquiring additional build dependencies...) Cheers, hvr

See https://github.com/haskell/cabal/issues/2310 for a continuation of the
sad bootstrap.sh saga.
On Thu, Jan 1, 2015 at 6:43 AM, Herbert Valerio Riedel
On 2014-12-30 at 21:23:19 +0100, Jake Wheat wrote:
[...]
Simplify the bootstrap.sh process:
* always use a fixed set of versions of packages for the dependencies
For me, the primary use-case of `bootstrap.sh` is to be able to build a matching `cabal-install` executable for a given major GHC version w/o requiring having an existing cabal-install executable compatible w/ the GHC version I'm trying to bootstrap cabal-install with. (If I had an older `cabal-install` executable, I would use that to bootstrap the new one)
So, if a given cabal-install's bootstrap.sh would only support bootstrapping via its associated GHC major version (e.g. cabal-install-1.22.x would require GHC 7.10.x) then I guess the bootstrap.sh wouldn't need to perform any significant package version resolving, and could just use such a single fixed set of versions (and preferably in a sandbox to ignore any user pkg-db) as you seem to propose.
Alternatively, GHC could start bundling cabal-install, which would IMHO eliminate the need for a bootstrap.sh in the first place (but we had that discussion already, and it would also require to pull cabal-install's dependencies into the GHC distribution, while OTOH GHC is trying to avoid acquiring additional build dependencies...)
Cheers, hvr

I have a pull request here for review:
https://github.com/haskell/cabal/pull/2312
On 1 January 2015 at 18:43, Johan Tibell
See https://github.com/haskell/cabal/issues/2310 for a continuation of the sad bootstrap.sh saga.
On Thu, Jan 1, 2015 at 6:43 AM, Herbert Valerio Riedel
wrote: On 2014-12-30 at 21:23:19 +0100, Jake Wheat wrote:
[...]
Simplify the bootstrap.sh process:
* always use a fixed set of versions of packages for the dependencies
For me, the primary use-case of `bootstrap.sh` is to be able to build a matching `cabal-install` executable for a given major GHC version w/o requiring having an existing cabal-install executable compatible w/ the GHC version I'm trying to bootstrap cabal-install with. (If I had an older `cabal-install` executable, I would use that to bootstrap the new one)
So, if a given cabal-install's bootstrap.sh would only support bootstrapping via its associated GHC major version (e.g. cabal-install-1.22.x would require GHC 7.10.x) then I guess the bootstrap.sh wouldn't need to perform any significant package version resolving, and could just use such a single fixed set of versions (and preferably in a sandbox to ignore any user pkg-db) as you seem to propose.
Alternatively, GHC could start bundling cabal-install, which would IMHO eliminate the need for a bootstrap.sh in the first place (but we had that discussion already, and it would also require to pull cabal-install's dependencies into the GHC distribution, while OTOH GHC is trying to avoid acquiring additional build dependencies...)
Cheers, hvr
participants (3)
-
Herbert Valerio Riedel
-
Jake Wheat
-
Johan Tibell