Skip to content
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

Bump to nixpkgs-21.11 #111

Closed
wants to merge 15 commits into from
Closed

Conversation

cdepillabout
Copy link
Contributor

@cdepillabout cdepillabout commented Dec 15, 2021

This PR bumps to nixpkgs-21.11 (NixOS/nixpkgs@5730959), which contains LTS-18.17 and uses ghc-8.10.7.

This PR fixes or disables all the packages in working and workingStackageExecutables, so ci.nix should succeed.

@cdepillabout cdepillabout marked this pull request as ready for review December 17, 2021 06:14
@cdepillabout
Copy link
Contributor Author

I started working on this because I wanted to use static-haskell-nix for one of my personal projects, which is based on nixpkgs-21.11.

@nh2 In the past it looks like static-haskell-nix has followed Nixpkgs master (not one of the release branches). This PR changes static-haskell-nix to use 21.11. However, the 21.11 branch-off has just occurred, so I imagine most of the changes in this PR would also be necessary if the latest master was used instead.

@@ -1,3 +1,3 @@
[submodule "nixpkgs"]
path = nixpkgs
url = https://github.com/nh2/nixpkgs.git
url = https://github.com/NixOS/nixpkgs.git
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the submodule here to point to NixOS/nixpkgs instead of nh2/nixpkgs.

I'm not very familiar with Git submodules, and I did this while trying to get everything working. If necessary I can change this back.

@@ -12,7 +12,7 @@ let
pname = "example-scotty-app";
version = "0.1.0.0";
src = pkgs.lib.sourceByRegex ./. [
".*\.cabal$"
".*\\.cabal$"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this extra escape is necessary.

@@ -21,7 +21,7 @@ let
enableSharedExecutables = false;
enableSharedLibraries = false;
executableHaskellDepends = [ base scotty ];
license = stdenv.lib.licenses.bsd3;
license = pkgs.lib.licenses.bsd3;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdenv no longer contains lib in recent Nixpkgs.

Comment on lines 268 to 277
# PostgreSQL's test suite doesn't pass:
# https://github.com/NixOS/nixpkgs/issues/150930
#
# Even if the test suite is disabled, these Haskell binaries fail in
# linking with errors like:
#
# ld: libpq.a(fe-auth-scram.o): in function `pg_fe_scram_build_secret':
# /build/postgresql-13.4/src/interfaces/libpq/fe-auth-scram.c:839:0: error:
# undefined reference to `pg_saslprep'
"hasql-notifications" "hasql-queue" "postgresql-orm" "postgrest" "tmp-postgres"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of unfortunate.

I created an issue in Nixpkgs, but it sounds like the alpine developers also had a bunch of trouble getting postgres-13 building: NixOS/nixpkgs#150930

I guess we could do something like actively use postgres_12 instead of 13 here in static-haskell-nix, but it would be great to just do that in a separate PR for someone that is interested in getting PostgreSQL working.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still some stackage executables that depend on the test-failing postgres.

I think we should do what you say, and override postgres to be postgres_12 until nixpkgs has a fix for that.

That should be OK especially because Haskell packages only really use the libpq client part of postgres, which should be fine on older versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry for this, it looks like there was one haskell package (persistent-postgresql?) that did build with postgresql-13 as long as its tests were disabled. Although since I didn't end up disabling the tests for postgres in this PR, I forgot to also add persistent-postgresql to the list of blacklisted packages!


I took your advice and overrode postgresql to be postgresql_11 in 3d0be9a. Now all the stackage executables that use libpq are compiling correctly!

I first tried postgresql_12, but I was seeing strange linking errors with that as well. It would be nice to use a more recent version of postgresql than 11, but hopefully we can just put that off for a future PR.

@cdepillabout
Copy link
Contributor Author

@nh2 This should be ready for review now.

@nh2
Copy link
Owner

nh2 commented Dec 18, 2021

I a CI build of one of your older pushes, commit
6e3e1df, ran through with working working but others not yet: https://buildkite.com/nh2/static-haskell-nix/builds/1024

Started one with the newer commits here:

@cdepillabout
Copy link
Contributor Author

@nh2 With 3d0be9a, I'm hoping that now ci.nix should be fully working.

Looking at buildkite, it looks like stack2nix-example and static-stack pipelines are failing because of ghc8104 no longer existing in Nixpkgs. For instance, in https://buildkite.com/nh2/static-haskell-nix/builds/1030#41e2a511-8117-4ed6-86d6-3312731206d9.

I'm not personally interested in using/fixing either of these, so I don't know if you'd be willing to merge this PR with those still failing. But if not, maybe we could keep this PR open and someone who is interested in those could use this PR as a base to start hacking on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants