kosmikus / lhs2tex

Preprocessor for typesetting Haskell sources with LaTeX
Other
99 stars 28 forks source link

cabal v2-install puts doc/Guide2.lhs in its dist-newtyle/ dir, build broken #96

Closed sgraf812 closed 10 months ago

sgraf812 commented 11 months ago

Consider:

$ git clean -fxd
$ cabal -v3  install
...
Expanding glob 'doc/Guide2.lhs' in directory '/home/sgraf/code/hs/lhs2tex/.'.
Expanding glob 'doc/Guide2.pdf' in directory '/home/sgraf/code/hs/lhs2tex/.'.
CallStack (from HasCallStack):
  withMetadata, called at src/Distribution/Simple/Utils.hs:368:14 in Cabal-3.10.1.0-5sSVeMY5t4HKsrW2wqIvsr:Distribution.Simple.Utils
Error: cabal: sdist of lhs2tex-1.24: filepath wildcard 'doc/Guide2.pdf' does
not match any files.

That file is generated by cabal build, though inside the dist-newstyle build directory:

$ cabal build
...
Warning: /home/sgraf/code/hs/lhs2tex/lhs2tex.cabal:88:3: The field
"autogen-modules" is available only since the Cabal specification version 2.0.
This field will be ignored.
...
$ fd -uu Guide2.pdf
dist-newstyle/build/x86_64-linux/ghc-9.2.8/lhs2tex-1.24/build/lhs2TeX/doc/Guide2.pdf

(The warning is inconsequential to this issue, but should probably be fixed as well.)

Install works if I comment out the mention of extra-source-files: doc/Guide2.pdf in the cabal file, but then the source dist does not have doc/Guide2.pdf (duh).

I'm not sure yet how to fix that.

sgraf812 commented 11 months ago

The CI script seems to have a touch doc/Guide2.pdf, but that seems like a bit of a stretch https://github.com/kosmikus/lhs2tex/blob/e90efe8dba8b2ad04a68f7576c0e4a0102f948d5/.travis.yml#L124

kosmikus commented 10 months ago

I'm going to add a PDF version to the repo for now. Not ideal, but should fix the problem.