Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  > Ideally, getting a basic setup going shouldn't take a
  > deep-read of the docs of my package manager.
Please name one package manager which installs binaries to the user's home directory, but doesn't require updating the user's $PATH.


>>Ideally, getting a basic setup going shouldn't take a deep-read of the docs of my package manager.

>Please name one package manager which installs binaries to the user's home directory, but doesn't require updating the user's $PATH.

Do you even realize how little those two statements follow each other? The whole red herring argument here is kind of annoying, but I'll hit it anyways- every package manager that I've used which installs binaries (or anything, really) in the user's home directory (or any directory really) does make me update the path- but it also tells me this and gives me sane errors when that hasn't happened.


In my experience, other package managers (my experience is with Python's and Ruby's) will behave just like Haskell's. Specifically, they do not seem to inspect the user's $PATH variable to determine whether their default installation directory is present.


Having used both Haskell's package manager cabal and Python's pip and easy_install. Cabal has a long way to go before it's anything like pip. You can see cabal moving in the right direction, but pip is leagues ahead of it right now, especially when using virtualenv.


In what ways do you find pip better than cabal, or pip+virtualenv better than cabal-dev?


I agree with everything you have posted.


1. npm When installing packages with the --local flag, the npm package manager moves up the pwd path, looking for a node_modules directory. Once installed there, packages can be required by package name in dependent scripts. Common use case is to put a node_modules directory in your home directory to keep multi-project development dependencies out of your global system node install.

2. Ivy/Maven. Dependencies are placed in ~/.ivy, and are available for use without changing environment variables.

3. rubygems. A ~/.gems directory is created that provides dependencies by ruby version, if you wish.

Now, running a clis still requires an addition to path. But package managers do exist that organize dependencies on the user path without explicit environment variable edition.


Cabal does not require editing $PATH to use newly-installed libraries.

The problem he reports is that when he upgrades the Cabal binary by running 'cabal install cabal-install', the sequence of events is:

1. The system runs /usr/bin/cabal

2. Cabal fetches and builds the new binary

3. The new binary is installed to $HOME/.cabal/bin/

4. When he runs 'cabal update' again, it still uses /usr/bin/cabal because $HOME/.cabal/bin/ is not on his $PATH


Sounds like pip (popular package manager for Python) avoids this problem because you don't use pip to install or upgrade itself. If using the package manager to install updated versions of itself is an intended use case, then I agree with others: it should check your path after the install and make sure the newly installed binary is the one that will get used. Otherwise the design is making it too easy to do the wrong thing.


You think that's the only potential gotcha when using cabal-install?


leiningen




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: