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

Upgrade nixpkgs #2479

Merged
merged 10 commits into from
Oct 28, 2022
Merged

Upgrade nixpkgs #2479

merged 10 commits into from
Oct 28, 2022

Conversation

robx
Copy link
Contributor

@robx robx commented Sep 19, 2022

Attempt to upgrade nixpkgs. I initially tried this in #2349, where it caused trouble with the static build, prompting me to file #2478, so chances are there'll be problems with the static build here.

@robx
Copy link
Contributor Author

robx commented Sep 20, 2022

The problem was:

error: infinite recursion encountered

       at /nix/store/46v5hkwaa7aadrdn3gadlcx8ckrv3brj-source/pkgs/stdenv/generic/make-derivation.nix:311:7:

          310|       depsBuildBuild              = lib.elemAt (lib.elemAt dependencies 0) 0;
          311|       nativeBuildInputs           = lib.elemAt (lib.elemAt dependencies 0) 1;
             |       ^
          312|       depsBuildTarget             = lib.elemAt (lib.elemAt dependencies 0) 2;
(use '--show-trace' to show detailed location information)
Error: Process completed with exit code 1.

which somehow involved the lens override which used callHackageDirect to fetch lens-5.1. Now changed to use nixpkgs-provided lens-5.2 (although it's entirely unclear what was the problem -- we use callHackageDirect just fine for e.g. hasql-pool.

@robx robx marked this pull request as ready for review September 20, 2022 13:01
@robx
Copy link
Contributor Author

robx commented Sep 20, 2022

The static build failed after 5h with

2022-09-20T17:15:52.1934543Z Linking dist/build/hackage2nix/hackage2nix ...
2022-09-20T17:15:54.0546032Z /nix/store/z86a6y1k0r6d5fh9sqxbc1g58bhz8fwq-binutils-2.38/bin/ld: cannot find -lcrypto: No such file or directory
2022-09-20T17:15:54.1512793Z collect2: error: ld returned 1 exit status
2022-09-20T17:15:54.1519001Z `cc' failed in phase `Linker'. (Exit code: 1)
2022-09-20T17:15:54.3045895Z error: builder for '/nix/store/r8wdinc30dfgiwhzi73h2m5p781zaavn-cabal2nix-2.19.0.drv' failed with exit code 1;
2022-09-20T17:15:54.3046349Z        last 10 log lines:
2022-09-20T17:15:54.3046722Z        > [18 of 18] Compiling Cabal2nix        ( src/Cabal2nix.hs, dist/build/Cabal2nix.o, dist/build/Cabal2nix.dyn_o )
2022-09-20T17:15:54.3047284Z        > Preprocessing executable 'hackage2nix' for cabal2nix-2.19.0..
2022-09-20T17:15:54.3047778Z        > Building executable 'hackage2nix' for cabal2nix-2.19.0..
2022-09-20T17:15:54.3048546Z        > [1 of 3] Compiling HackageGit       ( hackage2nix/HackageGit.hs, dist/build/hackage2nix/hackage2nix-tmp/HackageGit.o, dist/build/hackage2nix/hackage2nix-tmp/HackageGit.dyn_o )
2022-09-20T17:15:54.3049540Z        > [2 of 3] Compiling Paths_cabal2nix  ( dist/build/hackage2nix/autogen/Paths_cabal2nix.hs, dist/build/hackage2nix/hackage2nix-tmp/Paths_cabal2nix.o, dist/build/hackage2nix/hackage2nix-tmp/Paths_cabal2nix.dyn_o )
2022-09-20T17:15:54.3050813Z        > [3 of 3] Compiling Main             ( hackage2nix/Main.hs, dist/build/hackage2nix/hackage2nix-tmp/Main.o, dist/build/hackage2nix/hackage2nix-tmp/Main.dyn_o )
2022-09-20T17:15:54.3051284Z        > Linking dist/build/hackage2nix/hackage2nix ...
2022-09-20T17:15:54.3051874Z        > /nix/store/z86a6y1k0r6d5fh9sqxbc1g58bhz8fwq-binutils-2.38/bin/ld: cannot find -lcrypto: No such file or directory
2022-09-20T17:15:54.3052307Z        > collect2: error: ld returned 1 exit status
2022-09-20T17:15:54.3052703Z        > `cc' failed in phase `Linker'. (Exit code: 1)
2022-09-20T17:15:54.3053269Z        For full logs, run 'nix log /nix/store/r8wdinc30dfgiwhzi73h2m5p781zaavn-cabal2nix-2.19.0.drv'.
2022-09-20T17:15:54.6386096Z error: 1 dependencies of derivation '/nix/store/9x4vrv2dj7vr9pq300lxpyqrlng239q3-cabal2nix-postgrest.drv' failed to build

😭

@robx
Copy link
Contributor Author

robx commented Sep 30, 2022

A wild stab at a fix for the hackage2nix -lcrypto error: In nixpkgs commit 2a49c87bc5365ebbaad4cc3eebdec78b2474cf6e, hopenssl was changed to depend on openssl_1_1 instead of openssl. So b8a3be8 patches static-haskell-nix to apply the same static linking override to openssl_1_1 as to openssl. I'm a bit unsure whether the openssl_1_1 change is even new with respect to this nixpkgs bump though. Let's see how the static build goes...

@steve-chavez
Copy link
Member

steve-chavez commented Sep 30, 2022

Q: Which dependency requires lcrypto, libpq?

If this has something to do with postgis, I was thinking we could remove it from the nix packages.

@robx
Copy link
Contributor Author

robx commented Oct 1, 2022

I think my latest changes might have fixed the build, but it seems it's being timed out after 360 minutes...

Not sure what to do about this. Could we try to somehow seed cachix with some partial dependencies, e.g. just the ghc and base packages?

Q: Which dependency requires lcrypto, libpq?

If this has something to do with postgis, I was thinking we could remove it from the nix packages.

It's via cabal2nix (or its component hackage2nix).

@steve-chavez
Copy link
Member

steve-chavez commented Oct 3, 2022

but it seems it's being timed out after 360 minutes...

Yeah, it says 6 hours here: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits.

Could we try to somehow seed cachix with some partial dependencies, e.g. just the ghc and base packages?

Yes, could you remind me which command I need to run for this? I'll create a temporary cachix token(I've also followed up on this on email).

@wolfgangwalther
Copy link
Member

Yes, could you remind me which command I need to run for this?

There is a postgrest-push-cachix command. Is that what you're looking for?

@wolfgangwalther
Copy link
Member

just rebased. I pushed cachix before, so that CI doesn't time out.

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

Successfully merging this pull request may close these issues.

3 participants