-
Notifications
You must be signed in to change notification settings - Fork 164
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
create cabal files #173
base: master
Are you sure you want to change the base?
create cabal files #173
Conversation
Hi @pascalh. Thanks for this 👍 and for taking time to add tests ❤️ I see from the code that it should add the proper dependencies but when trying on my local machine, the generated Also, would it be possible to also build the test program? |
I can not imagine why the dependencies are not being added on your machine. Which ghc and cabal version are you using? If this is a major problem we could generate the cabal files without cabal library (using plain text concatenation). Building the test program is not straight forward, because the module and file name differ. I could rename the module Main and everything works fine. I felt like this is a bigger change, which should not be implemented without any discussion. |
It took me a while but I manage to make some more tests. I am using ghc 7.8 and Cabal (library) 1.18. I tried rebuilding bnfc with Cabal 1.22 and it now correctly populates the list of dependencies. So it might just be a bug in old Cabal library and I guess one solution is to make the lower version bound higher (1.22 seems to work, 1.20 might as well) I'm not sure I understand what is the problem with the test executable. I tried adding a section to the cabal file manually and it seems to work fine. Executable TestCalc
build-depends:
base >4,
array -any
main-is: TestCalc.hs
Other-modules:
AbsCalc
ErrM
PrintCalc
LexCalc
ParCalc |
Thanks for testing. It worked out well using your approach. |
Seems like @gdetrez has moved on, this threat has been dormant for a year. What is the status of this feature @pascalh ?
|
@andreasabel Great to see BNFC coming back to life. I will update the pull request as soon as I find some time to do so. |
Possibly |
This pull request allows bnfc to create cabal files in order to build/install the generated modules.
(I will start working on a cabal hook, which lets you use bnfc as a preprocessor to cabal.)