Skip to content

Commit 476bbac

Browse files
Merge branch 'master' into fix-memory-issues
2 parents 13fd3e4 + 0dc8d8d commit 476bbac

File tree

848 files changed

+137116
-57235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

848 files changed

+137116
-57235
lines changed

.cirrus.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
FreeBSD_task:
22
freebsd_instance:
33
matrix:
4-
image_family: freebsd-13-2
4+
image_family: freebsd-14-2
55
only_if: $CIRRUS_BRANCH =~ 'master|next'
66
install_script:
7-
- pkg update -f && pkg upgrade -y && pkg install -y openssl git gmake lua53 socat pcre
7+
- pkg update -f && pkg upgrade -y && pkg install -y openssl git gmake lua54 socat pcre2
88
script:
99
- sudo sysctl kern.corefile=/tmp/%N.%P.core
1010
- sudo sysctl kern.sugid_coredump=1
1111
- scripts/build-vtest.sh
12-
- gmake CC=clang V=1 ERR=1 TARGET=freebsd USE_ZLIB=1 USE_PCRE=1 USE_OPENSSL=1 USE_LUA=1 LUA_INC=/usr/local/include/lua53 LUA_LIB=/usr/local/lib LUA_LIB_NAME=lua-5.3
12+
- gmake CC=clang V=1 ERR=1 TARGET=freebsd USE_ZLIB=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_OPENSSL=1 USE_LUA=1 LUA_INC=/usr/local/include/lua54 LUA_LIB=/usr/local/lib LUA_LIB_NAME=lua-5.4
1313
- ./haproxy -vv
1414
- ldd haproxy
1515
test_script:

.github/h2spec.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ defaults
2020
frontend h2
2121
mode http
2222
bind 127.0.0.1:8443 ssl crt reg-tests/ssl/common.pem alpn h2,http/1.1
23-
default_backend h2
23+
default_backend h2b
2424

25-
backend h2
25+
backend h2b
2626
errorfile 200 .github/errorfile
2727
http-request deny deny_status 200

.github/matrix.py

Lines changed: 92 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import sys
1515
import urllib.request
1616
from os import environ
17+
from packaging import version
1718

1819
#
1920
# this CI is used for both development and stable branches of HAProxy
@@ -47,7 +48,7 @@ def determine_latest_openssl(ssl):
4748
latest_tag = ""
4849
for tag in tags:
4950
if "openssl-" in tag:
50-
if tag > latest_tag:
51+
if (not latest_tag) or (version.parse(tag[8:]) > version.parse(latest_tag[8:])):
5152
latest_tag = tag
5253
return "OPENSSL_VERSION={}".format(latest_tag[8:])
5354

@@ -66,6 +67,37 @@ def determine_latest_aws_lc(ssl):
6667
latest_tag = max(valid_tags, key=aws_lc_version_string_to_num)
6768
return "AWS_LC_VERSION={}".format(latest_tag[1:])
6869

70+
def aws_lc_fips_version_string_to_num(version_string):
71+
return tuple(map(int, version_string[12:].split('.')))
72+
73+
def aws_lc_fips_version_valid(version_string):
74+
return re.match('^AWS-LC-FIPS-[0-9]+(\.[0-9]+)*$', version_string)
75+
76+
@functools.lru_cache(5)
77+
def determine_latest_aws_lc_fips(ssl):
78+
# the AWS-LC-FIPS tags are at the end of the list, so let's get a lot
79+
tags = get_all_github_tags("https://api.github.com/repos/aws/aws-lc/tags?per_page=200")
80+
if not tags:
81+
return "AWS_LC_FIPS_VERSION=failed_to_detect"
82+
valid_tags = list(filter(aws_lc_fips_version_valid, tags))
83+
latest_tag = max(valid_tags, key=aws_lc_fips_version_string_to_num)
84+
return "AWS_LC_FIPS_VERSION={}".format(latest_tag[12:])
85+
86+
def wolfssl_version_string_to_num(version_string):
87+
return tuple(map(int, version_string[1:].removesuffix('-stable').split('.')))
88+
89+
def wolfssl_version_valid(version_string):
90+
return re.match('^v[0-9]+(\.[0-9]+)*-stable$', version_string)
91+
92+
@functools.lru_cache(5)
93+
def determine_latest_wolfssl(ssl):
94+
tags = get_all_github_tags("https://api.github.com/repos/wolfssl/wolfssl/tags")
95+
if not tags:
96+
return "WOLFSSL_VERSION=failed_to_detect"
97+
valid_tags = list(filter(wolfssl_version_valid, tags))
98+
latest_tag = max(valid_tags, key=wolfssl_version_string_to_num)
99+
return "WOLFSSL_VERSION={}".format(latest_tag[1:].removesuffix('-stable'))
100+
69101
@functools.lru_cache(5)
70102
def determine_latest_libressl(ssl):
71103
try:
@@ -85,14 +117,6 @@ def clean_compression(compression):
85117
return compression.replace("USE_", "").lower()
86118

87119

88-
def get_asan_flags(cc):
89-
return [
90-
"USE_OBSOLETE_LINKER=1",
91-
'DEBUG_CFLAGS="-g -fsanitize=address"',
92-
'LDFLAGS="-fsanitize=address"',
93-
'CPU_CFLAGS.generic="-O1"',
94-
]
95-
96120
def main(ref_name):
97121
print("Generating matrix for branch '{}'.".format(ref_name))
98122

@@ -101,9 +125,11 @@ def main(ref_name):
101125
# Ubuntu
102126

103127
if "haproxy-" in ref_name:
104-
os = "ubuntu-22.04" # stable branch
128+
os = "ubuntu-24.04" # stable branch
129+
os_arm = "ubuntu-24.04-arm" # stable branch
105130
else:
106-
os = "ubuntu-latest" # development branch
131+
os = "ubuntu-24.04" # development branch
132+
os_arm = "ubuntu-24.04-arm" # development branch
107133

108134
TARGET = "linux-glibc"
109135
for CC in ["gcc", "clang"]:
@@ -124,16 +150,16 @@ def main(ref_name):
124150
"TARGET": TARGET,
125151
"CC": CC,
126152
"FLAGS": [
153+
'DEBUG="-DDEBUG_LIST"',
127154
"USE_ZLIB=1",
128155
"USE_OT=1",
129156
"OT_INC=${HOME}/opt-ot/include",
130157
"OT_LIB=${HOME}/opt-ot/lib",
131158
"OT_RUNPATH=1",
132-
"USE_PCRE=1",
133-
"USE_PCRE_JIT=1",
159+
"USE_PCRE2=1",
160+
"USE_PCRE2_JIT=1",
134161
"USE_LUA=1",
135162
"USE_OPENSSL=1",
136-
"USE_SYSTEMD=1",
137163
"USE_WURFL=1",
138164
"WURFL_INC=addons/wurfl/dummy",
139165
"WURFL_LIB=addons/wurfl/dummy",
@@ -148,35 +174,37 @@ def main(ref_name):
148174

149175
# ASAN
150176

151-
matrix.append(
152-
{
153-
"name": "{}, {}, ASAN, all features".format(os, CC),
154-
"os": os,
155-
"TARGET": TARGET,
156-
"CC": CC,
157-
"FLAGS": get_asan_flags(CC)
158-
+ [
159-
"USE_ZLIB=1",
160-
"USE_OT=1",
161-
"OT_INC=${HOME}/opt-ot/include",
162-
"OT_LIB=${HOME}/opt-ot/lib",
163-
"OT_RUNPATH=1",
164-
"USE_PCRE=1",
165-
"USE_PCRE_JIT=1",
166-
"USE_LUA=1",
167-
"USE_OPENSSL=1",
168-
"USE_SYSTEMD=1",
169-
"USE_WURFL=1",
170-
"WURFL_INC=addons/wurfl/dummy",
171-
"WURFL_LIB=addons/wurfl/dummy",
172-
"USE_DEVICEATLAS=1",
173-
"DEVICEATLAS_SRC=addons/deviceatlas/dummy",
174-
"USE_PROMEX=1",
175-
"USE_51DEGREES=1",
176-
"51DEGREES_SRC=addons/51degrees/dummy/pattern",
177-
],
178-
}
179-
)
177+
for os_asan in [os, os_arm]:
178+
matrix.append(
179+
{
180+
"name": "{}, {}, ASAN, all features".format(os_asan, CC),
181+
"os": os_asan,
182+
"TARGET": TARGET,
183+
"CC": CC,
184+
"FLAGS": [
185+
"USE_OBSOLETE_LINKER=1",
186+
'ARCH_FLAGS="-g -fsanitize=address"',
187+
'OPT_CFLAGS="-O1"',
188+
"USE_ZLIB=1",
189+
"USE_OT=1",
190+
"OT_INC=${HOME}/opt-ot/include",
191+
"OT_LIB=${HOME}/opt-ot/lib",
192+
"OT_RUNPATH=1",
193+
"USE_PCRE2=1",
194+
"USE_PCRE2_JIT=1",
195+
"USE_LUA=1",
196+
"USE_OPENSSL=1",
197+
"USE_WURFL=1",
198+
"WURFL_INC=addons/wurfl/dummy",
199+
"WURFL_LIB=addons/wurfl/dummy",
200+
"USE_DEVICEATLAS=1",
201+
"DEVICEATLAS_SRC=addons/deviceatlas/dummy",
202+
"USE_PROMEX=1",
203+
"USE_51DEGREES=1",
204+
"51DEGREES_SRC=addons/51degrees/dummy/pattern",
205+
],
206+
}
207+
)
180208

181209
for compression in ["USE_ZLIB=1"]:
182210
matrix.append(
@@ -193,9 +221,10 @@ def main(ref_name):
193221
"stock",
194222
"OPENSSL_VERSION=1.0.2u",
195223
"OPENSSL_VERSION=1.1.1s",
224+
"OPENSSL_VERSION=3.5.1",
196225
"QUICTLS=yes",
197-
"WOLFSSL_VERSION=git-d83f2fa",
198-
"AWS_LC_VERSION=1.16.0",
226+
"WOLFSSL_VERSION=5.7.0",
227+
"AWS_LC_VERSION=1.39.0",
199228
# "BORINGSSL=yes",
200229
]
201230

@@ -207,8 +236,7 @@ def main(ref_name):
207236

208237
for ssl in ssl_versions:
209238
flags = ["USE_OPENSSL=1"]
210-
if ssl == "BORINGSSL=yes" or ssl == "QUICTLS=yes" or "LIBRESSL" in ssl or "WOLFSSL" in ssl or "AWS_LC" in ssl:
211-
flags.append("USE_QUIC=1")
239+
skipdup=0
212240
if "WOLFSSL" in ssl:
213241
flags.append("USE_OPENSSL_WOLFSSL=1")
214242
if "AWS_LC" in ssl:
@@ -218,8 +246,23 @@ def main(ref_name):
218246
flags.append("SSL_INC=${HOME}/opt/include")
219247
if "LIBRESSL" in ssl and "latest" in ssl:
220248
ssl = determine_latest_libressl(ssl)
249+
skipdup=1
221250
if "OPENSSL" in ssl and "latest" in ssl:
222251
ssl = determine_latest_openssl(ssl)
252+
skipdup=1
253+
254+
# if "latest" equals a version already in the list
255+
if ssl in ssl_versions and skipdup == 1:
256+
continue
257+
258+
openssl_supports_quic = False
259+
try:
260+
openssl_supports_quic = version.Version(ssl.split("OPENSSL_VERSION=",1)[1]) >= version.Version("3.5.0")
261+
except:
262+
pass
263+
264+
if ssl == "BORINGSSL=yes" or ssl == "QUICTLS=yes" or "LIBRESSL" in ssl or "WOLFSSL" in ssl or "AWS_LC" in ssl or openssl_supports_quic:
265+
flags.append("USE_QUIC=1")
223266

224267
matrix.append(
225268
{
@@ -235,9 +278,9 @@ def main(ref_name):
235278
# macOS
236279

237280
if "haproxy-" in ref_name:
238-
os = "macos-12" # stable branch
281+
os = "macos-13" # stable branch
239282
else:
240-
os = "macos-latest" # development branch
283+
os = "macos-15" # development branch
241284

242285
TARGET = "osx"
243286
for CC in ["clang"]:

.github/workflows/aws-lc-fips.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: AWS-LC-FIPS
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 4"
6+
workflow_dispatch:
7+
8+
jobs:
9+
test:
10+
uses: ./.github/workflows/aws-lc-template.yml
11+
with:
12+
command: "from matrix import determine_latest_aws_lc_fips; print(determine_latest_aws_lc_fips(''))"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: AWS-LC template
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
command:
7+
required: true
8+
type: string
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
if: ${{ github.repository_owner == 'haproxy' || github.event_name == 'workflow_dispatch' }}
17+
steps:
18+
- uses: actions/checkout@v5
19+
- name: Install VTest
20+
run: |
21+
scripts/build-vtest.sh
22+
- name: Determine latest AWS-LC release
23+
id: get_aws_lc_release
24+
run: |
25+
result=$(cd .github && python3 -c "${{ inputs.command }}")
26+
echo $result
27+
echo "result=$result" >> $GITHUB_OUTPUT
28+
- name: Cache AWS-LC
29+
id: cache_aws_lc
30+
uses: actions/cache@v4
31+
with:
32+
path: '~/opt/'
33+
key: ssl-${{ steps.get_aws_lc_release.outputs.result }}-Ubuntu-latest-gcc
34+
- name: Install apt dependencies
35+
run: |
36+
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
37+
sudo apt-get --no-install-recommends -y install socat gdb jose
38+
- name: Install AWS-LC
39+
if: ${{ steps.cache_ssl.outputs.cache-hit != 'true' }}
40+
run: env ${{ steps.get_aws_lc_release.outputs.result }} scripts/build-ssl.sh
41+
- name: Compile HAProxy
42+
run: |
43+
make -j$(nproc) ERR=1 CC=gcc TARGET=linux-glibc \
44+
USE_OPENSSL_AWSLC=1 USE_QUIC=1 \
45+
SSL_LIB=${HOME}/opt/lib SSL_INC=${HOME}/opt/include \
46+
DEBUG="-DDEBUG_POOL_INTEGRITY -DDEBUG_UNIT" \
47+
ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
48+
sudo make install
49+
- name: Show HAProxy version
50+
id: show-version
51+
run: |
52+
ldd $(which haproxy)
53+
haproxy -vv
54+
echo "version=$(haproxy -v |awk 'NR==1{print $3}')" >> $GITHUB_OUTPUT
55+
- name: Install problem matcher for VTest
56+
run: echo "::add-matcher::.github/vtest.json"
57+
- name: Run VTest for HAProxy
58+
id: vtest
59+
run: |
60+
# This is required for macOS which does not actually allow to increase
61+
# the '-n' soft limit to the hard limit, thus failing to run.
62+
ulimit -n 65536
63+
# allow to catch coredumps
64+
ulimit -c unlimited
65+
make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
66+
- name: Run Unit tests
67+
id: unittests
68+
run: |
69+
make unit-tests
70+
- name: Show VTest results
71+
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
72+
run: |
73+
for folder in ${TMPDIR:-/tmp}/haregtests-*/vtc.*; do
74+
printf "::group::"
75+
cat $folder/INFO
76+
cat $folder/LOG
77+
echo "::endgroup::"
78+
done
79+
exit 1
80+
- name: Show coredumps
81+
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
82+
run: |
83+
failed=false
84+
shopt -s nullglob
85+
for file in /tmp/core.*; do
86+
failed=true
87+
printf "::group::"
88+
gdb -ex 'thread apply all bt full' ./haproxy $file
89+
echo "::endgroup::"
90+
done
91+
if [ "$failed" = true ]; then
92+
exit 1;
93+
fi
94+
- name: Show Unit-Tests results
95+
if: ${{ failure() && steps.unittests.outcome == 'failure' }}
96+
run: |
97+
for result in ${TMPDIR:-/tmp}/ha-unittests-*/results/res.*; do
98+
printf "::group::"
99+
cat $result
100+
echo "::endgroup::"
101+
done
102+
exit 1
103+

0 commit comments

Comments
 (0)