Skip to content
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

Alex build failing with missing filepath at preprocessing step #195

Closed
solomon-b opened this issue Nov 5, 2021 · 7 comments
Closed

Alex build failing with missing filepath at preprocessing step #195

solomon-b opened this issue Nov 5, 2021 · 7 comments
Labels
bug build / install Concerning building and/or installing Alex

Comments

@solomon-b
Copy link

I'm not sure if it is relevant but this is on Nixos.

➜ cabal build
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - alex-3.2.7 (exe:alex) (first run)
Preprocessing executable 'alex' for alex-3.2.7..
alex: /home/solomon/Development/haskell/alex/./data//AlexTemplate-ghc: openFile: does not exist (No such file or directory)

That filepath looks odd. Any ideas what might be going wrong?

@TOTBWF
Copy link

TOTBWF commented Nov 8, 2021

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.

@andreasabel
Copy link
Member

I can confirm this problem on macOS Mojave.

@Ericson2314
Copy link
Collaborator

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.

@Ericson2314
Copy link
Collaborator

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!

@Ericson2314
Copy link
Collaborator

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! 🤦

More reason to finish #174, I suppose.

@andreasabel andreasabel added bug build / install Concerning building and/or installing Alex labels Jan 25, 2022
@sgraf812
Copy link
Collaborator

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 haskell/happy#274 (comment).

@andreasabel
Copy link
Member

Let's close this optimistically.

@andreasabel andreasabel closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build / install Concerning building and/or installing Alex
Projects
None yet
Development

No branches or pull requests

5 participants