-
Notifications
You must be signed in to change notification settings - Fork 722
Closed
Labels
Milestone
Description
cabal sdist
for alex
is supposed to produce a tarball that builds without requiring Happy, but sometimes it doesn't. The failure is non-deterministic and happens about half the time.
Cabal bundles the Happy-generated .hs
files into the source dist, but the problem appears to be that sometimes the timestamp on these files is slightly older than the .y
file, so it is ignored when subsequently building the tarball.
For example, here is a correct run:
$ cabal sdist
$ tar tvzf dist/alex-3.1.6.tar.gz --full-time | grep Parser
-rw-r--r-- 0/0 5917 2015-11-30 10:24:29 alex-3.1.6/src/Parser.y
-rw-r--r-- 0/0 42504 2015-11-30 10:24:29 alex-3.1.6/dist/build/alex/alex-tmp/Parser.hs
And an incorrect one:
> tar tvzf dist/alex-3.1.6.tar.gz --full-time | grep Parser
-rw-r--r-- 0/0 5917 2015-11-30 10:23:43 alex-3.1.6/src/Parser.y
-rw-r--r-- 0/0 42504 2015-11-30 10:23:42 alex-3.1.6/dist/build/alex/alex-tmp/Parser.hs
Here the timestamp on Parser.hs
is one second older than Parser.y
. If I try to build this tarball without Happy installed, I get this:
$ cabal configure
Resolving dependencies...
[1 of 1] Compiling Main ( dist/setup/setup.hs, dist/setup/Main.o )
Linking ./dist/setup/setup ...
Configuring alex-3.1.6...
$ cabal build
Building alex-3.1.6...
Preprocessing executable 'alex' for alex-3.1.6...
setup: The program 'happy' is required but it could not be found
[1] 29158 exit 1 cabal build
The fix would appear to be to touch the preprocessed files before packaging the tarball.