Ticket #792 (closed defect: fixed)

Opened 2 years ago

Last modified 17 months ago

sdist doesn't not include source files from test-suite stanzas

Reported by: tibbe Owned by: ttuegel
Priority: normal Milestone: Cabal-1.10
Component: Cabal library Version: 1.8.0.6
Severity: normal Keywords:
Cc: v.dijk.bas@… Difficulty: unknown
GHC Version: Platform:

Description

cabal sdist doesn't include the source files from test-suite stanzas when generating the tarball. This leads to Hackage's QA checks rejecting the package.

Steps to reproduce:

  1. Create a Cabal package with a test-suite stanza (and set hs-source-dirs to e.g. tests).
  2. Run cabal sdist
  3. Unpack the tarball and look at the content.

Thomas, could you please take a look?

Attachments

cabal-test-fix-sdist.dpatch Download (31.3 KB) - added by ttuegel 2 years ago.
Patch fixing sdist for test suites.

Change History

  Changed 2 years ago by duncan

<dcoutts_> tibbe: is it the same with runghc Setup.hs sdist?
<dcoutts_> and what if you runghc Setup.hs configure --enable-tests first ?
* dcoutts_ suspects the latter might make it work
<tibbe> dcoutts_: same thing

  Changed 2 years ago by tibbe

Just to clarify the above IRC discussion, the problem exists even if the package is configured using --enable-tests:

runghc Setup.hs configure --enable-tests --user
runghc Setup.hs sdist
tar -ztf dist/mypackage-1.0.tar.gz

  Changed 2 years ago by tibbe

Workaround: List all the test-suites' source files under the global extra-source-files field.

Changed 2 years ago by ttuegel

Patch fixing sdist for test suites.

follow-up: ↓ 5   Changed 2 years ago by ttuegel

  • status changed from new to assigned

The patch I just attached fixes this problem when you do runghc Setup.hs sdist. My preliminary investigation shows that another patch for cabal-install will be necessary, but I haven't poked at the source yet.

in reply to: ↑ 4   Changed 2 years ago by ttuegel

Replying to ttuegel:

The patch I just attached fixes this problem when you do runghc Setup.hs sdist. My preliminary investigation shows that another patch for cabal-install will be necessary, but I haven't poked at the source yet.

I was wrong, this fixes cabal-install, too.

  Changed 2 years ago by duncan

  • status changed from assigned to closed
  • resolution set to fixed

Applied.

Wed Jan 19 15:34:04 GMT 2011  Thomas Tuegel <ttuegel@gmail.com>
  * Including test suites in product of 'setup sdist'.
  See ticket #792.

  Changed 22 months ago by basvandijk

  • cc v.dijk.bas@… added

I just received a  bugreport of one of my libraries about this.

Is the fix already in any released version?

  Changed 17 months ago by elga

Note: See TracTickets for help on using tickets.