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
{{ message }}
Repository navigation
multiple cabal.project files with different names #3738
I would like to have more than one project file for new-build / new-configure and select them via --project-file or similar.
This would allow a workflow, where I have a default cabal.project that uses, say, only the packages known on hackage, and another cabal.devel.project where I point toward updated local packages that I currently work on.
This is mostly about convenience because I then do not have to clear the project file once I merge into the main branch.
This seems eminently reasonable. We recently added an (undocumented, because it doesn't work in cabal-install) --cabal-file field for Setup, no reason we can't do it here. It will also help with some of the test-cases we have in the test suite.
There's no problem in principle with this, but I'd like to point out an approach that I think we should take that would cover this use case better, which is to have "profiles" in the project.cabal file. Initially we would only allow one profile to be selected at once, so this would cover this use case (but means you don't need to have separate files and duplicate everything), but later we would extend things to allow multiple named profiles (to cover the server/client ghc/ghcjs use cases). Closely related to this is the ability to explicitly include one file into another (e.g. explicitly include freeze files, or conditionally select one freeze file or another for dev vs ci & deployment).
So, point is I'm not going to object to this being added, but we can do better for this use case so we should aim for that.
This ticket brings up an interesting point, which is that arguably @choener wants a dist-newstyle per project file. Which would help avoid the caches clobbering each other (the per-GHC build dirs in HEAD helps, but sometimes it won't kick in.)
I could live with a minimal version where there are just different profiles (in one or more files), as well as a more developed thing where we end up with different dist-newstyle folders (which would be nice to have).
One advantage of different files for different profiles is that the cabal.project file can be made part of the hackage upload, while I could keep my cabal.devel.project file only in the repository. It tends to contain system-specific changes anyway (like relative paths to in-house libraries) that are invalid everywhere else. As such I wouldn't want to pollute hackage with them.
Activity
ezyang commentedon Aug 30, 2016
This seems eminently reasonable. We recently added an (undocumented, because it doesn't work in cabal-install)
--cabal-filefield for Setup, no reason we can't do it here. It will also help with some of the test-cases we have in the test suite.dcoutts commentedon Sep 4, 2016
There's no problem in principle with this, but I'd like to point out an approach that I think we should take that would cover this use case better, which is to have "profiles" in the
project.cabalfile. Initially we would only allow one profile to be selected at once, so this would cover this use case (but means you don't need to have separate files and duplicate everything), but later we would extend things to allow multiple named profiles (to cover the server/client ghc/ghcjs use cases). Closely related to this is the ability to explicitly include one file into another (e.g. explicitly include freeze files, or conditionally select one freeze file or another for dev vs ci & deployment).So, point is I'm not going to object to this being added, but we can do better for this use case so we should aim for that.
ezyang commentedon Sep 4, 2016
This ticket brings up an interesting point, which is that arguably @choener wants a dist-newstyle per project file. Which would help avoid the caches clobbering each other (the per-GHC build dirs in HEAD helps, but sometimes it won't kick in.)
ezyang commentedon Sep 6, 2016
Not a priority for 2.0 release.
choener commentedon Sep 12, 2016
I could live with a minimal version where there are just different profiles (in one or more files), as well as a more developed thing where we end up with different dist-newstyle folders (which would be nice to have).
One advantage of different files for different profiles is that the cabal.project file can be made part of the hackage upload, while I could keep my cabal.devel.project file only in the repository. It tends to contain system-specific changes anyway (like relative paths to in-house libraries) that are invalid everywhere else. As such I wouldn't want to pollute hackage with them.
quasicomputational commentedon Jul 9, 2018
We have
--project-filenow, and #5271 is explicitly tracking being able to set the builddir from project files.