Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement sandbox add-source --snapshot #1143

Closed
23Skidoo opened this issue Dec 11, 2012 · 8 comments · Fixed by #1296
Closed

Implement sandbox add-source --snapshot #1143

23Skidoo opened this issue Dec 11, 2012 · 8 comments · Fixed by #1296

Comments

@23Skidoo
Copy link
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
Copy link
Member Author

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

@tibbe
Copy link
Member

tibbe commented Dec 11, 2012

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
Copy link
Member Author

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
Copy link
Member

tibbe commented Dec 11, 2012

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
Copy link
Member Author

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
Copy link
Member

tibbe commented Dec 11, 2012

Lets go with add-source --snapshot then.

@23Skidoo
Copy link
Member Author

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

@23Skidoo
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants