-
Notifications
You must be signed in to change notification settings - Fork 701
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
option --enable-relocatable
ignored in new-build
#5551
Comments
What are you packaging? Do you really need to package libraries which some GHC is going to compile things against? Note that even if If the target install folder is already known, and you can write to it already, you can also use Also related is #4097 |
I believe so. I'm trying to package Clash, a Haskell to HDL compiler. Clash (≈GHC+wrapper) needs the packages to be able to compile user code.
I feared as much. I, naively, hoped I could hack my way through it by replacing those strings in there too - as the installation directory is almost certainly shorter than the cabal store path. (Thus replacing the old string by the new installation path plus a number of NUL bytes.)
Right, of course, thanks for that pointer. I might be able to set something up in combination with fakeroot/chroot then. I'll investigate. |
I don't think there is a
|
@martijnbastiaan Sorry, I was already assuming we had merged that aliasing PR which adds the
and it'll start populating /tmp/store as for the binary-patching... that's risky and may break easily if GHC switches to a length-prefixed representation for string literals, and it might get tricky if unfoldings are involved |
I agree. I'm pretty optimistic about the |
/cc @christiaanb |
@martijnbastiaan ...did you have success w/ the |
Not really.. The way I solved it is still quite hacky, but at least it works for now.. *edit: correct link |
Report: after building with
--enable-relocatable
I expect packages built in my cabal store (~/.cabal
) to only contain relative paths. This is not the case. For example,~/.cabal/store/ghc-8.4.3/package.db/async-2.2.1-f6fb9f5a60e7ad9ce092fee6ef572c10f40bde7d58e9da909b9bc7ccddb27749.conf
mentions:I believe either the documentation should be more explicit about what the flag tries to achieve, or cabal should produce relative paths.
Use case: I need to ship packages bundled with a program I'm trying to package as a snap/flatpack/deb. It's not enough to simply incorporate the library files in the binary, as I explicitly need the packages themselves. Right now, I'm trying to manually rewrite the paths mentioned in
~/.cabal
. If there's a better way, I'd love to hear it.The text was updated successfully, but these errors were encountered: