Closed solomon-b closed 4 months ago
I can reproduce this with cabal build
, however, stack build
seems to work.
Note that this is on OSX, so it doesn't appear to be limited to nix
.
I can confirm this problem on macOS Mojave.
Yes this is a very weird error. I think there is some logic in prior versions of alex to try to use newer templates? But those don't exist because we simplified the templating system.
BTW if you manually run alex on the file and delete the original Scan.hs
, it will work. It is just when cabal invokes Alex that weird things happen!
Ah, this is because the autogenerated Paths_alex
module allows alex_
env vars to override the data dirs. During the build those env vars are defined (at least with the latest Cabal), and thus we try to bootstrap feeding the old alex the new alex's templates! :facepalm:
More reason to finish https://github.com/simonmar/alex/pull/174, I suppose.
Is this still a problem? I ran cabal build
and cabal test
successfully on master
(3.5.1).
At any rate, I happy
suffered from a similar error which can be traced back to Cabal
; see https://github.com/haskell/happy/issues/274#issuecomment-2152649291.
Let's close this optimistically.
I'm not sure if it is relevant but this is on Nixos.
That filepath looks odd. Any ideas what might be going wrong?