-
Notifications
You must be signed in to change notification settings - Fork 699
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
Cabal uses hardcoded not relative path in package descriptors. #1542
Comments
I think there's another old ticket somewhere on making relocatable packages. Note that there is a lot more to it than just using the ${pkgroot} spec. You need a --prefix-independent configure flag to request that you want it to be relocatable. Then there's a bunch of checks to see if it's possible to be relocatable on this platform with the choice of compiler and libraries (e.g. shared libs vs static). Then there are changes in the code to find data files at runtime etc etc. Lots of little things. |
Can we estimate in which cases replacing hardcoded paths by ${pkgroot} is simply safe? If this is simple, implementing this feature would sometimes help a lot - for example making movable ghc Linux tarbars with preinstalled custom global libraries. |
IIUC, if my package DB is located in |
Plese note, that I was talking mainly about global installed libraries. I do not know how to refer to $HOME/.cabal, but maybe reading the appriopriate field from cabal configuration will be enough? I mean - If you've got a library installed in a pkg-db, then when cabal is using it, it knows exactly what pkg-db is using at the moment, so it can easly provide a variable pointing to this pk-db, cannot it? |
I think that the same issue applies to the libraries installed with Perhaps we could solve this by adding a |
@23Skidoo note that if we support a relocatable feature, that doesn't mean cabal-install has to use it by default, and indeed it wouldn't make a lot of sense for us, given the ~/.cabal ~/.ghc split. Relocatable packages make more sense for exes and for specifically crafted bundles. It's not right to "opportunistically" use the ${pkgroot} mechanism. The right thing is to specifically request a relocatable package by configuring with a new --prefix-independent flag, and then doing various checks to make sure that it is possible for the chosen configuration. And then one can go and change pkgname_Paths.hs and register using relative paths etc. |
Right, the reason I'm interested is that this feature would make it easier for me to build the HP installer. Right now I simply copy everything from It'd be nice if I could just use |
@23Skidoo : I'm doing exactly the same. |
@23Skidoo yes, it makes a lot of sense for ghc core or HP binary bundles. And starting with For example:
|
@christiaanb: Is this a duplicate of #462? Does PR#2255 implement all or any of the above? |
@mietek: I wouldn't say this is a duplicate of #462, but the solution to #462(which #2255 partially implements) does solve the problem described in this issue. However, some of the use-cases described here, such as creating the HP installer are just out of reach because because GHC installer doesn't use/know the One (major) flaw in the current implementation (#2255) is that in handles libraries with
Problem 2. could be solved by wrapper schell scripts, such as the |
See #462. |
Hi!
When invoking 'cabal install ' cabal executes ghc-pkg several times, in particular executes 'ghc-pkg update - ' passing package descriptors by stdin.
The problem is, that some fields, like 'import-dirs' use hardcoded paths, like:
/home/myuser/local-ghc-installation/lib/x86_64-linux-ghc-7.6.3/testlib-0.1
instead of:
${pkgroot}/testlib-0.1
the same problem occurs with fields haddock-interfaces and haddock-tml, where we could replace the beggining of the path with "${pkgroot}/../../share/doc/ <...>"
This would make the installation of GHC (with packages installed by cabal) movable on Linux boxes.
The text was updated successfully, but these errors were encountered: