What is the correct way to update the versions of Haskell programs installed in / usr / bin?

I have version 3.0.1 of Alex installed on my /usr/bin . I think the Haskell platform originally put it there (although I'm not 100% sure ...).

Unfortunately, version 3.0.1 is bugged , so I need to upgrade it to version 3.0.5. I tried using cabal to install the latest version of Alex, but cabal install alex-3.0.5 it installed the executable on .cabal/bin on top of my home folder instead of /usr/bin

Am I just manually copying the executable to /usr/bin ? (that sounds like a lot of problems to do all this time)

Am I changing the PATH environment variable so that .cabal/bin before /usr/bin ? (I'm afraid that the executable "ls" or the like in the cabal folder may be messy in my system)

Or is there an easier way to go for it in general?

+4
source share
2 answers

At the same time, putting /.cabal/bin in front of / usr / bin in PATH is easier, and that is what most people do.

This is also not a big problem, since only cabal will put files in .cabal / bin, so it should be predictable and with little risk of overwriting material.

+1
source

I want to first indicate a layout that works well for me, and then suggest how you can act in your specific situation.

What works well for me

In general, I think the best layout should have the following search path:

  • with important non-Haskell binaries
  • which cabal install installed on
  • that the binaries from the Haskell platform are in

Thus, you can use cabal install to update binaries on the Haskell platform, but they cannot accidentally hide some binaries not related to Haskell.

(On my Windows machine, this layout is easy to achieve because the Haskell platform binaries are installed in a separate directory by default. Therefore, I just manually adapt the search path and it. I don’t know how to achieve this on other platforms).

Suggestion for your specific situation

In your specific situation with Haskell platform binaries that are already installed along with non-Haskell binaries, perhaps you can use the following layout for the search path:

  • containing links to some of the binaries in 3
  • with important non-Haskell binaries and Haskell platform executables.
  • which cabal install installs in.

Thus, the binaries from cabal install cannot accidentally obscure important material in 2. But if you decide that you want to obscure something from the Haskell platform, you can manually add a link to 1. If this is a soft link, I think that you you only need to do this once for the program name, and then you can call cabal install for this program to update it. You can even see what executables are associated with the Haskell platform, and do it once and for all.

+3
source

Source: https://habr.com/ru/post/1499054/


All Articles