Skip to content

multiple cabal.project files with different names #3738

Closed

Description

@choener

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.

Activity

  1. ezyang commented on Aug 30, 2016

    @ezyang
    Contributor

    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.

  2. added
    cabal-install: v2-build system
    on Aug 30, 2016
  3. dcoutts commented on Sep 4, 2016

    @dcoutts
    Contributor

    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.

  4. ezyang commented on Sep 4, 2016

    @ezyang
    Contributor

    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.)

  5. added this to the ⊥ milestone on Sep 6, 2016
  6. ezyang commented on Sep 6, 2016

    @ezyang
    Contributor

    Not a priority for 2.0 release.

  7. choener commented on Sep 12, 2016

    @choener
    Author

    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.

  8. quasicomputational commented on Jul 9, 2018

    @quasicomputational
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cabal-install: v2-build systemtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions