Skip to content

build stembuild

Mark DeLillo edited this page Jan 5, 2018 · 32 revisions

Build Instructions

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.

Requirements

Cmake

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:

  1. check out the correct librsync branch
    • (Linux and Darwin) mingw64-fseeko64-v2.0.0
    • (Windows) mingw64-fseeko64-v2.0.0-windows
  2. open cmake
  3. set source folder to librsync
  4. set destination folder to librsync/build
  5. set CMAKE_INSTALL_PREFIX=librsync/install
  6. set CMAKE_BUILD_TYPE=release
  7. click configure
  8. select MinGW Makefiles as the generator for the project.
  9. click generate (this generates the .h files)
  10. copy all source and header files from librsync/src into stembuild/rdiff/
  11. copy all source and header files from librsync/build/src into stembuild/rdiff/
  12. 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*

Troubleshooting

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.

Clone this wiki locally