User Tools

Site Tools


juju-windows

This is an old revision of the document!


Building Juju on windows

For convenience, I will assume that the first thing you do is:

start powershell
  • Download necessary dependencies:
(new-object System.Net.WebClient).DownloadFile("http://go.googlecode.com/files/go1.2.1.windows-amd64.msi", "$HOME\go1.2.1.windows-amd64.msi")
(new-object System.Net.WebClient).DownloadFile("http://bitbucket.org/tortoisehg/files/downloads/tortoisehg-2.11.2-hg-2.9.2-x64.msi", "$HOME\tortoisehg-2.11.2-hg-2.9.2-x64.msi")
(new-object System.Net.WebClient).DownloadFile("https://msysgit.googlecode.com/files/Git-1.9.0-preview20140217.exe", "$HOME\Git-1.9.0-preview20140217.exe")
(new-object System.Net.WebClient).DownloadFile("https://launchpad.net/bzr/2.5/2.5.1/+download/bzr-2.5.1-1-setup.exe", "$HOME\bzr-2.5.1-1-setup.exe")
  • Install dependencies
msiexec /i $HOME\go1.2.1.windows-amd64.msi /quiet
msiexec /i $HOME\tortoisehg-2.11.2-hg-2.9.2-x64.msi /quiet
$HOME\bzr-2.5.1-1-setup.exe /SILENT
$HOME\Git-1.9.0-preview20140217.exe /SILENT
  • Add Apropriate environment variables
setx PATH "$env:PATH;${env:ProgramFiles(x86)}\Git\cmd;${env:ProgramFiles(x86)}\Bazaar;${env:ProgramFiles}\TortoiseHg"
setx GOPATH "$HOME\golang"
  • set variables for current session as well:
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Git\cmd;${env:ProgramFiles(x86)}\Bazaar;${env:ProgramFiles}\TortoiseHg"
$env:GOPATH = "$HOME\golang"
mkdir $env:GOPATH
  • Get juju-core and its dependencies
go get launchpad.net/juju-core/...
  • Get our patched version from git. This contains the windows support:
rm -Recurse -Force $env:GOPATH\src\launchpad.net\juju-core
git clone git@github.com:cloudbase/juju-core.git $env:GOPATH\src\launchpad.net\juju-core
cd $env:GOPATH\src\launchpad.net\juju-core && git checkout rebase-1.19
  • Because of the way Go works, you will always get the latest revisions of dependencies. This might sometimes break the build of juju. The checkout from 19 April needs the following hack:
cd $env:GOPATH\src\code.google.com\p\go.crypto\ssh
hg update -r 191:2990fc550b9f # hack for this particular checkout of juju
  • Build juju-core on windows
go install -v launchpad.net/juju-core/...
  • Binaries can be found in $env:GOPATH\bin

:!: IMPORTANT NOTE :!: DRAGONS AHEAD :!:

If you ever get a bunch of errors like the following:

conflicting definitions for @

Simply remove $env:GOPATH\pkg\windows_amd64 and try again.

juju-windows.1398195837.txt.gz · Last modified: 2014/04/22 22:43 (external edit)