Skip to content

Allow globbing in the install stanza #6018

@ivg

Description

@ivg

Desired Behavior

The following should be accepted,
(install
  (files (glob_files *.lisp))
  (package bap-primus-lisp)
  (section (site (bap lisp))))

Instead if fails with

dune build
File "plugins/primus_lisp/site-lisp/dune", line 2, characters 9-28:
2 |   (files (glob_files *.lisp))
             ^^^^^^^^^^^^^^^^^^^
Error: invalid format, <name> or (<name> as <install-as>) expected

Justification

Sometimes we just want to install all data files from a certain directory, like all *.png files or lisp codes, etc. Other build systems, e.g., oasis, cmake, autotools commonly allow this, so this sounds as an expected feature for a build system. Right now I have to enumerate each file which bloats the dune file and makes it easy to forget to include a file.

Alternatives

Other build systems allow the installation of directories, which might (or might not) be easier to implement.

Workarounds

Right now I just abuse Emacs C-u M-| ls to include all files in the directory, but if there are any other options (like generating the installation files) or some stanza that I am missing, the I will be happy to learn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions