Cabal: [nix-local-build] new-install interface for installing executables

Created on 13 Apr 2016  路  7Comments  路  Source: haskell/cabal

Suppose you want to install pandoc. How would you do so using the Nix-local build interface? new-install is not supported, so you can't. Installing executables is, indeed, a really good reason why we need new-install: to manage a "Nix profile", which is the actual set of packages available to a user's PATH. I suppose we also want the ability to rollback (like in Nix) in case someone installs something they don't like. These would also be considered roots for any sort of hypothetical GC mechanism.

Here's an even easier way to do it: to new-install an executable, first install it into the store, and then create a symlink from .cabal/bin to this executable.

(@hvr says: see also #4558)

nix-local-build enhancement

Most helpful comment

I suppose we also want the ability to rollback

Eventually sure. And we don't want to tie our hands up implementing it later. However I think this cabal new-install feature alone without ability to roll back is very valuable on its own and will give many the option of using cabal new-build rather than stack in their workflows.

All 7 comments

I suppose we also want the ability to rollback

Eventually sure. And we don't want to tie our hands up implementing it later. However I think this cabal new-install feature alone without ability to roll back is very valuable on its own and will give many the option of using cabal new-build rather than stack in their workflows.

Is there a blocking issue for this feature or just no one has tried to implement it yet?

Is there a blocking issue for this feature or just no one has tried to implement it yet?

IIUC, the latter.

Thanks. I think this is a very useful feature even without the rollback feature or the GC mechanism mentioned in the description. I'll see later if I can quickly implement it.

This script by @hvr can be used as a starting point for the implementation: https://gist.github.com/hvr/c77c54d682555b7dd4fe1248732fe978

13:47 <hvr> I use that script a lot for stuff like alex/happy/pandoc/hakyll/hlint/stylish-haskell
13:48 <hvr> the thing I like about it is that I can reuse/share buildtools
13:48 <hvr> w/ what cabal  new-build automatically builds to satisfy build-tools
13:48 <hvr> and I can quickly get access to different versions
13:48 <hvr> of the same tool

This is partially done (nonlocal exes) with #4825.
Also, can we close this in favor of #4558?

Closing in favour of #4558.

Was this page helpful?
0 / 5 - 0 ratings