-
Notifications
You must be signed in to change notification settings - Fork 697
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
shell hooks for augmenting how cabal-install does various actions? #7394
Comments
there may already be a tracking ticket related to this, but i'm not super familiar with older tickets ;) |
loosely related is #3600 |
One possible way of supporting hooks is by extending the experimental branch described here. In that branch, functions like runProjectPreBuildPhase and freezeAction have been wrapped in newtypes. Potential "hooks" that added behavior to those functions (shell invocations, logging, and so on) could be defined as functions |
This is for |
I believe yes :) |
A proof-of-concept of how cabal-install script hooks could work is here. In the cabal project we wish to compile, the following folder structure should exist:
cabal-install ignores the hooks by default; hook handling is enabled through an environment variable, like this:
The
An example of
The hook-handling code is in There's no need of course for all the fancy inversion of control used in this example: cabal-install hook management could be integrated in the One thing to consider is what subset of the configuration information available at the pre-build phase should be passed to the script—and in what manner. Passing everything as script parameters might not be a good idea if we pass a lot of things, many of them optional. Perhaps we could write values to the script's stdin? |
what about environment variables? |
What's the status of the implementation of issue? |
maybe theres a ticket about this, but i was talking with @hasufell about cabal and he mentioned that in old discussions with HVR, there was the idea of making it easier to glue cabal into a overall toolchain if there were the sort of shell hooks a la git-hooks or https://paludis.exherbo.org/configuration/hooks.html
with example application for example being:
and then you could hook into phases of like pre_configure and invoke ghcup automatically, installing the requested project ghc version
at the moment, i think cabal's pre/post-
$FOO
(for some value of FOO) hooks are only supported as haskell function call backs, which hits a different point in the ease of scripting tradeoffsThe text was updated successfully, but these errors were encountered: