-
Notifications
You must be signed in to change notification settings - Fork 847
Description
I'm opening this issue discuss the possibility of adding a configure-options option, to add arguments passed to Setup.hs configure, as mentioned in #846 (among others).
I'm broadly in favour of the idea, with the following misgivings and design considerations.
Stack may not be using the Cabal library forever, in which case these options would no longer work. But moving away from Cabal is a ways off (if ever), and I think in that case we'd just bite the bullet and remove this option.
Some configure options must apply to all packages in a snapshot (e.g. --enable-library-profiling needs all packages to be built with that flag, and likely similar for --enable-split-objs), while others will work when only only to local packages or to targets. ghc-options can already suffer from similar problems and they're not handled very well right now, but it's more acute with configure-options. We'd need to be able to indicate which packages the configure-options apply to (e.g., all packages including snapshots, all local packages, or specific packages).
The alternative is that, when need for a new configure option is identified (e.g. in #1284 and #593), we add it to Stack explicitly. Since configure arguments will normally fall into two or three categories, it should be possible to modify the current design to make it quite easy to add these whenever the need comes up.
For either approach, Stack's current design doesn't handle the snapshots case very well, but extensible snapshots (#863, #1265) should fix that.