Skip to content
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 SetupHooks for Configure build-type #9969

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sheaf
Copy link
Collaborator

@sheaf sheaf commented May 3, 2024

This commit implements the Configure build-type in terms of Hooks, when build-type: Hooks is available (for Cabal >= 3.13).

This moves Configure away from an implementation in terms of UserHooks, i.e. away from the Custom build-type.


Template Α: This PR modifies the Cabal API, as it changes the type of the runConfigureScript function and exposes autoconfSetupHooks from Distribution.Simple.

@alt-romes
Copy link
Collaborator

I've added a changelog entry. I've looked through the mentions of configure build-type in the documentation but it is all agnostic to the underlying implementation, so nothing had to be updated. There already exist many tests for the configure build type, so none had to be added either.

This is a great improvement and future proofs build-type: Configure. In fact, when Hooks no longer implies legacy-fallback, neither will Configure!

@alt-romes alt-romes requested review from gbaz and geekosaur May 6, 2024 16:13
@andreabedini
Copy link
Collaborator

Great work. How sure are we that existing Configure type builds will keep working as before?

@alt-romes
Copy link
Collaborator

Great work. How sure are we that existing Configure type builds will keep working as before?

As long as the existing testsuite can observe configure build type for working, the new implementation is working in that it also works for the same testsuite. I’m not entirely sure if you can test divergence between the two (e.g. by comparing a substitution file or environment variables or something) since we didn’t keep the old implementation.

This commit implements the Configure build-type in terms of Hooks,
when build-type: Hooks is available (for Cabal >= 3.13).

This moves Configure away from an implementation in terms of UserHooks,
i.e. away from the Custom build-type.
@sheaf
Copy link
Collaborator Author

sheaf commented May 7, 2024

Great work. How sure are we that existing Configure type builds will keep working as before?

I've built stackage with a patch that contains these changes and it has successfully built all packages (including e.g. time, process etc).

@andreabedini
Copy link
Collaborator

I've built stackage with a patch that contains these changes and it has successfully built all packages (including e.g. time, process etc).

Great 👌 I wasn't entirely sure we could have expected any change in semantic.

@alt-romes
Copy link
Collaborator

@andreabedini would you like to officially approve this?

Copy link
Collaborator

@andreabedini andreabedini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let me summarise:

  • we leave autoconfUserHooks as it is
  • we introduce autoconfSetupHooks to expose the same logic (in runConfigureScript) with the new API.
  • cabal-install will prefer autoconfSetupHooks when it is available.

Do I have this right?

💯 👍

@sheaf
Copy link
Collaborator Author

sheaf commented May 10, 2024

Looks good. Let me summarise:

* we leave `autoconfUserHooks` as it is

* we introduce `autoconfSetupHooks` to expose the same logic (in `runConfigureScript`) with the new API.

* cabal-install will prefer `autoconfSetupHooks` when it is available.

Do I have this right?

💯 👍

Yes. I suppose we could also remove autoconfUserHooks. The logic about which one to use is in cabal-install, and that will use whichever one is available in the Cabal library we are using.

@andreabedini
Copy link
Collaborator

Yes. I suppose we could also remove autoconfUserHooks.

For the sake of not breaking too many things, I would suggest leaving it. That you were able to implement both APIs on top of the same core logic suggests it's not going to be burden.

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.

None yet

5 participants