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

Setup hooks #9551

Merged
merged 3 commits into from Apr 18, 2024
Merged

Setup hooks #9551

merged 3 commits into from Apr 18, 2024

Commits on Apr 18, 2024

  1. Split-off and re-export installFileGlob

    This commit exposes installFileGlob as a generally useful
    part of the API which users might want to call, e.g. in their
    custom Setup scripts.
    sheaf authored and Mikolaj committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    58af854 View commit details
    Browse the repository at this point in the history
  2. Split off file monitoring types into Cabal library

    This commit splits off the file monitoring types from cabal-install into
    the Cabal library, so that they can be referred to in pre-build rules
    for SetupHooks. This will allow package authors with Hooks build-type to
    monitor files and directories specified by globbing.
    sheaf authored and Mikolaj committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    b2a62b9 View commit details
    Browse the repository at this point in the history
  3. Introduce SetupHooks

    This commit introduces a new build-type, Hooks. A package using this
    build type should provide a SetupHooks.hs module which exports
    a value `setupHooks :: SetupHooks`. This is intended to replace the
    Custom setup type. This allows Cabal to have finer-grained information
    about the build, instead of having an opaque Setup executable to invoke.
    
    Tests include:
    
      - error when returning an invalid component diff in a
        per-component pre-configure hook
      - error when declaring pre-build rules whose dependency
        graph contains cycles
      - error when we cannot find a dependency of a pre-build rule
      - warning when there are pre-build rules that are declared but
        never demanded
      - correctness tests for SetupHooks, e.g. that
        pre-build rules are run in dependency order (see the
        `SetupHooksRuleOrdering` test)
    sheaf authored and Mikolaj committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    c5f9933 View commit details
    Browse the repository at this point in the history