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

Cannot find generated header files when building unix-time with Cabal 2.2 #5169

Open
pechersky opened this issue Feb 25, 2018 · 10 comments
Open

Comments

@pechersky
Copy link

I have been trying to build hoogle using cabal new-build hoogle. It fails on building unix-time with fatal error: config.h: No such file or directory.

This is likely due to a missing include-dirs: cbits in the cabal file for unix-time. This was determined by a successful build of kazu-yamamoto/unix-time release v0.3.7 by including that missing line. The build succeeded with cabal new-build.

This was found using cabal-install 2.2.0.0, ghc 8.0.2, WSL Ubuntu 16.04.

@hvr
Copy link
Member

hvr commented Feb 25, 2018

An important detail here is that this used to work in cabal-2.0

@hvr
Copy link
Member

hvr commented Feb 25, 2018

I was able to confirm my suspicion about #4874 being the culprit:

  • 783cbe6 exhibits the regression
  • whereas the parent commit c094940 doesn't have the regression

Now the question is if we can recover support for old packages by extending the include header searchpath to the new locations, and/or whether this was an unintentional regression or an intentional one (in which case we may want to consider a legacy fallback for older cabal-version:... spec versions; OTOH, I'm not sure if unix-time wasn't doing something that should have never worked to begin with). Fwiw, I don't think that many packages are affected, as otherwise we would have noticed this sooner.

/cc @23Skidoo @angerman

@23Skidoo 23Skidoo added this to the 2.2 milestone Feb 26, 2018
@hvr
Copy link
Member

hvr commented Feb 26, 2018

While this doesn't make this issue go away, the author of unix-time mitigated this by via http://hdiff.luite.com/cgit/unix-time/diff?id=0.3.8&id2=0.3.7 (c.f. kazu-yamamoto/unix-time#42)

@angerman
Copy link
Collaborator

I'm kind of on the fence to say this was broken to begin with...

@hvr
Copy link
Member

hvr commented Feb 26, 2018

I tend to agree w/ @angerman as I'm having a hard time coming up with a legacy fallback which doesn't disable new principled scheme from #4874 for legacy specVersions. Maybe we have to sacrifice the buildability of prior unix-time releases as there's not much we can do in a non-magical way IMO.

@RyanGlScott
Copy link
Member

This also breaks the ability to new-build the time library with cabal-install-2.2, as documented in #5223 (comment).

RyanGlScott added a commit to haskell/deepseq that referenced this issue Mar 20, 2018
@gbaz
Copy link
Collaborator

gbaz commented Mar 20, 2018

time is so pervasive that breaking with that seems like it pushes up the need for a fix here...

@gbaz
Copy link
Collaborator

gbaz commented Mar 20, 2018

also as noted on that ticket "in the time case, the include-dirs: lib/include is there" so maybe its more possible to have a solution...

@hvr
Copy link
Member

hvr commented Mar 20, 2018

Fwiw, the issue in #5223 is in a different phase: This is about about install-includes referring to an auto-generated header file which lib:Cabal is trying to locate (but looks in the wrong place; ideally we'd have the equivalent of autogen-modules for include header files, then cabal would know the single place where to expect that file, rather than have to try two places), rather than an -I flag not being passed to GHC (and GHC complaining).

@hasufell
Copy link
Member

Still a problem in 2020 building old unix-time.

@ulysses4ever ulysses4ever removed this from the Considered for 3.4 milestone Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants