[Hackage] #289: symlink binaries into ~/bin
Hackage
trac at galois.com
Sun Aug 3 06:50:48 EDT 2008
#289: symlink binaries into ~/bin
---------------------------------+------------------------------------------
Reporter: duncan | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Cabal-1.4
Component: cabal-install tool | Version:
Severity: normal | Resolution:
Keywords: | Difficulty: very easy (<1 hour)
Ghcversion: 6.8.2 | Platform:
---------------------------------+------------------------------------------
Comment (by Isaac Dupree):
Replying to [ticket:289 duncan]:
> Currently cabal-install uses `--prefix=$HOME/.cabal` and does not
specify `--bindir` so we use `$HOME/.cabal/bin` as the bindir. Obviously
this is not on the `$PATH` by default.
of course, neither is any other dir in `$HOME` in `PATH` by default, I
just add `$HOME/.cabal/bin` to my `PATH` :-) ...in addition to using GNU
Stow elsewhere to keep track of my non-Cabal stuff.
> If the name does exist we could give a warning and let the user sort it
out.
okay, by telling them (if they want it) what symlink to make? or having a
cabal "update-bin-symlinks" maybe?
> Of course we need to be able to overwrite our own symlinks. We know it's
a symlink we're allowed to overwrite if it links into `$HOME/.cabal/bin`.
yep, that's the same heuristic that Stow uses -- pretty good. Hmm.. watch
out, for people who use Stow itself, Stow might leave `bin` dir being a
("folded") symlink to somewhere you don't want to install to, such as
`$HOME/stow/darcs-2.0.2/bin` ;-)
> It would be nice to install into `$HOME/.cabal/bin` using versioned
binary names (Cabal supports that now)
true!
> and symlink the generic name into `$HOME/bin`.
I want the generic names somewhere well-defined under `$HOME/.cabal` too.
And the versioned names should also be symlinked.
> and there are no symlinks on windows.
:-( With greater hacks, we could generate wrapper binaries/scripts on
Windows that just load the thing in `$HOME/.cabal/bin`, I suppose -- but
maybe Windows users are used to the lack of symlinks?
> I'd imagine we'd have it in the `~/.cabal/config` file something like:
> {{{
> prefix: $HOME/.cabal
> -- bindir: $HOME/.cabal/bin
> symlink-bindir: $HOME/bin
> }}}
I guess defaulting to `$HOME/bin` "if it exists as a non-symlink
directory" would be a heuristic that's not too unreasonable if you want a
silent default. (silence is what makes people like me not know about the
existence of `$HOME/.cabal/bin` until we find out about it, too!) (Which
reminds me, yet another reason not to put anything of my own making under
`$HOME`, because programs might automatically trample it for their own
heuristic purposes, thinking they know what's best for me and doing it
behind my back without my permission -- I keep my $HOME in /Users/me/HOME,
which might be called /home/isaac/HOME under more-normal circumstances)
-Isaac
--
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/289#comment:3>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects
More information about the cabal-devel
mailing list