-
Notifications
You must be signed in to change notification settings - Fork 710
Support for setup-tool-depends
#4648
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
Comments
The current guidance is that you should make a setup-helper package which has the build-tools dependency, so that the setup stanza stay simple. Does that work here? |
@ezyang but if you run library code living in a setup-helper package (and the setup-helper package depending on some executable), how does cabal know that it needs to propagate the build-tool-depends $PATH entry to your local setup stanza? Afaik, |
Yeah, the crux of the matter is we need some sort of "runtime" tool-depends for this pattern to work. I feel like we had a ticket for this but I don't know where it is. |
@ezyang are you referring to the discussion in #4104 (comment) ? |
That seems like a pretty good comment :) |
I put up a more general alternative here: #5411 |
A caveat here, at least with Cabal 2.4, PATH is only set correctly if performing per-component builds. For example with Qtah,
whereas the executable exists at
, there's an extra subdirectory there. |
Uh oh!
There was an error while loading. Please reload this page.
I just ran into a case in google/proto-lens#110 (comment) which requires us to specify a
build-tool-depend
-style dependency forcustom-setup
, as Setup.hs needs to be able to execute theproto-lens-protoc
tool provided by theproto-lens-protoc
package.I originally mistook #4047 for providing this feature, but then I realized this is subtly different (because #4047 is about replacing Setup.hs with an externally provided executable, while this is merely about the ability to specify dependencies on
exe
components); so we'd like to say something likePS: it appears that
build-tool-depends
in non-setup stanzas makes an executable available toSetup.hs
via $PATH, even though that wasn't obvious to me from the log-output, as the last environment-dump beforesetup
is executed didn't show it in the $PATH. So it seems the environment dumped only applied to theghc --make Setup.hs
invocation, but thesetup
invocation used a different not-shown environment.However, this also means we can actually fake #4047 already now with a trivial
Setup.hs
(which needs at mostbase
andprocess
) which merely re-executes an external executable imported viabuild-tool-depends
The text was updated successfully, but these errors were encountered: