haskell-distributed / distributed-process-platform

DEPRECATED (Cloud Haskell Platform) in favor of distributed-process-extras, distributed-process-async, distributed-process-client-server, distributed-process-registry, distributed-process-supervisor, distributed-process-task and distributed-process-execution
http://haskell-distributed.github.com
BSD 3-Clause "New" or "Revised" License
47 stars 18 forks source link

Add makefile to install development branches into a sandbox #71

Closed alanz closed 10 years ago

alanz commented 10 years ago

I have added a makefile that initialises a cabal sandbox, checks out (and refreshes) the development branches of the dependency repos, and installs it all into the sandbox.

All the tests pass except one, which I suspect is a nondeterminism thing that can be solved by sorting the result before comparing

Named Process Monitoring/Tracking:
  Process Death Results In Unregistration: [Failed]

Expected: equalTo ["proc.name.1","proc.name.2"]
     but: was ["proc.name.2","proc.name.1"]
  Monitoring Name Changes: [OK]
  Monitoring Registration: [OK]
hyperthunk commented 10 years ago

Hi Alan! Thanks for this, I do appreciate the input. There are however, a few minor problem with it right now. Firstly, I cannot get a recent enough version of cabal installed with GHC 7.4.x in order to use it, which is a version that we're keen to still support. We did, in fact, have a very very similar pull request here: https://github.com/haskell-distributed/distributed-process-platform/pull/68. I asked the submitter to rework the makefile so that it could be used with all cloud haskell projects, and we've integrated that into this makefile: https://github.com/haskell-distributed/cloud-haskell/blob/development/build.mk.

The idea is that all the cloud haskell projects can be checked out via the cloud-haskell umbrella, and then all they need is a makefile like this:

include ../build.mk

Now there are some oddities with that generic makefile, and I wonder if you'd be willing to fix that (and help us work towards having a generic build system that all CH projects can benefit from) instead of us merging this PR? Some of the issues with that makefile are

  1. it clones the required repositories even when they're co-locate in the umbrella
  2. it uses a per-repo file called REPOS to locate dependencies, when it could just parse the local cabal file
  3. it is only useful if the project is cloned inside of the "umbrella" directory - not sure how to fix that?

Also, the test failure for "Named Process Monitoring/Tracking" is exactly what you thought it was - an issue with unordered collections. I thought I'd fixed that (in the tests) but obviously I forgot or didn't merge it properly. I've made a note to fix it though.

Please let me know your thoughts about this...

Cheers!

Tim

hyperthunk commented 10 years ago

Hey @alanz - would you mind trying the latest development branch snapshot (against https://github.com/haskell-distributed/cloud-haskell/blob/development/Makefile) to see if the changes I've put in place so far are up to scratch? Happy to continue discussing this and making changes/improvements as necessary.

hyperthunk commented 10 years ago

I actually like this makefile after all. Let me take it and integrate the sandbox thing into our build.mk infrastructure and I'll let you know how I get on.

hyperthunk commented 10 years ago

Right... I've just updated the build.mk utility to use cabal sandboxes, and it looks to be working quite nicely. There's probably more to do, but please take a look over the changeset if you've got time, and let me know if you get on with it alright.

https://github.com/haskell-distributed/cloud-haskell/commit/ceaa694fa650f306499aa97a92d4d866d5cb2fcf and https://github.com/haskell-distributed/cloud-haskell/commit/d0ecd4b4be76a73d9ccc21e2d476cad98160999d

Note that what I'm doing once I've checkout out the umbrella project is to run make -j so as to check out all the dependent repos, then thus:

$ cd distributed-process-platform
$ make BRANCH=development LOCAL=true BASE_DIR=`pwd` install

and subsequently make BRANCH=development LOCAL=true BASE_DIR=/Users/t4/work/hyperthunk/cloud-haskell compile to build and/or test....

alanz commented 10 years ago

If I follow your instructions I end up with a missing build.mk, since the initial checkout from the top level brings in the master.

Testing against cloud-haskell/development/head. Must I use the specific hash you gave?

Alan

On Sun, Feb 16, 2014 at 6:14 PM, Tim Watson notifications@github.comwrote:

Right... I've just updated the build.mk utility to use cabal sandboxes, and it looks to be working quite nicely. There's probably more to do, but please take a look over the changeset if you've got time, and let me know if you get on with it alright.

haskell-distributed/cloud-haskell@ceaa694https://github.com/haskell-distributed/cloud-haskell/commit/ceaa694fa650f306499aa97a92d4d866d5cb2fcf

Note that what I'm doing once I've checkout out the umbrella project is to run make -j so as to check out all the dependent repos, then thus:

$ cd distributed-process-platform$ make BRANCH=development LOCAL=true BASE_DIR=pwd install

and subsequently make BRANCH=development LOCAL=true BASE_DIR=/Users/t4/work/hyperthunk/cloud-haskell compile to build and/or test....

Reply to this email directly or view it on GitHubhttps://github.com/haskell-distributed/distributed-process-platform/pull/71#issuecomment-35200553 .

hyperthunk commented 10 years ago

Urgh - sorry about that. You should be able to use development/head yes. :/

hyperthunk commented 10 years ago

Alan - are you happy with the build changes I've made now, in the build.mk system that is included in https://github.com/haskell-distributed/cloud-haskell and that is referenced by this and the other projects? It is using cabal sandboxes and so on.

If so, can we close this pull request? You can always fix and/or improve things in build.mk generically now, and reap the benefit in all the other projects using it.

alanz commented 10 years ago

Just checked it, looks great. An update to the README giving basic operations would be good, I did

git clone https://github.com/haskell-distributed/cloud-haskell.git
cd cloud-haskell
git checkout development
make
make force-install
hyperthunk commented 10 years ago

Ah cool. Question: did force-install work for you so your applications could reference distributed-process-platform (et al) and still build properly? Annoyingly I found that worked, but I couldn't subsequently build and test d-p or d-p-p. I had to revert to install everything apart from the wrapper package to do that. :(

hyperthunk commented 10 years ago

Ah yes, I'll update the README with more info. I'm sure these makefiles will need more work, but it seems like a good place to start.

alanz commented 10 years ago

Feedback on force-install

After the install, I went to my project, removed the cabal.sandbox.config, and set it to the new sandbox, doing

cabal sandbox init --sandbox=/home/alanz/mysrc/github/haskell-distributed/cloud-haskell/.cabal-sandbox

cabal update
cabal install --dependencies-only
cabal configure && cabal build

It repopulated the sandbox with my dependencies, then built without problems (except for cloud haskell API changes since I last updated, which I would expect)

hyperthunk commented 10 years ago

Ok that's good, thanks Alan!