You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jbuilder doesn't appear to have a way to specify "depend on this file, if it exists" - all dependencies are treated as mandatory, and the build will fail if a dependency cannot be built. That makes sense in most cases, but it can be useful to have an optional variant which allows the file to be missing (in which case it would be considered "changed" if it later gets created).
I discussed a use case for this in #255, essentially I want a rule (for version.ml) to depend on .git/HEAD, but I also want the rule to be buildable when there is no .git directory (e.g. when building from a plain tarball).
The text was updated successfully, but these errors were encountered:
Dune already supports optional dependencies. If you use (glob_files x) in a rule, it will only depend on x if x exists or is buildable. However, this doesn't help for the use case in this PR because directories starting with . are completely ignored by dune. #880 should solve this common use case.
So now it is possible to depend on .git/HEAD since the dirs stanza was introduced. However, this isn't really a good solution as we don't want to be scanning all of .git just for a single file.
jbuilder doesn't appear to have a way to specify "depend on this file, if it exists" - all dependencies are treated as mandatory, and the build will fail if a dependency cannot be built. That makes sense in most cases, but it can be useful to have an optional variant which allows the file to be missing (in which case it would be considered "changed" if it later gets created).
I discussed a use case for this in #255, essentially I want a rule (for
version.ml
) to depend on.git/HEAD
, but I also want the rule to be buildable when there is no .git directory (e.g. when building from a plain tarball).The text was updated successfully, but these errors were encountered: