Skip to content

PostgREST static build #92

@monacoremo

Description

@monacoremo

Thank you again @nh2 for this awesome project!

Working on getting static builds of PostgREST to work here: https://github.com/monacoremo/postgrest-static-test , towards PostgREST/postgrest#1295

Progress so far:

  • Build dynamic executable from Hackage based on static-haskell-nix nixpkgs
    (run nix-build -A dynamic)

Did this first to make sure I got the haskellPackages overrides right (fix broken packages, add dependencies, skip tests where required).

  • Build static executable based on static-haskell-nix defaults
    (recommended: cachix use static-haskell-nix; run nix-build -A static) (!!)

This is basically the 'approach 1' from your #88 comment. It required adding the libpq linking fix for the postgrest package, see PR #91. This PR is of limited use by itself, as several package needed to be overridden in order to get there, including postgrest.

The tests for happy took a long time to run and never finished for me, so I disabled them in the haskellPackages overlay. Not sure if that is an overall issue or if it worked before for you. I saw that you disabled several other test suites because of this issue.

  • Use integer-simple

No issues - some test suites took a very long time to run. I skipped and disabled those, to be investigated.

  • Switch to a newer pinned nixpkgs version

No issues, and this allowed to remove all haskellPackages overrides but the disabled slow test suites. Going much smoother than expected! (Edit: next step is more difficult, please see comment below)

  • Replace the Hackage version with using callCabal2nix in the PostgREST
    respository

Working solution here: https://github.com/monacoremo/postgrest/blob/e6eb7750d738267e5e9cd2422c642a82957cab98/nix/static/ - bit of a hack, see the comment below.

To do:

  • Use a newer compiler, ghc883

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions