You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say you have a somewhat involved cabal.project, e.g. referencing a number of dependency repositories. And say you want to build this with some different settings (e.g. without optimization for local dev, with some particular GHC settings for CI and production builds. Current ways to do that that I'm aware of:
maintain multiple versions of cabal.project.local, and manipulate those using external tools (e.g., copy cabal.project.local.ci over cabal.project.local in CI); this is quite error prone (overwrites local user config when testing, ...)
maintain multiple copies of the whole set cabal.project{,.freeze,.local}, e.g. by symlinking (fragile depending on OS, lots of files, unobvious)
Both approaches also lose the option of using cabal.project.local for what it appears to be meant for: local temporary changes. E.g. when debugging CI builds locally, I'd still like to be able to temporarily disable optimization by writing to the "local settings" file.
My suggestion (happy for other ways to improve the situation though!):
Add a flag --extra-project-file; any arguments to this are merged into the project config the way cabal.project.local is currently. I.e., cabal cmd --extra-project-file cabal.project.ci --extra-project-file cabal.project.debug would merge the config by starting with cabal.project, then updating the settings in turn (and in that order) by cabal.project.ci, cabal.project.debug and cabal.project.local.
Activity
fgaz commentedon Aug 30, 2021
Similar features were also discussed in #7556 (comment) #3738 (comment)
edit: i'm not implying this is a duplicate, just referencing stuff
gbaz commentedon Aug 30, 2021
I think the former could be done in a way that subsumes this, by giving
includeclauses in projects an associated command line flag.jneira commentedon Mar 5, 2022
include files in cabal.project would be added by #7783