Skip to content

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

Merged
merged 1 commit into from
Sep 7, 2016

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Sep 2, 2016

It is useful to know outside of setupWrapper which Setup version will
be 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.

@ttuegel ttuegel self-assigned this Sep 2, 2016
@mention-bot
Copy link

@ttuegel, thanks for your PR! By analyzing the annotation information on this pull request, we identified @23Skidoo, @dcoutts and @tibbe to be potential reviewers

@ezyang
Copy link
Contributor

ezyang commented Sep 2, 2016

So, if I understand correctly, the refactor introduces two new types Setup and SetupMethod which capture the intermediate result of determining what Setup will be used, but otherwise keeps the logic the same? If so, sounds good to me; but let's document the new types. (The commit is a bit fuzzy so it was hard to follow.)

@ttuegel
Copy link
Member Author

ttuegel commented Sep 2, 2016

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?

@ezyang
Copy link
Contributor

ezyang commented Sep 2, 2016

No; I've never seen the test suite do that log before.

@23Skidoo
Copy link
Member

23Skidoo commented Sep 3, 2016

Refactoring SetupWrapper is a good idea in general.

@dcoutts
Copy link
Contributor

dcoutts commented Sep 3, 2016

@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.

@grayjay
Copy link
Collaborator

grayjay commented Sep 4, 2016

@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.

@ttuegel
Copy link
Member Author

ttuegel commented Sep 6, 2016

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.

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 Setup with the correct values and skip the first step.

@ttuegel ttuegel force-pushed the setup-wrapper branch 3 times, most recently from 7bbe4e1 to 4266562 Compare September 6, 2016 16:35
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.
@ttuegel ttuegel merged commit b821e86 into haskell:master Sep 7, 2016
@ttuegel ttuegel deleted the setup-wrapper branch September 7, 2016 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants