Skip to content

Commit db2dc0b

Browse files
committed
ci: patch nginx Makefile CFLAGS and LINK in place
Edit the configure-generated assignments instead of appending CFLAGS += so compile and link both get sanitizer flags, and fail if CFLAGS is missing -fsanitize=.
1 parent 3198d9b commit db2dc0b

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎.github/workflows/test-nginx.yaml‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ jobs:
8888
--add-module="${GITHUB_WORKSPACE}" \
8989
--with-http_ssl_module \
9090
|| { echo "::error::nginx configure failed"; cat objs/autoconf.err; exit 1; }
91-
printf 'CFLAGS += %s\nLINK = %s %s\n' \
92-
"${{ matrix.cc_sanitize }}" \
93-
"${CC}" \
94-
"${{ matrix.ld_sanitize }}" \
95-
>> objs/Makefile
91+
sed -i \
92+
-e "s|^CFLAGS *=|CFLAGS = ${{ matrix.cc_sanitize }} |" \
93+
-e "s|^LINK *=.*|LINK = ${CC} ${{ matrix.ld_sanitize }}|" \
94+
objs/Makefile
95+
grep -E '^(CFLAGS|LINK)[[:space:]]*=' objs/Makefile
96+
grep -q -- '-fsanitize=' <<<"$(grep '^CFLAGS[[:space:]]*=' objs/Makefile)" \
97+
|| { echo "::error::CFLAGS missing sanitizer flags"; exit 1; }
9698
make -j"$(nproc)"
9799
./objs/nginx -V
98100

0 commit comments

Comments
 (0)