
Hi Haskellers, Cabal couldn't resolve dependencies for a generated package so I used Stack that used 2 different GHC versions to build library from this package. Stack stored the library as libHSclient-something.a , HSclient-something.o and helper ".hi" files The dependent libraries Stack stored and registered at C:\sr..\lib\ How to add this information to GHC or Cabal database to be able to use this new library? This is on Chocolatey managed Windows platform;-)

Technically I think GHC doesn’t support .hi files built with different GHCs, unfortunately. I don’t think that cabal-install supports binary packages as far as I know :(
On Aug 27, 2020, at 3:57 PM, Sylvester Hazel via Haskell-Cafe
wrote: Hi Haskellers, Cabal couldn't resolve dependencies for a generated package so I used Stack that used 2 different GHC versions to build library from this package. Stack stored the library as libHSclient-something.a , HSclient-something.o and helper ".hi" files
The dependent libraries Stack stored and registered at C:\sr..\lib\
How to add this information to GHC or Cabal database to be able to use this new library? This is on Chocolatey managed Windows platform;-)
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

The command 'stack ghci' configured older GHCi version 8.6.3 with all the
needed packages.
It is possible to reason about this library now.
However, how to extend/modify this library and incorporate in my target
(non-trivial) project is still beyond me.
There must be some way of reverse engineering this binary library to .hs
scripts, so I could add this modified to my project?
On Thu, Aug 27, 2020 at 11:37 PM Vanessa McHale
Technically I think GHC doesn’t support .hi files built with different GHCs, unfortunately.
I don’t think that cabal-install supports binary packages as far as I know :(
On Aug 27, 2020, at 3:57 PM, Sylvester Hazel via Haskell-Cafe < haskell-cafe@haskell.org> wrote:
Hi Haskellers,
Cabal couldn't resolve dependencies for a generated package so I used Stack that used 2 different GHC versions to build library from this package. Stack stored the library as libHSclient-something.a , HSclient-something.o and helper ".hi" files
The dependent libraries Stack stored and registered at C:\sr..\lib\
How to add this information to GHC or Cabal database to be able to use this new library? This is on Chocolatey managed Windows platform;-) _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

On Fri, 28 Aug 2020, Sylvester Hazel via Haskell-Cafe wrote:
The command 'stack ghci' configured older GHCi version 8.6.3 with all the needed packages. It is possible to reason about this library now. However, how to extend/modify this library and incorporate in my target (non-trivial) project is still beyond me. There must be some way of reverse engineering this binary library to .hs scripts, so I could add this modified to my project?
There might be a set of versions of all libraries to build your project, but one library may have too restrictive version bounds. Cabal is more flexible than Stack in choosing sets of versions. You may use cabal's option --allow-newer=pkg1,pkg2,pkg3 and check whether Cabal can build your project anyway.

Dear Henning, Your advice indeed forced Cabal to perform but it choked on 'mingw/bin/ld.exe' when building 'zlib'. So, I cannot comment whether that merry run is able to produce working library, just because of ignoring dependency constraints. Stack has built zlib in ghc-8.8.3 which for the above purpose is useless ...unless somebody will offer a solution to my main question: how to include old GHC Stack builds in current GHC work? Cabal: Building library for zlib-0.6.2.2.. [1 of 5] Compiling Codec.Compression.Zlib.Stream ( dist\build\Codec\Compression\Zlib\Stream.hs, dist\build\Codec\Compression\Zlib\Stream.o ) ghc.exe: could not execute: C:/GitLabRunner/builds/2WeHDSFP/0/ghc/ghc/inplace/mingw/bin/ld.exe cabal.exe: Failed to build zlib-0.6.2.2 Regards:-) On Fri, Aug 28, 2020 at 1:14 AM Henning Thielemann < lemming@henning-thielemann.de> wrote:
On Fri, 28 Aug 2020, Sylvester Hazel via Haskell-Cafe wrote:
The command 'stack ghci' configured older GHCi version 8.6.3 with all the needed packages. It is possible to reason about this library now. However, how to extend/modify this library and incorporate in my target (non-trivial) project is still beyond me. There must be some way of reverse engineering this binary library to .hs scripts, so I could add this modified to my project?
There might be a set of versions of all libraries to build your project, but one library may have too restrictive version bounds.
Cabal is more flexible than Stack in choosing sets of versions. You may use cabal's option --allow-newer=pkg1,pkg2,pkg3 and check whether Cabal can build your project anyway.

On 28/08/2020 01.06, Sylvester Hazel via Haskell-Cafe wrote:
The command 'stack ghci' configured older GHCi version 8.6.3 with all the needed packages. It is possible to reason about this library now. However, how to extend/modify this library and incorporate in my target (non-trivial) project is still beyond me. There must be some way of reverse engineering this binary library to .hs scripts, so I could add this modified to my project?
Is your project using Cabal or Stack or something else? Either way, I don't think you're going to have any luck trying to 'port' or register stack-built libraries with the system's GHC or with Cabal. Regards,
participants (4)
-
Bardur Arantsson
-
Henning Thielemann
-
Sylvester Hazel
-
Vanessa McHale