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

containers.h prevents compilation without cabal #103

Closed
treeowl opened this issue Dec 18, 2014 · 7 comments
Closed

containers.h prevents compilation without cabal #103

treeowl opened this issue Dec 18, 2014 · 7 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Dec 18, 2014

When I try to compile Data.Sequence, I now get an error that it can't find containers.hs.

@tibbe
Copy link
Member

tibbe commented Dec 18, 2014

What is containers.hs?

@treeowl
Copy link
Contributor Author

treeowl commented Dec 18, 2014

I mean containers.h. Sorry. It's now #included in Data.Sequence.

@foxik foxik changed the title containers.hs prevents compilation without cabal containers.h prevents compilation without cabal Dec 18, 2014
@foxik
Copy link
Contributor

foxik commented Dec 18, 2014

The containers.h is now included by all Haskell sources. It defines typeable instances, strictness macros and MIN_VERSION_base if it is undefined.

To compile Sequence.hs from Data directory, just add -I../include. To compile Data/Sequence.hs from the root of the repo, just add -Iinclude.

@foxik foxik closed this as completed Dec 18, 2014
@tibbe
Copy link
Member

tibbe commented Dec 18, 2014

This is not really much easier than including -optP-include -optPdist/build/autogen/cabal_macros.h.

@foxik
Copy link
Contributor

foxik commented Dec 18, 2014

Agreed. The containers.h is not there because of cabal-less build. The containers.h contains

  • the INSTANCE_TYPEABLEx, which were in Typeable.h header -- that header collided with the Typeable.h header from base in some cases when correct include path was not used, which was the case in tests and in cabal-less builds. This is why I created a header with more unique name.
  • the STRICT_x_OF_y macros, which were defined in every file separately
  • definition of WORD_SIZE_IN_BITS for GHC
  • and lastly, it defines MIN_VERSION_base if it does not exist as a convenience for me, because it is the right place where to put it. But even if it wasn't here, we would still have containers.h.

@treeowl
Copy link
Contributor Author

treeowl commented Dec 18, 2014

It looks like this file is a good idea, but would it be possible to use an explicit path for the #include?

#include "../include/containers.h"

Or would this cause some sort of trouble somewhere?

@foxik
Copy link
Contributor

foxik commented Dec 19, 2014

Having common header file is quite common practice (running find on my packages returns bytestring, directory, primitive, process, unix, vector), as is using include-dirs cabal directive (all the mentioned packages use it). Personally I see no reason why not using it.

What you propose would probably work too, but I am quite satistifed with current (commonly used) solution.

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

3 participants