Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple cabal.project files with different names #3738

Closed
choener opened this issue Aug 30, 2016 · 6 comments
Closed

multiple cabal.project files with different names #3738

choener opened this issue Aug 30, 2016 · 6 comments

Comments

@choener
Copy link

choener commented Aug 30, 2016

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.

@ezyang
Copy link
Contributor

ezyang commented Aug 30, 2016

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.

@dcoutts
Copy link
Contributor

dcoutts commented 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.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.

@ezyang
Copy link
Contributor

ezyang commented 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 ezyang added this to the milestone Sep 6, 2016
@ezyang
Copy link
Contributor

ezyang commented Sep 6, 2016

Not a priority for 2.0 release.

@choener
Copy link
Author

choener commented 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
Copy link
Contributor

We have --project-file now, and #5271 is explicitly tracking being able to set the builddir from project files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants