-
Notifications
You must be signed in to change notification settings - Fork 291
Replace Nix tooling & update toolchain #6046
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
base: trunk
Are you sure you want to change the base?
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. |
This is much simpler Haskell tooling that serves our needs and keeps us on a better cache (NixOS).
- resolve various implicit import conflicts (`show`, `unsnoc`, `unzip`, etc.) - update `text-builder` names (`Text.Builder` -> `TextBuilder`, `run` -> `toText`) - update primitive usage (`keepAlive` and `withMutableByteArrayContents`)
The new `-Wx-partial` warning and some deprecations require more involved changes, so defer for now.
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.
This is a workaround for an issue with Nix on macOS. TLS on macOS requires access to the `security` binary, which is not available to Nix. This creates a non-TLS HTTP client for the transcript tests to avoid that issue.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
__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.
b78c7f0 to
bca81de
Compare
|
Some tests with 'continue-on-error: true' have failed:
Created by continue-on-error-comment |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
|
Here are the benchmarks (times in µs). With one nasty exception, things look good. I re-ran them to see if there was some interference with that outlier, but everything looked the same.
|
For what it's worth, this benchmark looks to be using |
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
There are two warnings downgraded from errors:
deprecationsandx-partial. I have changes to make them errors again, but I think they’re better as separate PRs (x-partialin particular has a nice solution, but requires threading a lot of changes).unison-runtime:optchecksis failing, and I’m not sure why. Would love some assistance with this one.