Implement the preliminary sandbox UI #1011

Merged
merged 8 commits into from Aug 24, 2012

Projects

None yet

2 participants

@23Skidoo
Member

Adds five new hidden commands:

  • cabal sandbox-configure
  • cabal sandbox-add-source
  • cabal sandbox-build
  • cabal sandbox-install
  • cabal dump-pkgenv

Example usage:

$ git clone git://github.com/haskell/cabal.git
$ cd cabal/cabal-install
$ cabal sandbox-configure -w /path/to/ghc-7.4.1
$ cabal sandbox-add-source ../Cabal
$ cabal sandbox-install --only-dependencies
# Since the previous configure only initialised the sandbox
$ cabal sandbox-configure -w /path/to/ghc-7.4.1
$ cabal sandbox-build

I kept the UI close to the current one, so dependency installation & configuration is still done manually. If a dependency added with sandbox-add-source is updated, it must be manually reinstalled with cabal sandbox-install LibName.

Ideally, one would want to just run cabal sandbox-build --package-root .. and have all dependencies installed and/or updated automatically. In the meantime, we can make a repeated cabal sandbox-install --only-dependencies/cabal sandbox-install unconditionally reinstall all dependencies added with add-source.

Changing the default compiler with -w works as intended (tested with ghc-7.4.2 and ghc-7.4.1).

23Skidoo added some commits Aug 17, 2012
@23Skidoo 23Skidoo Make 'D.C.PackageEnvironment' compile again.
The compiler didn't complain when I tested on 'package-environment-file' branch
because Main.hs didn't depend on this module.
2ac0244
@23Skidoo 23Skidoo Typos. 30d6773
@23Skidoo 23Skidoo Allow invoking 'hc-pkg init' via D.S.Program.HcPkg. 1cc6878
@23Skidoo 23Skidoo Add an 'initPackageDB' function to D.S.Register.
Creates an empty package DB at the specified location.
3de1049
@23Skidoo
Member

One major annoyance of the current UI is that you often have to run cabal sandbox-configure twice (first to initialise the sandbox, and after that to configure the package once the dependencies have been installed). I propose that we make sandbox-configure run sandbox-install --only-dependencies automatically after creating a sandbox.

@tibbe
Member
tibbe commented on 2ac0244 Aug 24, 2012

LGTM

@tibbe
Member
tibbe commented on 30d6773 Aug 24, 2012

LGTM

@tibbe
Member
tibbe commented on 1cc6878 Aug 24, 2012

LGTM

@tibbe
Member
tibbe commented on 3de1049 Aug 24, 2012

LGTM

@tibbe
Member
tibbe commented Aug 24, 2012

I only took an initial pass over 53ce8ec as it quite large and there are so many configs created all over the place that my eyes glace over. I think I will have to trust that you tested it enough to make sure that it works.

@23Skidoo
Member

I only took an initial pass over 53ce8ec as it quite large and there are so many configs created all over the place that my eyes glace over.

Most of it is quite straightforward. The most important changes are concentrated in D.C.Sandbox, and the most interesting function there is sandboxConfigure, which determines the compiler and creates the sandbox.

I can try splitting that commit in several parts, e.g. modifications to Distribution/Client/Setup.hs are relatively independent.

@23Skidoo
Member

@tibbe I've split that commit into four parts. Let me know if you want me to split it further.

@tibbe
Member
tibbe commented on bbee0d3 Aug 24, 2012

LGTM

23Skidoo added some commits Aug 24, 2012
@23Skidoo 23Skidoo Declarative descriptions of the preliminary sandbox UI commands. 11e2cf6
@23Skidoo 23Skidoo Replace a 'notice' with a debug message. c3cb22b
@23Skidoo 23Skidoo Implement the preliminary sandbox UI.
Adds five new hidden commands:

    cabal sandbox-configure
    cabal sandbox-add-source
    cabal sandbox-build
    cabal sandbox-install
    cabal dump-pkgenv
d8fcb94
@tibbe tibbe merged commit d8fcb94 into haskell:master Aug 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment