diff --git a/SConstruct b/SConstruct index 8778a53cc..1f32cb96f 100644 --- a/SConstruct +++ b/SConstruct @@ -589,7 +589,7 @@ for toolchain in all_toolchains: object_builder.add_source_files( 'beastc.c', - CCFLAGS=['-Wno-array-bounds']) + CCFLAGS = ([] if toolchain == 'msvc' else ['-Wno-array-bounds'])) object_builder.add_source_files( 'nodestore.cpp', @@ -639,7 +639,7 @@ for toolchain in all_toolchains: object_builder.add_source_files( 'snappy.cpp', - CCFLAGS=['-Wno-unused-function'], + CCFLAGS=([] if toolchain == 'msvc' else ['-Wno-unused-function']), CPPPATH=[ 'src/snappy/snappy', 'src/snappy/config', diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..744f2052a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,77 @@ +# Set environment variables. +environment: + PYTHON: C:/Python27-x64 + + # We bundle up protoc.exe and only the parts of boost and openssl we need so + # that it's a small download. We also use appveyor's free cache, avoiding fees + # downloading from S3 each time. + # TODO: script to create this package. + RIPPLED_DEPS_URL: https://s3-ap-northeast-1.amazonaws.com/history-replay/rippled_deps.zip + + # Other dependencies we just download each time. + PIP_URL: https://bootstrap.pypa.io/get-pip.py + PYWIN32_URL: https://downloads.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe + + # Scons honours these environment variables, setting the include/lib paths. + BOOST_ROOT: C:/rippled_deps/boost + OPENSSL_ROOT: C:/rippled_deps/openssl + +# At the end of each successful build we cache this directory. It must be less +# than 100MB total compressed. +cache: + - 'C:\\rippled_deps' + +# This means we'll download a zip of the branch we want, rather than the full +# history. +shallow_clone: true + +install: + # We want easy_install, python and protoc.exe on PATH. + - SET PATH=%PYTHON%;%PYTHON%/Scripts;C:/rippled_deps;%PATH% + + # `ps` prefix means the command is executed by powershell. + - ps: Start-FileDownload $env:PIP_URL + - ps: Start-FileDownload $env:PYWIN32_URL + + # Installing pip will install setuptools/easy_install. + - python get-pip.py + + # Pip has some problems installing scons on windows so we use easy install. + - easy_install scons + + # Scons has problems with parallel builds on windows without pywin32. + - easy_install pywin32-219.win-amd64-py2.7.exe + # (easy_install can do headless installs of .exe wizards) + + # Download dependencies if appveyor didn't restore them from the cache. + # Use 7zip to unzip. + - ps: | + if (-not(Test-Path 'C:/rippled_deps')) { + Start-FileDownload "$env:RIPPLED_DEPS_URL" + 7z x rippled_deps.zip -oC:\ -y > $null + } + +# TODO: This is giving me grief +# artifacts: +# # Save rippled.exe in the cloud after each build. +# - path: "build\\rippled.exe" + +build_script: + # We set the environment variables needed to put compilers on the PATH. + - '"%VS120COMNTOOLS%../../VC/vcvarsall.bat" x86_amd64' + # Show which version of the compiler we are using. + - cl + - scons msvc.debug -j%NUMBER_OF_PROCESSORS% + +after_build: + # Put our executable in a place where npm test can find it. + - ps: cp build/msvc.debug/rippled.exe build + - ps: ls build + +test_script: + # Run the unit tests + - build\\rippled --unittest + + # Run the integration tests + - npm install + - npm test