Rebuilding Juju Binaries from Source

UPDATE: 2015-01-13 – A few corrections after Juju source code has migrated to GitHub.

If you are using the current development version of Juju and making changes to try things out, you should rebuild the binaries before attempting to call juju bootstrap –upload-tools again. Otherwise, you’ll end up using some preexisting, quite possibly old binaries found in `$PATH`.

I use this handy little script to rebuild them:

pushd $GOPATH/src/   # Change this if needed
cd cmd/juju && go install . && cd ../jujud && go install .
ls -la `which juju`
ls -la `which jujud`

You might need to change line 2 if your juju source is elsewhere,  if `$GOPATH` is not set , or if it contains more than one path – e.g. mine is in `~/work/juju-core`.

I called this script `rebuild-juju` and saved if somewhere listed in `$PATH`, so I can run it from anywhere. It has the nice feature of restoring back your current directory when done and lists the built binaries, so you can see the modification timestamps.


2 Comments on “Rebuilding Juju Binaries from Source

  1. Apart from the `ls`, this could be:

    `go install{d,}`

    or just:

    `go install…`

    Both of these have the advantage that you don’t
    need to change the script if you use a different `GOPATH`.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.