haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 697 forks source link

sdist ships (duplicate) generated modules in the source directories #7258

Open andreasabel opened 3 years ago

andreasabel commented 3 years ago

Originating from https://github.com/haskell/cabal/issues/7251#issuecomment-767487524 : cabal sdist includes useless, possibly generated modules in the package Scenario:

Enhancement request:

To Reproduce Steps to reproduce the behavior (uses BNFC and PR #7251): [Without PR #7251, you might have to fix up the generated .cabal file.]

bnfc --version || cabal install BNFC
mkdir -p myparser
cd myparser
echo "Foo. Bar ::= Integer" > Foo.cf
bnfc -o src -d -m Foo.cf
make -C src
mv src/Foo/Test.hs Main.hs
cabal init --libandexe --application-dir=.
cabal sdist
find . -name "*.tar.gz" -exec tar tf {} \;

Notice the content of the generated archive with the redundant .hs files:

myparser-0.1.0.0/src/Foo/Lex.hs
myparser-0.1.0.0/src/Foo/Lex.x
myparser-0.1.0.0/src/Foo/Par.hs
myparser-0.1.0.0/src/Foo/Par.y

System information

andreasabel commented 11 months ago

In the wild: cabal install java-adt-0.2018.11.4 fails. The tarball contains a generated Lexer.hs and Parser.hs adjacent to Lexer.x and Parser.y: https://hackage.haskell.org/package/java-adt-0.2018.11.4/src/