ocaml/dune

allow excluding certain files being copied to the build folder

Offen

#4.865 geöffnet am 20.08.2021

 (8 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)OCaml (478 Forks)github user discovery
help wanted

Repository-Metriken

Stars
 (1.882 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 1T 20h) (345 gemergte PRs in 30 T)

Beschreibung

Desired Behavior

Currently there are ways to exclude certain directories from being copied to the build folder, but there is no way (or at least I could not find one reading the Stanza Reference page) to stop copying certain files.

I would like to suggest adding a stanza like (ignored_files ...) or a stanza like (files ...) to allow explicit exclusion of files to be copied to the build folder.

I believe it is in general nice to have this possible, and it comes especially handy when the build needs to execute external commands whose behavior may depends on specific files in the current directory. For example, in my case I would like to exclude the .git file under a git submodule, whose presence in the build folder messes up invocations to git, and I am using a workaround to delete the copied .git file before invoking any git commands.

Example

project structure

<project_root>/
- .some-file-to-be-excluded
- dune
- dune-project
- module1/
  - ...

_build directory with an empty dune file

_build/default
- .some-file-to-be-excluded
- dune
- dune-project
- module1/
  - ...

contents of dune, (ignore_files ...) variant

(ignored_files .some-file-to-be-excluded)

contents of dune, (files ...) variant

(files :standard \ .some-file-to-be-excluded)

_build directory with a dune file of either variant listed above

_build/default
- dune
- dune-project
- module1/
  - ...

Contributor Guide