Implement `sandbox add-source --snapshot` #1143

Closed
23Skidoo opened this Issue Dec 11, 2012 · 8 comments

Projects

None yet

2 participants

@23Skidoo
Haskell member

As documented in #1121, ultimately we want to have minimal rebuilds for add-source dependencies so that they aren't reinstalled on each cabal build (even when nothing was changed). However, this won't be included in the next release, so we need some interim solution for the time being.

My proposal:

  • Rename sandbox add-source to sandbox link-source to emphasise that changes in the source are tracked.
  • Add two new hidden sandbox subcommands: add-source and update-deps. The new add-source just installs the dependency and remembers its location, but does not track changes in the source. The update-deps command reinstalls all add-source dependencies and their reverse dependencies.
  • Remove add-source and update-deps once minimal rebuilds are implemented.

edit: We agreed on a different UI (see discussion below).

@23Skidoo 23Skidoo was assigned Dec 11, 2012
@23Skidoo
Haskell member

An alternative (and easier) solution is to add a flag to disable automatic rebuilding of add-source dependencies, e.g. build --no-deps.

@tibbe
Haskell member

Rename sandbox add-source to sandbox link-source to emphasise that changes in the source are tracked.

We should think about the naming even if we don't add a no-rebuild flag.

Add two new hidden sandbox subcommands: add-source and update-deps. The new add-source just installs the dependency and remembers its location, but does not track changes in the source. The update-deps command reinstalls all add-source dependencies and their reverse dependencies.

I'd like to avoid adding to many new commands. We could add a --snapshot flag to add-source instead that would behave like cabal-dev's add-source (i.e. install once when add-source is run).

I'm inclined to hurry slowly here. I don't know yet if this rebuilding will be a problem. Perhaps once we've implemented the final sandbox UI we could try it out for a bit and see.

@23Skidoo
Haskell member

We could add a --snapshot flag to add-source instead that would behave like cabal-dev's add-source (i.e. install once when add-source is run).

There also has to be a mechanism to manually reinstall all add-source snapshots and their reverse dependencies.

Perhaps once we've implemented the final sandbox UI we could try it out for a bit and see.

I think that this should go into 1.18, perhaps as an undocumented feature. I use this often with cabal-dev when working on Cabal.

@tibbe
Haskell member

There also has to be a mechanism to manually reinstall all add-source snapshots and their reverse dependencies.

You would run cabal add-source --snapshot again, just like you would with cabal-dev.

I think that this should go into 1.18, perhaps as an undocumented feature. I use this often with cabal-dev when working on Cabal.

I'm fine with that. We should settle on the naming for the add-source/link-source command first and then see if we should add a flag or a new command to support not rebuilding.

@23Skidoo
Haskell member

You would run cabal add-source --snapshot again, just like you would with cabal-dev.

Yes, this makes sense.

We should settle on the naming for the add-source/link-source command first

I'm okay with either name.

and then see if we should add a flag or a new command to support not rebuilding.

I like your add-source --snapshot proposal.

@tibbe
Haskell member

Lets go with add-source --snapshot then.

@23Skidoo
Haskell member

This will have to wait a little bit - I have some exams coming up.

@23Skidoo
Haskell member

If I implement #1121, there'll be less need for snapshots. Additionally, there is a way to emulate snapshots using shared sandboxes:

$ cd cabal
$ cabal sandbox init
$ cd Cabal
$ cabal sandbox init --sandbox ../.cabal-sandbox
$ cabal install
$ cd ../cabal-install
$ cabal sandbox init --sandbox ../.cabal-sandbox
$ cabal install

Installing a new snapshot of Cabal:

$ cabal install --reinstall ../Cabal
@23Skidoo 23Skidoo added a commit that closed this issue Apr 28, 2013
@23Skidoo 23Skidoo Implement 'sandbox add-source --snapshot'.
Unlike 'cabal-dev', we don't create a tarball, but simply copy the files to a
private location.

Fixes #1143.
20fe448
@23Skidoo 23Skidoo closed this in 20fe448 Apr 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment