2020-07-28 21:00:35 +00:00
|
|
|
# Copyright 2019 Ilya Shipitsin <chipitsine@gmail.com>
|
|
|
|
# Copyright 2020 Tim Duesterhus <tim@bastelstu.be>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version
|
|
|
|
# 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
import json
|
2020-11-19 23:16:00 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
if len(sys.argv) == 2:
|
|
|
|
build_type = sys.argv[1]
|
|
|
|
else:
|
|
|
|
print("Usage: {} <build_type>".format(sys.argv[0]), file=sys.stderr)
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
print("Generating matrix for type '{}'.".format(build_type))
|
2020-07-28 21:00:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
def clean_os(os):
|
|
|
|
if os == "ubuntu-latest":
|
|
|
|
return "Ubuntu"
|
|
|
|
elif os == "macos-latest":
|
|
|
|
return "macOS"
|
|
|
|
return os.replace("-latest", "")
|
|
|
|
|
|
|
|
|
|
|
|
def clean_ssl(ssl):
|
|
|
|
return ssl.replace("_VERSION", "").lower()
|
|
|
|
|
|
|
|
|
|
|
|
def clean_compression(compression):
|
|
|
|
return compression.replace("USE_", "").lower()
|
|
|
|
|
|
|
|
|
|
|
|
def get_asan_flags(cc):
|
|
|
|
if cc == "clang":
|
|
|
|
return [
|
|
|
|
"USE_OBSOLETE_LINKER=1",
|
|
|
|
'DEBUG_CFLAGS="-g -fsanitize=address"',
|
|
|
|
'LDFLAGS="-fsanitize=address"',
|
|
|
|
'CPU_CFLAGS.generic="-O1"',
|
|
|
|
]
|
|
|
|
|
|
|
|
raise ValueError("ASAN is only supported for clang")
|
|
|
|
|
|
|
|
|
|
|
|
matrix = []
|
|
|
|
|
|
|
|
# Ubuntu
|
|
|
|
|
|
|
|
os = "ubuntu-latest"
|
|
|
|
TARGET = "linux-glibc"
|
|
|
|
for CC in ["gcc", "clang"]:
|
|
|
|
matrix.append(
|
|
|
|
{
|
|
|
|
"name": "{}, {}, no features".format(clean_os(os), CC),
|
|
|
|
"os": os,
|
|
|
|
"TARGET": TARGET,
|
|
|
|
"CC": CC,
|
|
|
|
"FLAGS": [],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
matrix.append(
|
|
|
|
{
|
|
|
|
"name": "{}, {}, all features".format(clean_os(os), CC),
|
|
|
|
"os": os,
|
|
|
|
"TARGET": TARGET,
|
|
|
|
"CC": CC,
|
|
|
|
"FLAGS": [
|
|
|
|
"USE_ZLIB=1",
|
2021-05-18 09:46:43 +00:00
|
|
|
"USE_OT=1",
|
|
|
|
"OT_INC=${HOME}/opt/include",
|
|
|
|
"OT_LIB=${HOME}/opt/lib",
|
|
|
|
"OT_RUNPATH=1",
|
2020-07-28 21:00:35 +00:00
|
|
|
"USE_PCRE=1",
|
|
|
|
"USE_PCRE_JIT=1",
|
|
|
|
"USE_LUA=1",
|
|
|
|
"USE_OPENSSL=1",
|
|
|
|
"USE_SYSTEMD=1",
|
|
|
|
"USE_WURFL=1",
|
2021-04-02 14:39:44 +00:00
|
|
|
"WURFL_INC=addons/wurfl/dummy",
|
|
|
|
"WURFL_LIB=addons/wurfl/dummy",
|
2020-07-28 21:00:35 +00:00
|
|
|
"USE_DEVICEATLAS=1",
|
2021-04-02 14:19:39 +00:00
|
|
|
"DEVICEATLAS_SRC=addons/deviceatlas/dummy",
|
2021-04-02 13:35:19 +00:00
|
|
|
"USE_PROMEX=1",
|
2020-11-26 15:59:42 +00:00
|
|
|
"USE_51DEGREES=1",
|
2021-04-02 14:12:32 +00:00
|
|
|
"51DEGREES_SRC=addons/51degrees/dummy/pattern",
|
2020-07-28 21:00:35 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
for compression in ["USE_SLZ=1", "USE_ZLIB=1"]:
|
|
|
|
matrix.append(
|
|
|
|
{
|
|
|
|
"name": "{}, {}, gz={}".format(
|
|
|
|
clean_os(os), CC, clean_compression(compression)
|
|
|
|
),
|
|
|
|
"os": os,
|
|
|
|
"TARGET": TARGET,
|
|
|
|
"CC": CC,
|
|
|
|
"FLAGS": [compression],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
for ssl in [
|
|
|
|
"stock",
|
|
|
|
"OPENSSL_VERSION=1.0.2u",
|
2021-06-05 03:06:59 +00:00
|
|
|
"OPENSSL_VERSION=3.0.0-alpha17",
|
2020-07-28 21:00:35 +00:00
|
|
|
"LIBRESSL_VERSION=2.9.2",
|
2021-05-05 04:01:03 +00:00
|
|
|
"LIBRESSL_VERSION=3.3.3",
|
2020-11-20 09:43:23 +00:00
|
|
|
"BORINGSSL=yes",
|
2020-07-28 21:00:35 +00:00
|
|
|
]:
|
|
|
|
flags = ["USE_OPENSSL=1"]
|
2021-05-09 16:27:28 +00:00
|
|
|
if ssl == "BORINGSSL=yes":
|
|
|
|
flags.append("USE_QUIC=1")
|
2021-06-07 13:27:57 +00:00
|
|
|
if ssl == "OPENSSL_VERSION=3.0.0-alpha17":
|
|
|
|
flags.append('DEBUG_CFLAGS="-g -Wno-deprecated-declarations"')
|
2020-07-28 21:00:35 +00:00
|
|
|
if ssl != "stock":
|
|
|
|
flags.append("SSL_LIB=${HOME}/opt/lib")
|
|
|
|
flags.append("SSL_INC=${HOME}/opt/include")
|
|
|
|
matrix.append(
|
|
|
|
{
|
|
|
|
"name": "{}, {}, ssl={}".format(clean_os(os), CC, clean_ssl(ssl)),
|
|
|
|
"os": os,
|
|
|
|
"TARGET": TARGET,
|
|
|
|
"CC": CC,
|
|
|
|
"ssl": ssl,
|
|
|
|
"FLAGS": flags,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# ASAN
|
|
|
|
|
|
|
|
os = "ubuntu-latest"
|
|
|
|
CC = "clang"
|
|
|
|
TARGET = "linux-glibc"
|
|
|
|
matrix.append(
|
|
|
|
{
|
|
|
|
"name": "{}, {}, ASAN, all features".format(clean_os(os), CC),
|
|
|
|
"os": os,
|
|
|
|
"TARGET": TARGET,
|
|
|
|
"CC": CC,
|
|
|
|
"FLAGS": get_asan_flags(CC)
|
|
|
|
+ [
|
|
|
|
"USE_ZLIB=1",
|
2021-05-18 09:46:43 +00:00
|
|
|
"USE_OT=1",
|
|
|
|
"OT_INC=${HOME}/opt/include",
|
|
|
|
"OT_LIB=${HOME}/opt/lib",
|
|
|
|
"OT_RUNPATH=1",
|
2020-07-28 21:00:35 +00:00
|
|
|
"USE_PCRE=1",
|
|
|
|
"USE_PCRE_JIT=1",
|
|
|
|
"USE_LUA=1",
|
|
|
|
"USE_OPENSSL=1",
|
|
|
|
"USE_SYSTEMD=1",
|
|
|
|
"USE_WURFL=1",
|
2021-04-02 14:39:44 +00:00
|
|
|
"WURFL_INC=addons/wurfl/dummy",
|
|
|
|
"WURFL_LIB=addons/wurfl/dummy",
|
2020-07-28 21:00:35 +00:00
|
|
|
"USE_DEVICEATLAS=1",
|
2021-04-02 14:19:39 +00:00
|
|
|
"DEVICEATLAS_SRC=addons/deviceatlas/dummy",
|
2021-04-02 13:35:19 +00:00
|
|
|
"USE_PROMEX=1",
|
2020-11-26 15:59:42 +00:00
|
|
|
"USE_51DEGREES=1",
|
2021-04-02 14:12:32 +00:00
|
|
|
"51DEGREES_SRC=addons/51degrees/dummy/pattern",
|
2020-07-28 21:00:35 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# macOS
|
|
|
|
|
|
|
|
os = "macos-latest"
|
|
|
|
TARGET = "osx"
|
|
|
|
for CC in ["clang"]:
|
|
|
|
matrix.append(
|
|
|
|
{
|
|
|
|
"name": "{}, {}, no features".format(clean_os(os), CC),
|
|
|
|
"os": os,
|
|
|
|
"TARGET": TARGET,
|
|
|
|
"CC": CC,
|
|
|
|
"FLAGS": [],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Print matrix
|
|
|
|
|
|
|
|
print(json.dumps(matrix, indent=4, sort_keys=True))
|
|
|
|
|
|
|
|
print("::set-output name=matrix::{}".format(json.dumps({"include": matrix})))
|