[Hackage] #257: sdist doesn't include all files when using conditional and "buildable: False"

#257: sdist doesn't include all files when using conditional and "buildable: False" ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | ----------------------------+----------------------------------------------- This is my cabal file: {{{ Name: test Version: 0.1 Cabal-Version: >=1.2 Executable exe1 Hs-Source-Dirs: src Main-Is: Exe1.hs Build-Depends: base Executable exe2 Hs-Source-Dirs: src Main-Is: Exe2.hs if !os(linux) Buildable: False }}} Building, on linux, results in {{{ % ./Setup.hs configure; ./Setup.hs build Configuring test-0.1... Warning: No license-file field. Preprocessing executables for test-0.1... Building test-0.1... [1 of 1] Compiling Main ( src/Exe1.hs, dist/build/exe1/exe1-tmp/Main.o ) Linking dist/build/exe1/exe1 ... [1 of 1] Compiling Main ( src/Exe2.hs, dist/build/exe2/exe2-tmp/Main.o ) Linking dist/build/exe2/exe2 ... }}} As is expected exe2 is built. However, sdist does not include the source file for exe2 in the tar-ball: {{{ % ./Setup.hs sdist Building source dist for test-0.1... Preprocessing executables for test-0.1... Source tarball created: dist/test-0.1.tar.gz % tar -t -z -f dist/test-0.1.tar.gz test-0.1/ test-0.1/Setup.hs test-0.1/test.cabal test-0.1/src/ test-0.1/src/Exe1.hs }}} -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/257 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#257: sdist doesn't include all files when using conditional and "buildable: False" ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by guest): This happens because sdist uses flattenPackageDescription which doesn't properly handle conditionals like configure would do, and instead just joins the listed values for each field descriptor. However it's not clear why sdist should care if an executable is buildable or not, I'd expect the sources to be included anyway, so the executable can be built where it's buildable. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/257#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#257: sdist doesn't include all files when using conditional and "buildable: False" ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by ross@soi.city.ac.uk): Indeed sdist shouldn't take any note of conditionals: it should pack all of the files in any environment. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/257#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#257: sdist doesn't include all files when using conditional and "buildable:
False"
----------------------------+-----------------------------------------------
Reporter: guest | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Cabal library | Version: 1.2.3.0
Severity: normal | Resolution:
Keywords: | Difficulty: normal
Ghcversion: 6.8.2 | Platform:
----------------------------+-----------------------------------------------
Comment (by duncan):
Good catch. It was because sdist uses `withLib` and `withExe` which only
run if the lib and exes are buildable.
Now fixed:
{{{
Fri Mar 7 02:09:33 GMT 2008 Duncan Coutts

#257: sdist doesn't include all files when using conditional and "buildable: False" ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: closed Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: fixed Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * status: new => closed * resolution: => fixed Comment: Already fixed but the ticket was not closed. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/257#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage