summaryrefslogtreecommitdiff
path: root/scripts/gen_travis.py
diff options
context:
space:
mode:
authorDanny Lin <danny@kdrag0n.dev>2021-10-11 20:49:26 -0700
committeralk3pInjection <5e147612@kscope.ink>2022-05-08 12:40:50 +0800
commite36e52fb6ec54bc47e17e849ca5a3a301eaa6d05 (patch)
tree854d309be91bcdd38fe46ea8ad0f906bef39d017 /scripts/gen_travis.py
parent6d4d27fd2651ed114386b89c2d251b816a849460 (diff)
parentea6b3e973b477b8061e0076bb257dbd7f3faa756 (diff)
Merge tag '5.2.1' into HEAD
Release Change-Id: I269b861cb81499b78f13dc2e88827f13ef5a207d
Diffstat (limited to 'scripts/gen_travis.py')
-rwxr-xr-xscripts/gen_travis.py90
1 files changed, 66 insertions, 24 deletions
diff --git a/scripts/gen_travis.py b/scripts/gen_travis.py
index 6dd39290..f1478c62 100755
--- a/scripts/gen_travis.py
+++ b/scripts/gen_travis.py
@@ -4,6 +4,7 @@ from itertools import combinations
travis_template = """\
language: generic
+dist: precise
matrix:
include:
@@ -11,6 +12,7 @@ matrix:
before_script:
- autoconf
+ - scripts/gen_travis.py > travis_script && diff .travis.yml travis_script
- ./configure ${COMPILER_FLAGS:+ \
CC="$CC $COMPILER_FLAGS" \
CXX="$CXX $COMPILER_FLAGS" } \
@@ -43,6 +45,8 @@ configure_flag_unusuals = [
'--enable-debug',
'--enable-prof',
'--disable-stats',
+ '--disable-libdl',
+ '--enable-opt-safety-checks',
]
malloc_conf_unusuals = [
@@ -61,47 +65,85 @@ unusual_combinations_to_test = []
for i in xrange(MAX_UNUSUAL_OPTIONS + 1):
unusual_combinations_to_test += combinations(all_unusuals, i)
-include_rows = ""
-for unusual_combination in unusual_combinations_to_test:
- os = os_default
- if os_unusual in unusual_combination:
- os = os_unusual
-
- compilers = compilers_default
- if compilers_unusual in unusual_combination:
- compilers = compilers_unusual
+gcc_multilib_set = False
+# Formats a job from a combination of flags
+def format_job(combination):
+ global gcc_multilib_set
- compiler_flags = [
- x for x in unusual_combination if x in compiler_flag_unusuals]
+ os = os_unusual if os_unusual in combination else os_default
+ compilers = compilers_unusual if compilers_unusual in combination else compilers_default
- configure_flags = [
- x for x in unusual_combination if x in configure_flag_unusuals]
+ compiler_flags = [x for x in combination if x in compiler_flag_unusuals]
+ configure_flags = [x for x in combination if x in configure_flag_unusuals]
+ malloc_conf = [x for x in combination if x in malloc_conf_unusuals]
- malloc_conf = [
- x for x in unusual_combination if x in malloc_conf_unusuals]
# Filter out unsupported configurations on OS X.
if os == 'osx' and ('dss:primary' in malloc_conf or \
'percpu_arena:percpu' in malloc_conf or 'background_thread:true' \
in malloc_conf):
- continue
+ return ""
if len(malloc_conf) > 0:
configure_flags.append('--with-malloc-conf=' + ",".join(malloc_conf))
# Filter out an unsupported configuration - heap profiling on OS X.
if os == 'osx' and '--enable-prof' in configure_flags:
- continue
+ return ""
# We get some spurious errors when -Warray-bounds is enabled.
env_string = ('{} COMPILER_FLAGS="{}" CONFIGURE_FLAGS="{}" '
'EXTRA_CFLAGS="-Werror -Wno-array-bounds"').format(
compilers, " ".join(compiler_flags), " ".join(configure_flags))
- include_rows += ' - os: %s\n' % os
- include_rows += ' env: %s\n' % env_string
- if '-m32' in unusual_combination and os == 'linux':
- include_rows += ' addons:\n'
- include_rows += ' apt:\n'
- include_rows += ' packages:\n'
- include_rows += ' - gcc-multilib\n'
+ job = ""
+ job += ' - os: %s\n' % os
+ job += ' env: %s\n' % env_string
+ if '-m32' in combination and os == 'linux':
+ job += ' addons:'
+ if gcc_multilib_set:
+ job += ' *gcc_multilib\n'
+ else:
+ job += ' &gcc_multilib\n'
+ job += ' apt:\n'
+ job += ' packages:\n'
+ job += ' - gcc-multilib\n'
+ gcc_multilib_set = True
+ return job
+
+include_rows = ""
+for combination in unusual_combinations_to_test:
+ include_rows += format_job(combination)
+
+# Development build
+include_rows += '''\
+ # Development build
+ - os: linux
+ env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --disable-cache-oblivious --enable-stats --enable-log --enable-prof" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
+'''
+
+# Enable-expermental-smallocx
+include_rows += '''\
+ # --enable-expermental-smallocx:
+ - os: linux
+ env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --enable-experimental-smallocx --enable-stats --enable-prof" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
+'''
+
+# Valgrind build bots
+include_rows += '''
+ # Valgrind
+ - os: linux
+ env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="" EXTRA_CFLAGS="-Werror -Wno-array-bounds" JEMALLOC_TEST_PREFIX="valgrind"
+ addons:
+ apt:
+ packages:
+ - valgrind
+'''
+
+# To enable valgrind on macosx add:
+#
+# - os: osx
+# env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="" EXTRA_CFLAGS="-Werror -Wno-array-bounds" JEMALLOC_TEST_PREFIX="valgrind"
+# install: brew install valgrind
+#
+# It currently fails due to: https://github.com/jemalloc/jemalloc/issues/1274
print travis_template % include_rows