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

Data-Files cabal directive should support directories #713

Closed
bos opened this issue May 24, 2012 · 10 comments
Closed

Data-Files cabal directive should support directories #713

bos opened this issue May 24, 2012 · 10 comments

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(Imported from Trac #722, reported by cygnus on 2010-08-02)

It should be possible to use the Data-Files directive to include whole directories (recursively) in source distributions. In many cases it's impossible or cumbersome to list all of the files one would like to install, and it seems to me that nobody should have to do that if what they really mean is, "install everything in that-data-dir/."

In implementation terms, this doesn't strike me as too tricky; after the wildcard parsing that already happens, detect whether the files to be copied are in fact directories and copy them recursively as such.

I'm more than willing to hack on this.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2010-08-02)

I think we should discuss this with users a bit first. The point of the existing rather limited support for globbing is to avoid accidentally picking up more files than was intended (e.g. hidden or generated files). By limiting it to files with a common extension this risk is greatly reduced. Perhaps we could make it explicit by only doing recursive copy for directories that are listed in the data-files field with a trailing directory slash, e.g. data-files: graphics/

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @ezyang on 2010-08-09)

I will note, for whatever it's worth, that this design policy has lead me to write scripts that do regular style globbing and convert it into something I can place in my Cabal file. :-)

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by cygnus on 2010-08-09)

I would support a trailing slash option.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2010-08-10)

See also #794.

@hdgarrood
Copy link
Contributor

I think the issue IDs were rearranged -- #794 doesn't seem to be relevant to this issue. #784 is, however.

@23Skidoo
Copy link
Member

@hdgarrood Yes, @dcoutts refers to http://hackage.haskell.org/trac/hackage/ticket/794 . Cross-references got mixed up during the trac -> github import.

@mietek
Copy link
Contributor

mietek commented Nov 26, 2014

Having data-files: static/*.foo not glob static/*.bar.foo is rather surprising. A documented gotcha is still a gotcha.

I would support using a standard globbing mechanism in place of the current one, which also seems to have some odd corner cases. (#2030)

@mietek
Copy link
Contributor

mietek commented Nov 26, 2014

Halcyon supports declaring additional data-files for use at run-time with the HALCYON_EXTRA_DATA_FILES option, using standard GNU bash globbing syntax.

See Haskell Language for an example of declaring static website content as data files.

@BardurArantsson
Copy link
Collaborator

Tihs is either superceded by (or supercedes) #784 . Can we please close one of them?

EDIT: Actually, it's superceded. Glob syntax allows for directories (recursively) via "foo/*/"

@23Skidoo 23Skidoo modified the milestones: Cabal 1.24, Cabal 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: Cabal 2.0 Sep 6, 2016
@ezyang
Copy link
Contributor

ezyang commented Sep 6, 2016

OK, closing this one.

@ezyang ezyang closed this as completed Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants