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

stack sdist cannot find autogenerated include file #5222

Open
AshleyYakeley opened this issue Mar 13, 2020 · 1 comment
Open

stack sdist cannot find autogenerated include file #5222

AshleyYakeley opened this issue Mar 13, 2020 · 1 comment

Comments

@AshleyYakeley
Copy link

This is an awkward issue with a number of moving parts: stack, Cabal, autotools, and the time library. I think the bug is in stack, but I could be wrong. To reproduce:

  1. Fetch the time library from https://github.com/haskell/time
  2. Run stack build
  3. Run stack sdist

Results:

$ stack sdist
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Getting file list for /home/ashley/Projects/Haskell/Time/time/
time> setup: can't find include file HsTimeConfig.h
time> 

--  While building package time-1.10 using:
      /home/ashley/Projects/Haskell/Time/time/.stack-work/dist/x86_64-linux/Cabal-3.0.1.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-3.0.1.0 sdist --list-sources /tmp/stack-sdist28443/source-files-list
    Process exited with code: ExitFailure 1

I also tried stack --resolver lts-14 sdist, with the same problem.

HsTimeConfig.h is not a source file, but is built by configure. When stack builds the time library, the file ends up in .stack-work/dist/x86_64-linux/Cabal-3.0.1.0/build/lib/include/HsTimeConfig.h rather than in lib/include/HsTimeConfig.h where stack sdist seems to want it.

HsTimeConfig.h is mentioned in the extra-tmp-files field of time.cabal. However, the problem persists even if I remove it. It's not entirely clear to me that the file even needs to be in the distribution tarball, since it will be built by the configure script. My workaround is to run configure manually, which will put the file in the expected place.

Stack version

$ stack --version
Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository
@dbaynard
Copy link
Contributor

If you create a symlink from the stack directory to the relevant lib/include directory, does stack sdist work?

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

3 participants