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
hasura: 1.2.1 -> 1.3.1-beta.1 #95369
Conversation
Ping @offlinehacker @peti |
It was very hard to track this with GHC86 so I just looked for the first version that supported GHC810 and was able to get it to work with some small mods. There is a problem with infinite recursion when trying to override some packages like time, so I agree with @peti 's analysis that this recipe is brittle, but on the other hand, since it is an application and not a library I'd say it is okay to pin some of its dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't duplicate code that we already have in haskellPackages
. We have a very sophisticated infrastructure for packaging Haskell tools and it's a little frustrating that Hazura re-invents the wheel here instead of using the existing solutions.
@peti can you then suggest what would be the way to package hasura (it's not on hackage and uses very specific version constraints for some packages)? |
I am happy to put the work to package it differently, what I did at first was just understand what @offlinehacker had done and update it to latest GHC and Hasura. The dance to get the packages just right is very finicky so there would have to be some exceptions where we pull different versions from Hackage to not need to alter Hasura itself. Here are a few specific examples:
and then used it like:
Notice that this uses the advanced machinery already in Nixpkgs for Haskell (all credit goes to the original author) so it is not necessarily reinventing the wheel, but I do agree that it would be better to do away with the |
@peti Here is some example code from GHC 8.10 currently on master that seems to use two of the patterns used in hasura.nix:
|
Looked at other packages here and found this, instead of making the versions
|
749da61
to
50ce0ec
Compare
I refactored the code to have graphql-engine and other haskell packages correctly as libraries and made the code that compiles the application consist of only jailbreaks and small mods, it is in essence the same code that was running before but makes the packages available for others. @peti Does this satisfy your concerns? |
@ingenieroariel how did you generate |
Ha, manually of course, and after reading your question realizing that was the wrong way ... ... back to reading mode :) |
The issue I see is that hackage2nix can only generate packages from hackage as far as I am aware. @peti is there any way to use git repo for a package not published on hackage when using hackage2nix? |
Ok, so now the process seems to be: #1. Create a new PR with the following change
|
In |
I can move it to separate files, but in which folder? The same one? |
I would just put them in hasura folder for now. |
ad33e69
to
e10a1f5
Compare
@GrahamcOfBorg build haskell.packages.ghc8101.graphql-engine |
Ok, this is really interesting, it seems my work only applies to the executable, but the libraries I touched do not build on their own neither in ghc88 or ghc810 (for different reasons):
but
|
The executable package was successful: https://github.com/NixOS/nixpkgs/pull/95369/checks?check_run_id=1057653764 But the libraries were not successful on the default compiler (ghc88x) and the target one (ghc810x). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
causes regressions in cachix and hercules-ci-agent
https://github.com/NixOS/nixpkgs/pull/95369
2 packages failed to build:
cachix hercules-ci-agent
3 packages built:
hasura-cli hasura-graphql-engine neuron-notes
cc @domenkozar
failure:
builder for '/nix/store/x74iz00q1rzqbnf3if0wjvs8in9rf1w8-optics-extra-0.3.drv' failed with exit code 1; last 10 log lines:
die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1022:20 in Cabal-3.0.1.0:Distribution.Simple.Configure
configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:475:12 in Cabal-3.0.1.0:Distribution.Simple.Configure
configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.0.1.0:Distribution.Simple
confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.0.1.0:Distribution.Simple.UserHooks
configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.0.1.0:Distribution.Simple
defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.0.1.0:Distribution.Simple
defaultMain, called at Setup.hs:4:8 in main:Main
Setup: Encountered missing or private dependencies:
optics-core >=0.3 && <0.3.1
cannot build derivation '/nix/store/hxh2fn8vb3i2lr9rskv7b0pw8w279ys0-insert-ordered-containers-0.2.3.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/1hvhik5ng6cxpiimhycw4fl3cx26vryk-swagger2-2.5.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/a7c6v7fls9cb0yq1sa2p7xl6arqxcv57-servant-swagger-1.1.7.1.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/1aij6rjwx1m1kmqkmjl8d1gpxp6k7678-servant-swagger-ui-core-0.3.3.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/f23x9461awib975ji6fbya01g40fjbk5-servant-auth-swagger-0.2.10.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/h19a18vgqj00jyz7pdwc098prw73sllz-cachix-api-0.4.0.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/ixbv571inhlc9bba8sxqcbw2agbxrg14-hercules-ci-api-core-0.1.1.0.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/8adg3a8injii6rc5mhx962zs64gc8sxk-cachix-0.3.8.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/qd7d4vrglx0v0hmg1s5kxl2msxlmwjqj-cachix-0.3.8.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/i96w3d8nids2lhz0dzyiig477xlr2lgj-hercules-ci-api-agent-0.2.2.0.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/ricjji66azz0881q3rj9rglxmk209afa-hercules-ci-agent-0.7.4.drv': 4 dependencies couldn't be built
Okay, this sucks, but all overrides that break packages which normally build on 8.8 need to be moved to the 8.10 file. This concerns at least |
@@ -297,7 +297,6 @@ self: super: { | |||
hsbencher = dontCheck super.hsbencher; | |||
hsexif = dontCheck super.hsexif; | |||
hspec-server = dontCheck super.hspec-server; | |||
HTF = dontCheck super.HTF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, why do you remove this? This introduces a build error for this package. Just not changing this line could fix the HTF package. Or is there some reason I don‘t get? Maybe then you can even remove some of the dontCheck
s below for which broken HTF is actually the reason? Or is HTF broken either way already before this PR? Anyway just let me now, what your rationale here was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was a mistake, I see no rationale for removing it. Sending in a new version of this PR.
Things I tested locally:
|
aba9f07
to
097b305
Compare
@GrahamcOfBorg build haskellPackages.HTF @GrahamcOfBorg build cachix @GrahamcOfBorg build haskell.packages.ghc8101.graphql-engine |
Okay, monoidal-containers is as of last night broken on haskell-updates, I fixed that. @GrahamcOfBorg build haskellPackages.monoidal-containers |
097b305
to
21aef0b
Compare
@GrahamcOfBorg build haskellPackages.monoidal-containers |
Let's just check everything once again. Just to be sure. I guess most of it will be cached anyways. @GrahamcOfBorg build haskellPackages.monoidal-containers @GrahamcOfBorg build cachix @GrahamcOfBorg build haskell.packages.ghc8101.graphql-engine |
Result of 2 packages built:- hasura-cli - hasura-graphql-engine |
e159242
to
a29ed35
Compare
@GrahamcOfBorg build haskellPackages.monoidal-containers @GrahamcOfBorg build cachix @GrahamcOfBorg build haskell.packages.ghc8101.graphql-engine |
Thanks, for sticking with it 'til the end! Great work! |
@ingenieroariel @maralorn Something happened to the closure size of hasura-graphql-engine in this merge. A xz packaged closure at piens/nixpkgs:2b0b078a64162ab193f2aeb1c88bd2e92f42e90c was about 20MB. Now, at nixos/nixpkgs-channels:nixos-20.09 (d447429) it is above 400MB. |
Oh, well. That is a finicky thing. I guess somewhere something introduced a runtime dependency on the Haskell ecosystem. I honestly don‘t know what the best practices are to prevent such a thing. If we know what the issue is we can probably fix something with references-to or simpler, but somebody will have to compare those two closures and it's dependency trees to find out where the issue lies. |
On second though: This PR dropped the If some could try that out, that would be great. Otherwise open an issue so we don‘t forget about it. |
Motivation for this change
This upgrades Hasura to use GHC 8.10 in anticipation of the 20.09 release. I was pleasantly surprised when I found it available on 20.03 and sad when it went missing from nixos-unstable.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)