You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if cabal made foreign-libraries available at cabal run time. There are various ways this could work, and I freely admit that what I describe below is just one idea for this.
I am developing an application with three components: a Haskell executable, a third-party executable (not controlled by cabal), and a shared library which will be loaded by the third-party executable to facilitate communication with the Haskell executable. I'd like cabal to be in charge of building the shared library and making it available to the third-party executable.
I have found I can get cabal to build the library by making a foreign-library stanza. This results in a suitable .so file being created inside dist-newstyle; if I cabal install, I expect that .so would even be placed somewhere reasonably discoverable (I haven't tested this). But I don't see a (robust) way of finding that file from within either my Haskell executable or the third-party executable during development.
It would be nice if cabal created a directory inside dist-newstyle with links to the foreign-library build products, then set the appropriate environment variable so that Paths_foo.getDynLibDir returned that directory. Bonus points if I can add foo:bar to the build-depends field to tell cabal that I depend on package foo's foreign-library bar and ensure that the appropriate link/build product is up-to-date when calling cabal run.
The text was updated successfully, but these errors were encountered:
It would be nice if cabal made foreign-libraries available at
cabal run
time. There are various ways this could work, and I freely admit that what I describe below is just one idea for this.I am developing an application with three components: a Haskell executable, a third-party executable (not controlled by cabal), and a shared library which will be loaded by the third-party executable to facilitate communication with the Haskell executable. I'd like cabal to be in charge of building the shared library and making it available to the third-party executable.
I have found I can get cabal to build the library by making a
foreign-library
stanza. This results in a suitable.so
file being created insidedist-newstyle
; if Icabal install
, I expect that.so
would even be placed somewhere reasonably discoverable (I haven't tested this). But I don't see a (robust) way of finding that file from within either my Haskell executable or the third-party executable during development.It would be nice if
cabal
created a directory insidedist-newstyle
with links to theforeign-library
build products, then set the appropriate environment variable so thatPaths_foo.getDynLibDir
returned that directory. Bonus points if I can addfoo:bar
to the build-depends field to tell cabal that I depend on packagefoo
'sforeign-library bar
and ensure that the appropriate link/build product is up-to-date when callingcabal run
.The text was updated successfully, but these errors were encountered: