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

Finish off external commands feature #9412

Merged
merged 2 commits into from
Nov 24, 2023

Commits on Nov 24, 2023

  1. External commands: Add tests for haskell#9402 haskell#9403 haskell#9404

    This adds 4 tests which test the new external commands feature:
    
    * ExternalCommand - Tests the expected usage of external command invoked
      via cabal-install
    * ExternalCommandSetup - Tests that the ./Setup interface does not
      support external commands (haskell#9403)
    * ExternalCommandEnv - Tests that environment variables are set and
      preserved appropiately  (haskell#9402)
    * ExternalCommandHelp - Test that `cabal help <cmd>` is interpreted appropiately (haskell#9404)
    mpickering authored and Mikolaj committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    7fb1ca6 View commit details
    Browse the repository at this point in the history
  2. Finish off the external commands feature

    * Remove 'CommandDelegate' in favour of abstracting the fallback in
      'commandsRun', there is a new variant 'commdandRunWithFallback' which
      takes a continuation
      - This restores the modularity between the `Cabal` library and
        `cabal-install` as now `Cabal` doesn't need to know anything about
        the external command interface.
      - Fixes haskell#9403
    * Set the $CABAL environment variable to the current executable path
      - This allows external commands to be implemented by calling $CABAL,
        which is strongly preferred to linking against the Cabal library as
        there is no easy way to guantee your tool and `cabal-install` link
        against the same `Cabal` library.
      - Fixes haskell#9402
    * Pass the name of the argument
      - This allows external commands to be implemented as symlinks to an
        executable, and multiple commands can be interpreted by the same
        executable.
      - Fixes haskell#9405
    * `cabal help <cmd>` is interpreted as `cabal-<cmd> --help` for external
      commands.
      - This allows the `help` command to also work for external
      commands and hence they are better integrated into cabal-install.
      - Fixes haskell#9404
    
    The tests are updated to test all these additions.
    
    These features bring the external command interface up to par with the
    cargo external command interface.
    mpickering authored and Mikolaj committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    d8ebb81 View commit details
    Browse the repository at this point in the history