nh2 / static-haskell-nix

easily build most Haskell programs into fully static Linux executables
388 stars 36 forks source link

Postgresql tests fail #110

Open pranaysashank opened 2 years ago

pranaysashank commented 2 years ago

When I try to build postgresql (version 13), two tests collate.icu.utf8 and foreigndata fail.

I noticed that the alpine repos have a patch to disable the collate.icu.utf8 which is perhaps relevant.

pranaysashank commented 2 years ago

I applied the patch mentioned above and it makes postgres build. For packages that depend on postgres it looks like I also need to pass the following configure flags in addition to libpq.

--ld-option=-lpgcommon --ld-option=-lpgport

So for example to get a statically build executable for tmp-postgres, I'd need to change the definition in survey to

 tmp-postgres =
                appendConfigureFlag (addStaticLinkerFlagsWithPkgconfig
                  super.tmp-postgres
                  [ final.openssl final.postgresql ]
                  "--libs openssl libpq")
                  ["--ld-option=-lpgcommon --ld-option=-lpgport"];

Can anyone else reproduce this and is there a way to avoid adding them manually.