-
Notifications
You must be signed in to change notification settings - Fork 11
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.
-
ovftool
https://my.vmware.com/web/vmware/details?downloadGroup=OVFTOOL400&productId=353 on your path -
librsync
https://github.com/charlievieth/librsync -
cmake
https://cmake.org/ -
MinGW
https://sourceforge.net/projects/mingw-w64/ - Ensure the installation architecture is x86_64 and it is saved in a custom installation directory with no spaces in the path. Also, add the bin directory to the system path. -
git
https://git-scm.com/download/win - Ensure git is installed in a custom installation directory with no spaces in the path. Update the system path with the git. -
Strawberry Perl
http://strawberryperl.com/ - Verify the additions to the system path for strawberry perl are after the MinGW bin. -
stembuild
go get github.com/pivotal-cf-experimental/stembuild
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 in linux:
- 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.
- click generate (this generates the .h files)
- copy all source and header files from
librsync/src
intostembuild/rdiff/
- copy all source and header files from
librsync/build/src
intostembuild/rdiff/
- remove rdiff/rdiff.c (this is because we have rewritten this in go
rdiff.go
)
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.