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

create cabal files #173

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

create cabal files #173

wants to merge 15 commits into from

Conversation

pascalh
Copy link
Contributor

@pascalh pascalh commented Mar 7, 2016

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.)

@gdetrez gdetrez self-assigned this Aug 22, 2016
@gdetrez gdetrez modified the milestone: 2.9 Sep 7, 2016
@gdetrez
Copy link
Contributor

gdetrez commented Sep 8, 2016

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 build-depends: is empty, any idea why that might be?

Also, would it be possible to also build the test program?

@pascalh
Copy link
Contributor Author

pascalh commented Sep 22, 2016

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.

@gdetrez
Copy link
Contributor

gdetrez commented Oct 25, 2016

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.
What I added looks like this (there might be a way to make it less redundant though...)

Executable TestCalc
   build-depends:
     base >4,
     array -any
   main-is: TestCalc.hs
   Other-modules:
     AbsCalc
     ErrM
     PrintCalc
     LexCalc
     ParCalc

@pascalh
Copy link
Contributor Author

pascalh commented Nov 19, 2016

Thanks for testing. It worked out well using your approach.

@andreasabel
Copy link
Member

Seems like @gdetrez has moved on, this threat has been dormant for a year.
I am the new guy trying to take over some maintenance for bnfc (I use it for my class).

What is the status of this feature @pascalh ?

  • Still interested.
  • Good test coverage.
  • Good documentation (integration into bnfc-tutorial, for instance).

@pascalh
Copy link
Contributor Author

pascalh commented Nov 16, 2017

@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.

@andreasabel andreasabel modified the milestones: 2.9, 3.0 Nov 25, 2020
@andreasabel
Copy link
Member

Possibly cabal init could be utilized to generate the cabal file, see haskell/cabal#7253 .
I also played with hpack, see sol/hpack#406 .

@andreasabel andreasabel added the cabal Integration with Cabal label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cabal Integration with Cabal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants