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

Nix support for GHC upgrade #5155

Merged
merged 13 commits into from
Jul 6, 2024
Merged

Conversation

sellout
Copy link
Contributor

@sellout sellout commented Jun 27, 2024

Bumped some versions around, but they’re negotiable.

  • ormolu 0.5.2.0 → 0.7.2.0
  • hls 2.9.0.0 → 2.8.0.0
  • stack 2.15.5 → 2.15.7

sellout added 13 commits June 27, 2024 17:37
This `only-tools-nixpkgs` devShell generally paralleled the
`cabal-only-tools` devShell, but avoiding haskell.nix. While I’m not a
huge fan of haskell.nix, this just created duplication and gave us a
shell with a somewhat different environment than the one used by
`nix build`, etc. It also didn’t work for everyone.

In removing that shell, it also sets the default devShell to be
`cabal-only-tools`, which some people were already using to work around
issues with the previous default.
There are various benefits to using a Nixpkgs release
- more likely that things are cached
- easier to update the input without breaking everything

This also renames a lot of things in the flake:
- `nixpkgs-unstable` to `nixpkgs-release` – partially because it’s not
  unstable any more, but also because both it and the nixpkgs from
  haskell.nix unstable, so it didn’t really clarify anything
- `nixpkgs` to `nixpkgs-haskellNix` – to make it clear where it comes from
- `unstable` to `release-pkgs` – the convention is to use `pkgs` for
  derivation attrsets, and the source switched from unstable to release
- `nixpkgs-packages` to `tool-pkgs` – this holds our build tools, so
  that seemed clearer than “nixpkgs”
Overlays are for derivations, and this isn’t one. Putting it in an
overlay also just gives us more levels of indirection to dig through to
figure out where things are coming from.
`cabal-local` no longer triggers rebuilds of GHC, so now we can use the
devShell that provides the same environment as our build.
This means those environments will also be cached in CI.
Bumped some versions around, but they’re negotiable.
- ormolu 0.5.2.0 → 0.7.2.0
- hls 2.9.0.0 → 2.8.0.0
- stack 2.15.5 → 2.15.7
@sellout
Copy link
Contributor Author

sellout commented Jun 28, 2024

Most of the commits here are part of #5154, which simplifies the flake on trunk. This PR consists of just a single commit.

Also, there is one test that fails under nix flake check:

clearWatchCache.CodebaseFormat2 EXCEPTION!!!: security: createProcess: posix_spawnp: does not exist (No such file or directory)
💥  clearWatchCache.CodebaseFormat2

@ceedubs has a workaround for this in https://github.com/ceedubs/unison-nix/blob/trunk/nix/darwin-security-hack.nix, but I also think it’s not critical for now, since we don’t run nix flake check in CI yet.

@sellout sellout mentioned this pull request Jun 28, 2024
1 task
@aryairani
Copy link
Contributor

If we change the ormolu version in nix, we should change it in CI also. And then I don't know how to get non-nix users to match; the vs code haskell plugin pulls down some version of ormolu (embedded in some version of HLS), but I don't even know how to find out what version it is.

@aryairani
Copy link
Contributor

also we should figure out between #5155 and #5142 which versions of hls and stack to standardize on too

@sellout
Copy link
Contributor Author

sellout commented Jun 28, 2024

If we change the ormolu version in nix, we should change it in CI also. And then I don't know how to get non-nix users to match; the vs code haskell plugin pulls down some version of ormolu (embedded in some version of HLS), but I don't even know how to find out what version it is.

Yeah, this is one of the use cases for pulling the versions out into a JSON file1, then read that into the flake, workflows, etc.

also we should figure out between #5155 and #5142 which versions of hls and stack to standardize on too

Yeah, my inclination is to use the ones here unless @ChrisPenner has a strong preference, only because it reduces the overrides needed by Nix and less Nix code is better Nix code.

Footnotes

  1. Or probably YAML, so we can have comments like “this is set to match the version of Ormolu included in the VSCode Haskell plugin.”

@sellout
Copy link
Contributor Author

sellout commented Jun 28, 2024

The “Nix development cache / ubuntu-20.04” check is failing because it runs out of space trying to build GHC 9.6.5 😕

I should try building that locally and pushing it to the cache.

@sellout sellout mentioned this pull request Jun 28, 2024
@sellout
Copy link
Contributor Author

sellout commented Jul 1, 2024

Given @ChrisPenner’s comment, I think the only question is whether it’s ok to bump Ormolu here.

If so, does that mean this PR also needs to run it across the code base?

@ChrisPenner
Copy link
Contributor

If ormolu has a lot of changes then I'd really love to NOT do that right now, as it'll cause a ton of merge conflicts with my project root stuff 😓 ; if it's not too bad maybe it's fine?

@sellout sellout marked this pull request as ready for review July 6, 2024 05:44
@sellout sellout requested a review from a team as a code owner July 6, 2024 05:44
@aryairani aryairani merged commit ecf5fe1 into unisonweb:cp/ghc-upgrade Jul 6, 2024
39 checks passed
@sellout sellout deleted the cp/ghc-upgrade branch July 8, 2024 18:24
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