-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgREST static build #92
Comments
@nh2 got a first real issue when switching to "ghc883":
Code used is on this branch: https://github.com/monacoremo/postgrest-static-test/tree/ghc883 It's a mystery to me why 8.8.3 depends on 8.6.5 at all - do you have an idea maybe? EDIT: seems to be for bootstrapping the build of GHC 8.8.3. Is it actually required that we build a GHC on Musl? Would the regular one not also be able to generate static executables? See e.g. NixOS/nixpkgs#57238 (comment) It's an upstream issue probably, submitted here: NixOS/nixpkgs#85924 |
Second issue is with
Seems that cabal2nix is not compatible with the older Cabal library - @nh2, do you have an idea on how we could fix this elegantly? Edit: this is where we are trying to use it: https://github.com/monacoremo/postgrest/blob/c239f4f77be2e01a8612b71d96ed7225c12b6b5d/nix/static.nix#L34 Edit 2: Kind of solved this one with https://github.com/monacoremo/postgrest/blob/e6eb7750d738267e5e9cd2422c642a82957cab98/nix/static/default.nix#L33 - but not sure why this behaved differently from the dynamic build |
First: This is great progress, congrats!
We might want to ask @peti on whether |
|
I forgot to post here: Yesterday I made a small PR to |
PostgREST now has a working static build in CI, which solves a lot of problems. Many thanks for this awesome project @nh2 ! It works great on the current nixpkgs-unstable and with ghc883 (the latter currently requires a patch that reverts ghc865-binary to ghc863-binary). Cabal2nix is still a bit tricky, but we got it to work by pinning Cabal 3.0.0.0. Not sure why it does not work with the default Cabal. |
That's awesome congrats! |
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:
(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).
(recommended:
cachix use static-haskell-nix
; runnix-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.No issues - some test suites took a very long time to run. I skipped and disabled those, to be investigated.
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)
respository
Working solution here: https://github.com/monacoremo/postgrest/blob/e6eb7750d738267e5e9cd2422c642a82957cab98/nix/static/ - bit of a hack, see the comment below.
To do:
The text was updated successfully, but these errors were encountered: