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

Simplify Stack usage in Nix #5486

Draft
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

sellout
Copy link
Contributor

@sellout sellout commented Dec 6, 2024

The particular Stack build was the only reason we had two Nixpkgs dependencies. This removes the custom stack dependency, and instead sets the versions for the haskell.nix tools.

It also bumps hpack to 0.36.0, because it turns out that’s the minimum required by our pinned version of Stack anyway.

@sellout sellout mentioned this pull request Dec 6, 2024
@sellout sellout force-pushed the simplify-nix-flake branch 2 times, most recently from a7551ef to 4b71041 Compare December 7, 2024 07:39
There were two Nixpkgs inputs, with one being used solely to get a particular version of Stack. This now “compromises”
on the same release of Nixpkgs as used for Stack, but from the haskell.nix project to have a consistent package set.

There are also a few other version bumps here (because once you change an uncached input, you might as well upgrade everything):

- bump LTS to 22.43 (GHC 9.6.6 from 9.6.5)
- bump HLS to 2.9 (this is now transitively included via the haskell.nix input)
- bump hpack to 0.36.0 (this is actually the minimum bound for the
  version of Stack we use, so the previous setting was inconsistent)
These were out of sync with the intended version (specified in
.vscode/settings.json).
Somewhat described at https://github.com/nix-systems/nix-systems

This is useful for Haskell projects, because commands like

```bash
nix flake show --allow-import-from-derivation
```

can often fail, complaining that it can’t find some other architecture
to build on. With nix-systems, you can append
`--override-input systems github:nix-systems/x86_64-linux` to the
command to ensure that x86_64-linux is the only platform in play.
It is not triggering a(nother) rebuild of GHC.
This workaround required another local workaround. If you had a line
like `LD_LIBRARY_PATH=` in your .envrc, it can be removed now.
@sellout
Copy link
Contributor Author

sellout commented Dec 12, 2024

Well, this is annoying – I updated the cache, but the Ubuntu build is still failing with OOM.

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.

3 participants