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. |
8ca68d3 to
eafe997
Compare
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
|
Thanks 🙏🏽 |
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: