Skip to content

Rules cannot have optional file dependencies #298

Closed

Description

@timbertson

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).

Activity

  1. rgrinberg commented on Jul 7, 2018

    @rgrinberg
    Member

    @diml do optional dependencies make sense for dune? Does jenga support such dependencies?

  2. rgrinberg commented on May 24, 2019

    @rgrinberg
    Member

    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.

  3. ghost closed this as completedon May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions