-
Notifications
You must be signed in to change notification settings - Fork 37
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
Provide Ormolu via Nix #431
Comments
I happened to want a recent ormolu from nixpkgs in some other place, and I found that I had to do this with ghc-9.2.5 to get a recent enough ghc-lib-parser (which meant rebuilding ghc-lib-parser again): ormolu = (prev.haskell.packages.ghc925.override {
overrides = hfinal: hprev: with prev.haskell.lib; {
ormolu = hprev.generateOptparseApplicativeCompletions [ "ormolu" ]
(enableSeparateBinOutput hfinal.ormolu_0_5_0_1);
};
}).ormolu.bin; So ormolu-from-nixpkgs may not dodge the ghc-lib-parser build. |
Indeed, I've noticed something like this in a project of mine recently. But for CI at least, we can workaround this by setting up a Cachix cache. Which doesn't have the issue that Github actions seem to have that the first build on a PR doesn't use the cache (or maybe that's an issue with our configuration, but I've checked and it looks good. Obviously I may have missed something and there may be an easy solution, it would be great in the short term). |
Why don't you just use https://github.com/mrkkrp/ormolu-action ? |
@mrkkrp |
Depends on how badly you want this and whether you want to make a compromise. I usually just use the same ormolu I have on my system for all formatting, and I don't particularly care about its version. I use the GitHub action for all projects on CI. The advantage is that the CI setup is very simple and acts as the definite source of truth, which is all I want. In all my projects it's been really rare, if ever, that my system ormolu would format differently from the CI version. In 99.99% of cases you won't have to reformat, and the benefit is simplicity and reliability. |
I'll let @aspiwack decide then :) |
Ormolu has very slow to build dependencies (essentially ghc-lib-parser). This has been an obstacle to contributing, and makes the CI very slow on the first push of a new branch.
Currently, the
./format
script build Ormolu itself, viastack build
. This is convenient (calling./format
is machine independent). The main reason why we went this route back then, was that the version of Ormolu that was available on Nixpkgs was too old, we needed a recent one. Now, I believe that it should be easy to provideOrmolu
via Nixpkgs.This doesn't prevent contributors who want to provide Ormolu via Stack to call
stack build ormolu && stack exec -- ./format
. It makes the management of dependencies more package-manager agnostic. And will let us download cached Ormolu when using Nix (in particular on CI).The text was updated successfully, but these errors were encountered: