How to use a precompiled library in stack

30 views
Skip to first unread message

Rodolpho Pueyrredón

unread,
Mar 3, 2021, 4:10:45 PM3/3/21
to haskell-stack

Hi guys.

I took the RethinkDB 2.2 library from Hackage and compiled it on the stack. As a result I now have these various hi files.

Captura de tela_2021-03-03_18-01-20.png

I was wondering how I can use this within another stack project.

I wanted to use import Database.RethinkDB normally like any other module.

IC Rainbow

unread,
Mar 4, 2021, 9:54:33 AM3/4/21
to Rodolpho Pueyrredón, haskell-stack
Add the package to your project dependencies. No need to compile it yourself.



--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/a1553317-db5f-4bed-8bcb-c62e452d17a5n%40googlegroups.com.

Rodolpho Pueyrredón

unread,
Mar 4, 2021, 11:18:09 AM3/4/21
to haskell-stack
I tried this, but incompatibilities appear. The rethinkdb package is a little old.

Captura de tela_2021-03-04_13-11-03.png

I tried to use 'allow-newer', but it gives error. The rethinkdb-2.2.0.10 package requires another, older version of the GHC. I don't know how to get around this. So when I compile separately it works because it uses the right version.

That is, I would have to compile the code with a newer version of the GHC and only for that package to use an old version. But I don't think that can be done.

IC Rainbow

unread,
Mar 4, 2021, 12:56:39 PM3/4/21
to Rodolpho Pueyrredón, haskell-stack
According to its configuration[1] you can use
resolver: nightly-2017-05-07


That's kinda old, yes. Maybe it wouldn't even work after all the protocol updates.



Rodolpho Pueyrredón

unread,
Mar 8, 2021, 12:31:03 PM3/8/21
to haskell-stack
Thanks for the tip. But I decided to adapt the driver and found it was easy. Now I can work with a more recent lts. Even so thanks brother
Reply all
Reply to author
Forward
0 new messages