diff options
author | Jack Lloyd <[email protected]> | 2019-01-04 20:44:27 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-01-04 20:45:16 -0500 |
commit | 24e622312866ec58efa368ff4c24f6ad006a8899 (patch) | |
tree | 49e98a46adc22e07aed80d4e6d87bacf8de5d7dc | |
parent | a95c67a5a1fd8c9afd9cb69770cb1542f558f163 (diff) |
Use sccache for MSVC builds
-rw-r--r-- | src/build-data/cc/msvc.txt | 6 | ||||
-rw-r--r-- | src/scripts/ci/appveyor.yml | 19 | ||||
-rw-r--r-- | src/scripts/ci/setup_appveyor.bat | 4 | ||||
-rwxr-xr-x | src/scripts/ci_build.py | 39 |
4 files changed, 36 insertions, 32 deletions
diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt index 7cebb5036..445050a3d 100644 --- a/src/build-data/cc/msvc.txt +++ b/src/build-data/cc/msvc.txt @@ -33,6 +33,12 @@ ar_command lib ar_options "/nologo" ar_output_to "/OUT:" +<sanitizers> +default -> iterator + +iterator -> "/D_ITERATOR_DEBUG_LEVEL=1" +</sanitizers> + <isa_flags> sse2 -> "" ssse3 -> "" diff --git a/src/scripts/ci/appveyor.yml b/src/scripts/ci/appveyor.yml index 6512e017a..3988522ca 100644 --- a/src/scripts/ci/appveyor.yml +++ b/src/scripts/ci/appveyor.yml @@ -3,6 +3,10 @@ clone_depth: 5 environment: + SCCACHE_DIR: C:\Users\appveyor\AppData\Local\Mozilla\sccache\cache + SCCACHE_CACHE_SIZE: 128M + APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9 + matrix: # MSVC 2015 DLL x86-32 @@ -35,26 +39,23 @@ environment: TARGET: static APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - # MSVC 2017 x86-64 w/debug iterators - - MSVS: 2017 - PLATFORM: x86_amd64 - TARGET: sanitizer - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - - # MSVC 2019 static x86-64 + # MSVC 2019 x86-64 w/debug iterators - MSVS: 2019 PLATFORM: x86_amd64 - TARGET: static + TARGET: sanitizer APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview install: - call src\scripts\ci\setup_appveyor.bat build_script: - - python src\scripts\ci_build.py --os=windows --cc=msvc --without-python3 --make-tool=jom --cpu=%PLATFORM% %TARGET% + - python src\scripts\ci_build.py --os=windows --cc=msvc --without-python3 --compiler-cache=sccache --make-tool=jom --cpu=%PLATFORM% %TARGET% # whitelist branches to avoid testing feature branches twice (as branch and as pull request) branches: only: - master - release-2 + +cache: + - C:\Users\appveyor\AppData\Local\Mozilla\sccache\cache diff --git a/src/scripts/ci/setup_appveyor.bat b/src/scripts/ci/setup_appveyor.bat index a7259dd8c..0c5112b82 100644 --- a/src/scripts/ci/setup_appveyor.bat +++ b/src/scripts/ci/setup_appveyor.bat @@ -8,4 +8,6 @@ if %MSVS% == 2019 call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview rem check compiler version cl -set PATH=C:\Qt\Tools\QtCreator\bin;%PATH% +git clone --depth 1 https://github.com/randombit/botan-ci-tools + +set PATH=C:\Qt\Tools\QtCreator\bin;%PATH%;botan-ci-tools diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py index 1244d4b47..c95c9eb56 100755 --- a/src/scripts/ci_build.py +++ b/src/scripts/ci_build.py @@ -72,10 +72,8 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro if target in ['mini-static', 'mini-shared']: flags += ['--minimized-build', '--enable-modules=system_rng,sha2_32,sha2_64,aes'] - if target == 'shared' and target_os != 'osx': - # Enabling amalgamation build for shared is somewhat arbitrary, but we want to test it - # somewhere. In addition the majority of the Windows builds are shared, and MSVC is - # much faster compiling via the amalgamation than individual files. + if target == 'static': + # Arbitrarily test amalgamation with the static lib builds flags += ['--amalgamation'] if target_cc == 'msvc': @@ -107,13 +105,7 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro if target in ['fuzzers', 'coverage']: flags += ['--build-fuzzers=test'] if target in ['fuzzers', 'sanitizer']: - - # On VC iterator debugging comes from generic debug mode - if target_cc == 'msvc': - flags += ['--with-debug-info'] - else: - flags += ['--with-sanitizers'] - flags += ['--with-debug-asserts'] + flags += ['--with-sanitizers', '--with-debug-asserts'] if target in ['valgrind', 'sanitizer', 'fuzzers']: flags += ['--disable-modules=locking_allocator'] @@ -302,10 +294,10 @@ def parse_args(args): parser.add_option('--build-jobs', metavar='J', default=get_concurrency(), help='Set number of jobs to run in parallel (default %default)') - parser.add_option('--compiler-cache', default=None, - help='Set a compiler cache to use (ccache, clcache)') + parser.add_option('--compiler-cache', default=None, metavar='CC', + help='Set a compiler cache to use (ccache, sccache, clcache)') - parser.add_option('--pkcs11-lib', default=None, + parser.add_option('--pkcs11-lib', default=None, metavar='LIB', help='Set PKCS11 lib to use for testing') parser.add_option('--with-python3', dest='use_python3', action='store_true', default=None, @@ -450,10 +442,15 @@ def main(args=None): if target == 'docs': cmds.append(make_cmd + ['docs']) else: - if options.compiler_cache == 'ccache': - cmds.append(['ccache', '--show-stats']) - elif options.compiler_cache == 'clcache': - cmds.append(['clcache', '-s']) + + ccache_show_stats = { + 'ccache': '--show-stats', + 'sccache': '--show-stats', + 'clcache': '-s' + } + + if options.compiler_cache in ccache_show_stats: + cmds.append([options.compiler_cache, ccache_show_stats[options.compiler_cache]]) make_targets = ['libs', 'cli', 'tests'] if target in ['coverage', 'fuzzers']: @@ -461,10 +458,8 @@ def main(args=None): cmds.append(make_prefix + make_cmd + make_targets) - if options.compiler_cache == 'ccache': - cmds.append(['ccache', '--show-stats']) - elif options.compiler_cache == 'clcache': - cmds.append(['clcache', '-s']) + if options.compiler_cache in ccache_show_stats: + cmds.append([options.compiler_cache, ccache_show_stats[options.compiler_cache]]) if run_test_command is not None: cmds.append(run_test_command) |