Repository navigation
build stembuild
Note: you can only build on your host OS. You cannot cross compile.
Stembuild applies a binary diff to a source vhd and creates a stemcell. The binary diff creation is dependent upon rdiff (located in librsync). rdiff is dependent upon (POP3) which is not supported in windows. In order to get around this, a shim has been written in go that is not dependent upon POP3.
-
ovftoolhttps://my.vmware.com/web/vmware/details?downloadGroup=OVFTOOL400&productId=353- Update the system path to include
ovftool
- Update the system path to include
-
librsynchttps://github.com/charlievieth/librsync -
golanghttps://golang.org/dl/ -
stembuildhttps://github.com/pivotal-cf-experimental/stembuild (Usegit clone)
-
cmakehttps://cmake.org/ -
MinGWhttps://sourceforge.net/projects/mingw-w64/- Select
x86_64as the Architecture - Do not use the default root directory (Program Files); use something without spaces (this will save you a lifetime of pain if you decide to compile something that uses
Makefiles) for exampleC:\mingw\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1 - Add
gccand friends to the path (for the above install location you would addC:\mingw\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\binto the system path) before the strawberrygccpath.
- Select
-
githttps://git-scm.com/download/win- USE THE DEFAULTS (WITH ONE EXCEPTION)
- install to
C:\Gitor any other path without spaces
- install to
- Update the system path with the git.
- USE THE DEFAULTS (WITH ONE EXCEPTION)
-
Strawberry Perlhttp://strawberryperl.com/- Verify the additions to the system path for strawberry perl are after the MinGW bin.
CMake is used to create the necessary header files so that compilation can succeed. You should only have to generate these files once since we only care about the rdiff files.
To generate the correct files:
- check out the correct librsync branch
- (Linux and Darwin) mingw64-fseeko64-v2.0.0
- (Windows) mingw64-fseeko64-v2.0.0-windows
- open CMake
- set source folder to librsync
- set destination folder to librsync/build
- set CMAKE_INSTALL_PREFIX=librsync/install
- set CMAKE_BUILD_TYPE=release
- click configure
- select MinGW Makefiles as the generator for the project (for Windows)
- click generate (this generates the .h files)
- after generating the Makefile you can CD into the build directory and run mingw32-make and mingw32-make test to make sure things are working (also, the tests will not pass - so don't sweat it)
- copy all source and header files from
librsync/srcintostembuild/rdiff/ - copy all source and header files from
librsync/build/srcintostembuild/rdiff/ - remove
rdiff/rdiff.c(this is because we have rewritten this in gordiff.go) -
go installputs the stembuild executable into$GOPATH/bin
Other environments are similar. Be certain to use the correct librsync branch depending on the OS you are targeting
- Note: The windows branch does attempt to build the rdiff executable and does not require the BZIP2 and ZLIB libraries*
librsync: ERROR: (rs_file_copy_cb) seek failed: Invalid argument
renaming stemcell to bosh-stemcell-1200.9.4-build.7-vsphere-esxi-windows2012R2-go_agent.tgz
librsync: ERROR: (rs_job_complete) patch job failed: IO error
Error: RS_IO_ERROR: IO error
This is because you did not use the correct branch when compiling. Use the Windows branch for Windows, and the default branch for the others.