managing local cabal package database

Dear Cafe readers, I'm wondering what do you guys use as the general method in developing projects using your own private projects? Cabal allows to specify a directory for local packages ('local-repo' in '.cabal/config') with specific structure. Are there any scripts that take a git repo, checkout its tags one by one and put them in some specified directory in the correct way? The crude structure I'm imagining is that I'd like to reuse general purpose stuff I have made myself before, and have it available similar to having it in Hackage. Why I don't want to put my things in the Hackage itself, is that the code often changes fast, and would be little help to others until some later date, when things have calmed down.. (Does this seem a reasonable procedure, or how do you do it?) Cheers, -- Carl Eyeinsky

Hi Daniel (and other readers), the use case is that if I have several versions of the private dependency. I.e I develop a project A, and after a while I find, that part of it wold be useful to break out to another package, so I make a package X and list it as dependencie. Here, 'add-source' works. BUT, some time later I'm done with A, and start developing B, and include X as a dependencie. Then, I find that X could use some improvements -- but after these my project A probably breaks due to these changes. The solution, of course, is versioning, but I think 'add-source' doesn't help there anymore (right?), unless I copy the head to another directory and do the improvements there. This last mentioned way (of leaving a trail of previous versions) is a manual way of version management. What I was thinking of is that, is there some paved solution available (short of running my own Hackage, which some do, as I've been reading.) Sorry -- I should have been much more explicit! Cheers, On Mon, Dec 15, 2014 at 10:00 AM, Daniel Trstenjak < daniel.trstenjak@gmail.com> wrote:
Hi Carl,
I'm wondering what do you guys use as the general method in developing projects using your own private projects?
Using a 'cabal sandbox' and its command 'add-source' to add a local library seems to be the way to go.
Greetings, Daniel _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Carl Eyeinsky

I'm afraid I can't offer you any solutions yet, but here's how we do it:
We run our own hackage and have a wrapper around cabal that uses a separate
sandbox for each git branch. We also have one repository that contains most
of our cabal projects, submodules add a lot of overhead. This all works
well for local development but causes some problems with CI since we can
only increment version numbers on the master branch, non-master builds need
to checkout and build from the repository. I'd like to be able to use git
hashes as version numbers, and thinking about it it may actually fit into
our current workflow. I'll have to try it out :)
- Adam
On Mon, Dec 15, 2014 at 1:34 PM, Carl Eyeinsky
Hi Daniel (and other readers),
the use case is that if I have several versions of the private dependency.
I.e I develop a project A, and after a while I find, that part of it wold be useful to break out to another package, so I make a package X and list it as dependencie. Here, 'add-source' works. BUT, some time later I'm done with A, and start developing B, and include X as a dependencie. Then, I find that X could use some improvements -- but after these my project A probably breaks due to these changes. The solution, of course, is versioning, but I think 'add-source' doesn't help there anymore (right?), unless I copy the head to another directory and do the improvements there.
This last mentioned way (of leaving a trail of previous versions) is a manual way of version management. What I was thinking of is that, is there some paved solution available (short of running my own Hackage, which some do, as I've been reading.)
Sorry -- I should have been much more explicit!
Cheers,
On Mon, Dec 15, 2014 at 10:00 AM, Daniel Trstenjak < daniel.trstenjak@gmail.com> wrote:
Hi Carl,
I'm wondering what do you guys use as the general method in developing projects using your own private projects?
Using a 'cabal sandbox' and its command 'add-source' to add a local library seems to be the way to go.
Greetings, Daniel _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Carl Eyeinsky
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi Carl,
The solution, of course, is versioning, but I think 'add-source' doesn't help there anymore (right?), unless I copy the head to another directory and do the improvements there.
Assuming you have a git/svn/whatever repository for package X, then I would most likely create a version 0.1 branch of package X and let project A depend on version 0.1, and in the same way have a version 0.2 branch for project B. This way you can't use the wrong branch of package X without cabal yelling at you, that the desired version isn't available. Yes, you would have two checkouts of package X, each one switched two the desired version. Otherwise having your own Hackage server seems to be the only way to have an automatic version resolution. Greetings, Daniel

Consider using FP Complete's stackage server and snapshots. You can include different versions in different snapshots. http://bit.ly/1vNjqHV I use it at Signal Vine, and am very happy with it. On 15/12/14 14:34, Carl Eyeinsky wrote:
Hi Daniel (and other readers),
the use case is that if I have several versions of the private dependency.
I.e I develop a project A, and after a while I find, that part of it wold be useful to break out to another package, so I make a package X and list it as dependencie. Here, 'add-source' works. BUT, some time later I'm done with A, and start developing B, and include X as a dependencie. Then, I find that X could use some improvements -- but after these my project A probably breaks due to these changes. The solution, of course, is versioning, but I think 'add-source' doesn't help there anymore (right?), unless I copy the head to another directory and do the improvements there.
This last mentioned way (of leaving a trail of previous versions) is a manual way of version management. What I was thinking of is that, is there some paved solution available (short of running my own Hackage, which some do, as I've been reading.)
Sorry -- I should have been much more explicit!
Cheers,
On Mon, Dec 15, 2014 at 10:00 AM, Daniel Trstenjak
mailto:daniel.trstenjak@gmail.com> wrote: Hi Carl,
> I'm wondering what do you guys use as the general method in developing projects > using your own private projects?
Using a 'cabal sandbox' and its command 'add-source' to add a local library seems to be the way to go.
Greetings, Daniel _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Carl Eyeinsky
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Cabal allows to specify a directory for local packages ('local-repo' in '.cabal /config') with specific structure. Are there any scripts that take a git repo, checkout its tags one by one and put them in some specified directory in the correct way?
have a look at the bug report for cabal to support it. there are some pointers on how to do it manually. i don't have the script handy, but it is pretty trivial. cheers, tob(ias florek)
participants (5)
-
Adam Bergmark
-
Carl Eyeinsky
-
Daniel Trstenjak
-
Roman Cheplyaka
-
Tobias Florek