-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 support #1295
Comments
@clojurians-org Thanks for the research on this one. Currently I build postgrest on NixOS with a custom shell.nix(see #1298). A static build for Windows would be really great(see #365 (comment)), have you tried using nix there? We could try to integrate your script on appveyor(our CI for producing Windows binaries) as a first step. |
i'm currently using nix static build(postgrest and postgres-websocket). |
Just confirmed the hard way that Docker is not deterministic. Our release pipeline failed with things like an outdated package url on centos6. @clojurians-org Having a static binary released with nix is looking really good now. Do you know of a CI service that provides nix natively? |
Found that Travis supports it https://docs.travis-ci.com/user/languages/nix/ and there's a docker image available for CircleCI https://hub.docker.com/r/nixorg/nix/. |
you can reference hnix project: |
@clojurians-org Could you build a static binary for our latest commit dd86fe3 and share it here?(as tar.gz) |
@clojurians-org Thank you so much! The static binary is working great! I've attached it to our latest release https://github.com/PostgREST/postgrest/releases/tag/v6.0.0 |
Hi there. Someone posted a shorter build definition which also doesn't use pkgsMusl, therefore is much quicker to build: NixOS/nixpkgs#37442 (comment) |
for cache: cachix use static-haskell-nix |
@clojurians-org Could you provide me the nix expression for our latest 6.0.1 version? I'd like to try building the binary myself. |
Is there anything wrong with @infinisil's version? |
@ggPeti Nothing wrong. But that's not a statically linked binary. |
i don't know whether the previous 6.0.0 nix script still working on 6.1. |
the updated default.nix should work with some note. i use jailbreak to loose jose's version dependency as the jose github don't have this version. |
@clojurians-org Thank you! I was able to build the static binary and published it to https://github.com/PostgREST/postgrest/releases/tag/v6.0.1. Regarding jose, I've requested the addition of the git tag frasertweedale/hs-jose#83 (comment). |
It would be great if someone could help me with a new nix expression for the latest version https://github.com/PostgREST/postgrest/releases/tag/v7.0.0. Or better yet, provide me the static binary so I can upload the asset. |
it seems the nix cache has been outdated, the build is very slow. |
I contacted @nh2 for some insights on using his |
Got a first version working here: https://github.com/monacoremo/postgrest-static-test/tree/4788c6bdb398564083802c3eb79b18f1935e243f |
@steve-chavez building those static executables from scratch takes ages, but we could get pretty quick incremental builds if we set up cachix in CI. With CACHIX_SIGNING_KEY configured as an environment variable in CircleCI, we could run something like this: cachix use postgrest # Use the binary cache
nix-build | cachix push postgrest # Build and push new binaries |
* Include modifications to nixpkgs and static-haskell-nix as patches. * use the patched static-haskell-nix version * Add cachix postgrest
currently the postgrest executable build can't run without the libpq reference.
also it can't run on nixos naturally.
i try to build this project with nix's static build. and it's successfuly.
(reference: https://github.com/nh2/static-haskell-nix)
then we only need to copy the executable to any host, it can run on any linux platform.
this is the sample nix build script:
https://github.com/clojurians-org/nix-haskell-build/blob/master/postgrest/default.nix
The text was updated successfully, but these errors were encountered: