-
Notifications
You must be signed in to change notification settings - Fork 841
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
Use a hard-coded tool dependency map (fixes #4125) #4132
Conversation
0bf5e1d
to
512f76f
Compare
Some design decision time. Stack originally (and through the 1.7 release) calculated build tools by looking at all of the packages in a snapshot, finding the executables they provide, and performing a reverse lookup for any build-tools values. This works, but:
Starting with Cabal 2.0 (or 2.2), there's a new feature in the cabal file format called build-tool-depends, which allows you to specify which package a tool comes from, bypassing the need for the reverse lookup. cabal-install handles the legacy build-tools field with a hard-coded list of packages like This may cause some existing builds to break, but that's highly doubtful, and can be worked around easily enough by switching to build-tool-depends and/or explicitly building the needed dependencies. I lean in favor of merging this because matching cabal behavior is a Good Thing, pushing towards the new build-tool-depends and more explicit deps is a Good Thing, and reducing complexity in our code base is a Good Thing 😄 . I'd say let's give it another few days for someone to object, and to confirm it fixes #4125, and then we can merge. |
512f76f
to
ba9179e
Compare
N.B. I made haskell/cabal#5412 based on the issues I had making |
I'm not quite sure of the question, but I'll give an answer related to other bugs I've seen. I think it's a mistake for Cabal to hide the |
As an update: this does in fact seem to solve #4125. |
This sounds good to me. I have an addition for the list of tools:
If a tool is not in the hard-coded list, does/should the install fail, or fall back to the old behaviour ? |
I'll add that, no problem. If it's not in the hard-coded list, and the executable isn't already available with that name, Stack will print a warning, and the build itself will most likely fail. Falling back to the old behavior would require all of the complicated code I mentioned which is suffering from the bugs right now and preventing performance optimizations. |
@snoyberg [BTW, happy to talk about this elsewhere as I'm definitely veering off-topic.] Being able to only build the libraries components of |
OK, that motivation makes a lot more sense, I hadn't heard it before. I still think it's best to leave Stack as-is for maximum backwards compatibility, I know in particular the hspec-discovery thing has caused breakage with new-build. |
This is a fundamental change to how Stack discovers build tools, its inclusion should be discussed before we merge. We should also wait to see if it actually fixes #4125.
Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!