Files listed in `extra-tmp-files` should not be copied into source dist tarball #1557

Closed
hvr opened this Issue Oct 24, 2013 · 8 comments

Projects

None yet

3 participants

@hvr
Owner
hvr commented Oct 24, 2013

A typical example is configure-type build systems:

extra-source-files:
    aclocal.m4
    config.guess
    config.sub
    configure
    configure.ac
    include/HsTimeConfig.h.in
    install-sh

extra-tmp-files:
    autom4te.cache
    config.log
    config.status
    include/HsTimeConfig.h

--- ...
library
    -- ...
    install-includes:
        HsTime.h
        HsTimeConfig.h

In this case, cabal sdist will require the redundant file include/HsTimeConfig.h to exist even though it's a redundant auto-generated artifact by the ./configure script.

Thus, cabal clean followed by cabal sdist will fail, as the HsTimeConfig.h will have been removed by then.

Member

extra-tmp-files are ignored by sdist. You can check by running rm config.status && cabal sdist. The problem is caused by install-includes.

Member

I'm not quite sure what is the right way to fix this. Clearly, Cabal can't detect if a file listed in install-includes will be generated by configure. Perhaps you can include a dummy HsTimeConfig.h file with contents like #error "HsTimeConfig.h must be auto-generated!" ?

@23Skidoo 23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Oct 24, 2013
@23Skidoo 23Skidoo Ignore 'install-includes' that are also listed in 'extra-tmp-files'.
Fixes #1557.
dba88a1
Member

I've written a patch, but it solves the problem only for install-includes.

Member
dcoutts commented Oct 24, 2013

The solution is to configure first, then sdist.

Member
dcoutts commented Oct 24, 2013

Oh, mm, ok in this case you want to generate it on the target.

Owner
hvr commented Oct 24, 2013

Well, if cabal sdist requires a cabal configure before, then cabal clean --save-configure shouldn't remove those files either... (as it's help text claims that it "Saves need to reconfigure."); moreover, like cabal build it might be convenient to have cabal configure be called by cabal sdist if the package wasn't configured yet.

Member
dcoutts commented Oct 24, 2013

Ok, so a sensible solution for ./configure style packages that generate extra .h files to install is to put them into the .buildinfo file, in the install-includes field.

I think that's better than ad-hoc making extra-tmp-files have an extra meaning.

@23Skidoo 23Skidoo closed this in 3c2d088 Oct 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment