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

Extensions from the cabal file are not picked up #25

Open
mohsen3 opened this issue Feb 18, 2016 · 6 comments
Open

Extensions from the cabal file are not picked up #25

mohsen3 opened this issue Feb 18, 2016 · 6 comments

Comments

@mohsen3
Copy link

mohsen3 commented Feb 18, 2016

I have a project in which I specified a few commonly used ghc extensions inside the cabal file. It seems to me that argon does not pickup the extensions from the cabal file, since I am getting a lot of errors. If I put the extension at the top of the module {-# LANGUAGE BangPatterns #-} it works fine.

@mohsen3
Copy link
Author

mohsen3 commented Feb 19, 2016

It seems that the problem comes from the extFromBI function in the Argon.Cabal module. It only looks at defaultExtensions, while the extensions in my cabal file are listed (for reasons that I don't understand) under the oldExtensions. I fixed the issue by adding the oldExtensions and otherExtensions to the list. I can make a pull request if you like.

@rubik
Copy link
Owner

rubik commented Feb 19, 2016

I looked into this when I first added the feature. But from Cabal's documentation it wasn't entirely clear what was oldExtensions for. Since in your case it only works with that change, feel free to open a PR!

@mohsen3
Copy link
Author

mohsen3 commented Feb 19, 2016

I made a PR that considers the otherExtensions and oldExtensions for the library section of the cabal file. Why don't you consider the extensions in the executable, test, and benchmark sections?

@rubik
Copy link
Owner

rubik commented Feb 20, 2016

Thanks!
I don't want to pull in all the other extensions because they could not be relevant and could break the parsing. It's probably better to add a CLI option to specify add custom extensions, just like -X does with GHC.

@mohsen3
Copy link
Author

mohsen3 commented Feb 21, 2016

I totally agree that the -X option is a helpful one.
I think the correct way to handle cabal files is to parse the source folder path as well as the extensions for each target and use the per target extension list instead. That's what cabal does.
Are you using the cabal files for anything other than finding the extension list? It is not clear from the documentation of the command line options, I think.

@rubik
Copy link
Owner

rubik commented Feb 22, 2016

Good suggestion. Currently, Argon just reads the extensions from the cabal file. I'll open two new issues for these features.

Repository owner deleted a comment from uday7981 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants