Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Closed

Comments

@hvr
Copy link
Member

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.

@23Skidoo
Copy link
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.

@23Skidoo
Copy link
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
Copy link
Member

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

@dcoutts
Copy link
Contributor

dcoutts commented Oct 24, 2013

The solution is to configure first, then sdist.

@dcoutts
Copy link
Contributor

dcoutts commented Oct 24, 2013

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

@hvr
Copy link
Member Author

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.

@dcoutts
Copy link
Contributor

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.

@hvr
Copy link
Member Author

hvr commented Oct 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants