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

Fix haskell.nix evaluation with recent nixpkgs #1859

Merged

Conversation

dhess
Copy link
Contributor

@dhess dhess commented Feb 23, 2023

Hi,

In our haskell.nix flake-based project, we're always careful to use the haskell.nix-provided nixpkgs-unstable pin to build our Haskell packages, because we want to take advantage of the IOG binary cache.

However, in the same flake, we also want to run some NixOS tests which use our Haskell packages. In recent months, nixpkgs has made this relatively easy to do (see https://nixos.org/manual/nixos/unstable/index.html#sec-call-nixos-test-outside-nixos). Until recently, we were able to make this work with haskell.nix's nixpkgs-unstable pin with an ugly hack, but unfortunately, as of the most recent nixpkgs-unstable pin (747927516efcb5e31ba03b7ff32f61f6d47e7d87), our hack no longer works, for a few reasons:

  • in overlays/bootstrap.nix (and elsewhere), final.buildPlaform and friends no longer exist.
  • pkgsBuildBuild.system no longer exists.
  • The pkgconfig alias has been removed (now only pkg-config exists).

I'm not suggesting that this PR is merged, as I confess that I don't really understand how haskell.nix works at this level of detail, and I was just blindly replacing various attributes with their obvious replacements, so it's possible that I've broken something else. But these changes do allow us now to use nixos-lib.runTest, and don't seem to adversely affect our ability to build our Haskell packages.

(I confess I'm a bit confused as to how haskell.nix builds at all with the nixpkgs-unstable pin. I suppose you all are careful not to use that pin to evaluate the project in your CI system?)

dhess added a commit to hackworthltd/primer that referenced this pull request Feb 23, 2023
dhess added a commit to hackworthltd/primer that referenced this pull request Feb 23, 2023
Note that the new `haskell.nix` pin necessitates the following
additional changes:

* We switch temporarily to our own `haskell.nix` fork, as recent
versions no longer work with `nixpkgs`'s NixOS test framework. See
input-output-hk/haskell.nix#1859.

* We include a workaround for
input-output-hk/haskell.nix#1857 (which
itself is a workaround for
input-output-hk/haskell.nix#839).

* We no longer need the `hostPkgs` hack to make the NixOS tests build.

* We need to bump the NixOS VM disk size, as it's no longer large
enough to build the `primer-service` Docker image.
@hamishmack hamishmack merged commit 1ff7093 into input-output-hk:master Feb 23, 2023
@dhess
Copy link
Contributor Author

dhess commented Feb 24, 2023

Thanks!

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