-
Notifications
You must be signed in to change notification settings - Fork 714
SetupWrapper: separate determining and running Setup #3762
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
Conversation
So, if I understand correctly, the refactor introduces two new types |
Yeah, I still have to fix some merge conflicts that I resolved incorrectly. Is it a known bug that test output doesn't show up in AppVeyor? |
No; I've never seen the test suite do that log before. |
Refactoring SetupWrapper is a good idea in general. |
@ttuegel I've not looked at the code yet, but I support the principle. Is there any chance that having separated out the working of which Cabal CLI/API version the Setup supports from calling it, that it becomes possible to skip the first step entirely if we know in advance what version will be used? I ask because the "new-build" code path does know up front what Cabal CLI version will be used and this could help simplify things a bit. |
#3723 is related. |
If we know what Cabal version is being used and we know if we need an external, internal, or self-exec method, then we can simply construct a |
7bbe4e1
to
4266562
Compare
The two phases of setupWrapper (configuration and execution) are separated into the getSetup and runSetup functions. This allows us to skip configuration if the setup method is known; this is the case when running multiple commands in sequence or in the new-build system. Splitting the phases also allows us to choose which _command_ to run based on the Cabal version in use; setupWrapper demands a fixed choice of command and only allows the command _flags_ to vary depending on the version.
4266562
to
241304f
Compare
It is useful to know outside of
setupWrapper
which Setup version willbe used, so the two phases (knowing and running) are separated.
This is merely refactoring. I need it for my
reconfigure
branch and I don't want it to get merge-conflicted again while I finish that feature.