Skip to content

Allow for a build environment without a current package #1576

Closed

Description

@tibbe

I've brought this up in a number of different places now so I think it deserves a bug of its own.

I envision that as Haskell gets wider adoption companies (and other large creators of Haskell software) will want to structure their internal packages like so:

src
  |-- package-a
  |  | -- package-a.cabal
  |-- package-b
     | -- package-b.cabal
  .
  .
  .

While working on e.g. package-a you might want to make a change to its dependency e.g. package-b and test the two together.

This is possible today by either

  • using cabal sandbox add-source, but that mechanism becomes unwieldy when there are lots of add-source dependencies (i.e. all of the company's internal packages), or
  • by running a local Hackage, which is even worse, as you need to make a myriad of small releases every time one developers work is to be made visible to another.

I propose that we implement a workflow that allows users to do this:

$ cd src
$ cabal build package-a:some-exe
# test package-a's exe...
$ cabal build package-b:some-other-exe
# test package-b's exe...

All source dependencies should be picked up automatically (without any add-source) e.g. by cabal searching the directory hierarchy for .cabal files. The build artifacts should be stored in e.g. src/dist.

This may or may not require sandboxes. We need to think about that.

Activity

  1. 23Skidoo commented on Nov 11, 2013

    @23Skidoo
    Member

    See also: #1367 (a duplicate of this ticket).

  2. tibbe commented on Nov 11, 2013

    @tibbe
    ContributorAuthor

    Closing in favor of #1367 as it's older.

  3. 23Skidoo commented on Nov 11, 2013

    @23Skidoo
    Member

    @tibbe

    add-source [...] becomes unwieldy when there are lots of add-source dependencies

    Is this mainly because of #1375? Are there any other issues with add-source that make it inappropriate here?

  4. tibbe commented on Nov 11, 2013

    @tibbe
    ContributorAuthor

    @23Skidoo It's independent of #1375. Imagine if you have 100-1000 packages. That's a lot of add-source type at the keyboard. You also risk forgetting to add-source some new package you create. If you delete a package you need to remember to remote it from the package environment and unregister any installed version from the sandbox. Cabal could do all this for you.

  5. 23Skidoo commented on Nov 12, 2013

    @23Skidoo
    Member

    @tibbe
    Right, but this still can be implemented with add-source under the hood. We can create a sandbox at the root of the tree and add-source everything.

    If you delete a package you need to remember to remote it from the package environment and unregister any installed version from the sandbox.

    This should simply be an add-source feature, not restricted to package trees.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions