Closed symbiont-sam-halliday closed 4 years ago
I don't know what is going on here, and it doesn't look like an Ormolu-specific issue, so closing.
I started trying to create a minimal repro to report upstream with cabal-install
and was unable to get the failure to repeat. Now I'll investigate what project-specific thing might be relevant here... sorry for the noise.
Argh, I narrowed it down to the use of allow-newer
in the cabal.project
which is autogenerated by stack2cabal
in order to workaround the fact that stack often allows this.
I've backlinked the cabal bug to here so that anybody else encountering this knows what the cause is, and a potential workaround. Remove the allow-newer
if you can.
And fixed in upstream stack2cabal
which turned out to be producing freeze files that were not correctly freezing the build-tool-depends
.
If I add ormolu as a
in my project, and use a
cabal.project.freeze
file that corresponds to https://www.stackage.org/lts-15.5 (e.g. by using http://hackage.haskell.org/package/stack2cabal on astack.yaml
frozen to that LTS or by downloading their partial freeze files) then I get a compilation error when buildingormolu
The weird thing is that it compiles fine if I do
cabal install ormolu
from here (which uses the exact same frozen dependencies).It also works fine for me if I do a
cabal install ormolu-0.0.3.1
from my home directory (which doesn't use the freeze file).This is almost certainly a cabal bug of some kind, but since this disproportionatly impacts ormolu, I am hoping that somebody here might have encountered it and have a fix?
Obviously the workaround is to install
ormolu
globally for the user, but it is so much better to have the formatter pegged to the project so that anybody can check it out and runcabal exec ormolu -- ...
to get the exact same formatting, which simplifes linter scripts, editor integration, multiple projects, and going back to work on old branches, and all sorts of things.