Replace Nix tooling & update toolchain#6046
Conversation
bbd54ca to
77fca19
Compare
|
@ChrisPenner This PR upgrades us to GHC 9.10 … and I think the compiler must be doing something differently somewhere, because the |
77fca19 to
0a324a9
Compare
e5e515c to
2b3784b
Compare
@dolio If you might have an idea on this; possibly due to ghc version change? |
|
That test checks that GHC is generating code that looks properly optimized. I think it basically checks that the So, the details of the optimization have changed. I guess you could try running benchmarks before and after to see if the difference actually matters. If it doesn't, then maybe we need a different test. But if it does, we need to figure out how to fix the performance. Even if it doesn't, it might be easier to tweak something to satisfy the check than to figure out a new check that's actually proper. |
2b3784b to
b78c7f0
Compare
|
Here’s the Nix workflow run on my fork: https://github.com/sellout/unison/actions/runs/20785608716 (it’ll run on trunk in this repo when this PR is merged). |
ceedubs
left a comment
There was a problem hiding this comment.
I think that the docs for building with cabal need to either switch back to project-file or need to otherwise give a working command (perhaps moving cabal files out of contrib or suggest adding a symlink). Otherwise this is working well for me.
b78c7f0 to
bca81de
Compare
I removed the commit with the Cabal doc changes. I prefer the shorter |
|
NB: An annoying thing here is that because of the way the Cabal workflow works (in order to allow forks to make comments on PRs), it’s going to fail until after this is merged – it uses the workflow file from the target branch (trunk), and that means it gets the old GHC (& Cabal) version. |
ceedubs
left a comment
There was a problem hiding this comment.
Can't claim that I've reviewed the Haskell changes, but the Nix changes seem good to me 👍
|
Ok but the current build failures aren't nix related right? |
|
@dolio I tried running the benchmarks, but they don’t seem to build At first I thought I was just doing something wrong, but I’ve had the same thing happen on various releases. Granted, it’s still possibly I’m doing something wrong. I‘m now seeing if it works for me at the point the benchmarks were last updated. If not, then it’s very likely I’m doing something wrong. Either way, the benchmarks should probably be run as part of CI. We don’t need to actually measure them in CI (GitHub is no good for that), but at least ensure they build, so then I’d immediately know what I’m doing wrong. |
This is ancient syntax, so those aren't the right benchmarks. Those should be updated or deleted. @dolio what are the right benchmarks that @sellout should run? Is
|
|
The benchmarks are on share https://share.unison-lang.org/@pchiusano/misc-benchmarks run I don't actually remember what is in the benchmark transcript. |
There was a comment about this before, but the failure caused by having both GHC 9.10.3 and 9.6.5 HIE files in the GitHub actions cache made it worth addressing now. This also works around another bug introduced in Weeder 1.9.0.
Deep file creation was causing tests to modify files in `$HOME`, which was exposed by Nix sandboxing. This moves the file creation out a bit so that test code can specify an alternative location (alongside the test codebase). I’m not sure this is the right level – should we just not manage credentials during a test? Have a null manager? And this really should be moved up even further.
__NB__: The hpack binary in Nixpkgs is for 0.38.3, but the library
Stack is built against is 0.38.1 for some reason.
Also enable it on aarch64-linux for the first time. Fixes unisonweb#5789.
This switches back to `-Werror=deprecations`, replacing all the deprecated calls flagged in this upgrade.
ca362aa to
2760a4c
Compare
|
Some tests with 'continue-on-error: true' have failed:
Created by continue-on-error-comment |
|
@aryairani This should be ready for review now. |
|
BTW, the response I received about the inspection testing thing was that it's actually possible for the mere presence of the inspection test to change the way GHC optimizes things. So that may be what we're seeing. But I'm not sure there's a concrete solution. The actual inspection test doesn't directly refer to the thing being optimized, so it's not anything as 'simple' as that. |
|
I'm scared but here goes |
|
@sellout I'm seeing a new error that you might know something about. Now when I run I still see |
|
@mitchellwrosen Oh, yeah I encountered this last night too, this line 50 here should fix it. 95a3ec8#diff-8b67b4b0f775a1335829ea1852b4f6cd3a88983f051a2676f208ce6acd942c26 |
|
@mitchellwrosen I haven’t seen that. @aryairani For some reason, that link doesn’t show me anything helpful (or at least not obvious enough) – can you share the line contents? I did a bit of poking around and noticed that the other message (warning: unhandled Platform key FamilyDisplayName) is maybe due to an interaction between some Nixpkgs 25.11 revisions and the Xcode-provided git on macOS (NixOS/nixpkgs#376958) updating the flake (or your system’s Nixpkgs?) might get rid of that one. |
|
@sellout @mitchellwrosen Sorry about that, here's the contents
Maybe this would be better than adding it how I did (I should be able to use my system provided binaries too, IMO), but I'm not sure what it's suggesting to do about it. |
|
Ah ha! Ok yeah, using git from nixpkgs 25.11 solved the problem. I think we want Arya's patch too so others don't hit this. |
|
@aryairani Weird – don’t know why my browser didn’t jump to that line. Yeah, I do like keeping my flakes as self-contained as possible. For example, adding a |
|
Ok cool. We can always pull it later if we figure out a better solution. |

This replaces haskell.nix with stacklock2nix, and brings everything up to Nixpkgs 25.11 and Stackage LTS 24.21 (GHC 9.10.3).
It also adds documentation for how to upgrade tooling in future.
This is an alternative to #6033 + #5914.
Implementation approach and notes
The first commit switches the infrastructure from haskell.nix to stacklock2nix. The latter is much simpler, but less flexible. We took advantage of none of the flexibility of haskell.nix (nor do I think there’s any reason to), but we had a lot of overhead and complexity due to it.
However, it’s difficult to switch the infrastructure without also updating the other tooling (Stack, GHC, etc.), so the remainder of the PR is largely about supporting the new tooling, mostly the upgrade from GHC 9.6.5 to 9.10.3.
Loose ends
x-partialis a newly-introduced custom warning that has been applied tohead, etc. I temporarily downgraded it from an error (because we use-Werror) to a warning. I have changes that allow us to restore it to an error again, but I think it’s better as a separate PR because it requires threading a lot of changes.unison-runtime:optchecksis failing. @dolio is tracking that at nomeata/inspection-testing#100.