Add program prefix and suffix to BuildOptions#11787
Conversation
24c1c44 to
bf07ec8
Compare
|
Should cabal-install be updated to use these fields to handle affixes (prefixes and suffixes)? It handles them today on the higher level, but now, if we can do it on the library level, we add redundancy? |
Which part of the All I could find was this, in ignoreProgramAffixes :: ConfigFlags -> ConfigFlags
ignoreProgramAffixes configFlags =
configFlags
{ configProgPrefix = NoFlag
, configProgSuffix = NoFlag
} |
|
I'm talking about these configProgPrefix/configProgSuffix. Are setup hooks not able to leverage those? Or vise versa? |
SetupHooks don't use |
|
@sheaf my bad. I dived a little deeper to try to substantiate my hunch, and here is the place that bothers me: cabal/Cabal/src/Distribution/Types/LocalBuildInfo.hs Lines 318 to 322 in e6ff0cc Shouldn't these read from the new build options instead? Something like: progPrefix, progSuffix :: LocalBuildInfo -> PathTemplate
progPrefix lbi@(LocalBuildInfo{configFlags = cfg}) =
fromMaybe
(fromFlag $ configProgPrefix cfg)
(programPrefix lbi)
progSuffix lbi@(LocalBuildInfo{configFlags = cfg}) =
fromMaybe
(fromFlag $ configProgSuffix cfg)
(programSuffix lbi) |
|
Hi, some questions because I'm curious. Also, wouldn't a test be helpful to assert the prefix and suffix gets passed down in a hook build type situation? |
tdammers
left a comment
There was a problem hiding this comment.
This does not actually introduce any code that uses these fields, does it?
Yes, excellent point. The values in |
c4daf04 to
3181f38
Compare
This was requested in #11168.
I added a test now. |
eafe997 to
5629b87
Compare
|
Thanks 🙏🏽 |
|
@sheaf: do you think it's ready to merge? If so, could you add a label? Do you think this should be backported to 3.18? |
Just need to update the structured test for CI. Yes, I think it would make sense to backport so that all the improvements to Hooks land in a single version. |
|
Queued — the merge queue status continues in this comment ↓. |
|
@sheaf may have missed it |
Merge Queue Status
This pull request spent 7 hours 30 minutes 54 seconds in the queue, including 1 hour 53 minutes 16 seconds running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks
Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. |
This commits adds two new fields of `BuildOptions`, namely `programPrefix` and `programSuffix`. This allows the installed executable program prefix and suffix to be set by `SetupHooks` for packages with `build-type: Hooks`. Fixes haskell#11168
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 5 hours 31 minutes 58 seconds in the queue, including 5 hours 20 minutes 53 seconds running CI. Required conditions to merge
|
This commits adds two new fields of
BuildOptions, namelyprogramPrefixandprogramSuffix. This allows the installed executable program prefix and suffix to be set bySetupHooksfor packages withbuild-type: Hooks.Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR: