chunkymonkey icon indicating copy to clipboard operation
chunkymonkey copied to clipboard

Remove 'godag' requirement for building chunkymonkey

Open jnwhiteh opened this issue 13 years ago • 5 comments

I've made a change in my fork that removes the dependency on the 'godag' program for building chunkymonkey. Instead we will be using gb, which has the advantage that it can produce scripts and Makefiles that allow anyone to build the software without installing additional software.

The structure is a bit more stringent, with everything that is a package under pkg and everything that produces a command under cmd. This also makes it a bit more obvious when looking at the source where in the package hierarchy something lies. I've included a script that will update the build scripts.

Basic usage (all commands run in src)

 # clean everything
 gb -c
 # clean then build
 gb -cb
 # build only pkg
 gb -Pb
 # build only cmd
 gb -Cb

The scripts included work as well without using gb:

 # clean everything
 ./build.sh clean
 # build everything
 ./build.sh
 # build only pkg
 ./build-pkg.sh
 # build only cmd
 ./build-cmd.sh

Take a look at master on my fork and see what you think. I think its an improvement, hopefully I'm not the only one. Don't bother trying to pull, just let me know and I'll push it to the main repository if its okay.

The master Makefile at the root needs to be updated or removed, it likely will not work any longer but I wasn't sure where we wanted those targets to end up.

jnwhiteh avatar Jun 24 '11 12:06 jnwhiteh

I may need you to let me know the specifics of your normal workflows so we can make sure that's not interrupted.

jnwhiteh avatar Jun 24 '11 20:06 jnwhiteh

I've been playing with this a bit, and I think I need a little more convincing. I'm in agreement that it would be good to remove the dependency for godag or something else, and this achieves that - so people wanting to test the server without installing too much can be satisfied - also the Makefile that I've had in place is getting rather ugly. However, it causes some costs elsewhere:

Here are some before (makefile+godag) observations versus afterwards, based on builds on my computer:

  • Clean build of everything: before: 3.8s, after: 5.4s (this isn't too bad in itself, however)
  • Non-clean build of everything: before: 1.9s-2.2s, after: 0.06s (clear win for the new build system)
  • Clean test run: before: 2.7s, after: 9.6s (this is my greatest pain point that will discourage fast test cycles)
  • Non-clean test run: before: 0.8s, after: 5.5s. (similar comment - the test run also outputs a lot more PASSes - which is a little noisier, but not necessarily fatal)
  • There's a slightly byzantine directory structure created by gb, by creating many _obj directories, which are left behind even after a gb -c or gb -N. I might just be fussy, but I find them rather distracting.
  • I don't see an obvious way to re-introduce benchmarking (previously make bench).

huin avatar Jun 25 '11 12:06 huin

I've been merging other stuff into master, and playing a bit with the changes from your pull request. To avoid duplicating effort, I've put this work into the branch jnwhiteh_build in my repo.

huin avatar Jun 25 '11 16:06 huin

Ah, another disadvantage I've noticed, with regards to my workflow at least... The old build system built from the project root, which meant that all error messages displayed paths to the files relative to that, which made things very handy to build from Vim, which would then just take me to the lines with the error. As a visual example of how this difference looks:

before: src/chunkymonkey/chunkstore/beta_test.go:30: ...

after: beta_test.go:30: ...

huin avatar Jun 25 '11 16:06 huin

The restructuring in commit 236c6a4e284698e956ca makes quite a bit of headway to resolve this issue, as the repository now works with 'gb' as well. Our eventual hope is to create a set of robust makefiles that allow for a reasonable workflow (and compiling) without external tools, so leaving this issue open.

jnwhiteh avatar Jun 25 '11 21:06 jnwhiteh