Skip to content

Commit a678783

Browse files
authored
Fix PCRE2_DEBUG for multi-configuration builds (#542)
* Add support for Ninja Multi-Config generator on all platforms * Ensure one build job is using CMake 3.15 * Provide a build type (Debug or RelWithDebInfo) on all CMake builds * Ensure PCRE2_DEBUG=ON is set for: dev.yml builds which use the Release configuration
1 parent 82ebebf commit a678783

File tree

6 files changed

+224
-149
lines changed

6 files changed

+224
-149
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
submodules: true
7878

7979
- name: Configure
80-
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_C_FLAGS='-Wall -Wextra' -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build
80+
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_C_FLAGS='-Wall -Wextra' -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
8181

8282
- name: Build
8383
run: cmake --build build
@@ -103,25 +103,28 @@ jobs:
103103
./pcre2posix_test -v
104104
105105
windows:
106-
name: 32bit Windows
106+
name: Windows
107107
runs-on: windows-latest
108+
strategy:
109+
matrix:
110+
arch: ["Win32", "x64"]
108111
steps:
109112
- name: Checkout
110113
uses: actions/checkout@v4
111114
with:
112115
submodules: true
113116

114117
- name: Configure
115-
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A Win32
118+
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A ${{ matrix.arch }}
116119

117120
- name: Build
118-
run: cmake --build build
121+
run: cmake --build build --config Release
119122

120123
- name: Test
121124
id: test
122125
run: |
123126
cd build
124-
ctest -C Debug .
127+
ctest -C Release .
125128
126129
- name: Debug
127130
if: ${{ failure() && steps.test.outcome == 'failure' }}

.github/workflows/dev.yml

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
jobs:
99

1010
canary:
11-
name: gcc
11+
# Tests with: Debug & assertions; link-size=4
12+
name: GCC -O0
1213
runs-on: ubuntu-latest
1314
steps:
1415
- name: Checkout
@@ -38,7 +39,8 @@ jobs:
3839
run: ./pcre2posix_test -v
3940

4041
dragon:
41-
name: clang
42+
# Tests with: clang AB/UB; link-size=3
43+
name: Clang
4244
runs-on: ubuntu-latest
4345
steps:
4446
- name: Checkout
@@ -67,9 +69,31 @@ jobs:
6769
- name: Test (pcre2posix program)
6870
run: ./pcre2posix_test -v
6971

72+
greatawk:
73+
# Tests with: GCC, -O3, oldest supported Ubuntu (in non-extended support)
74+
name: GCC -O3
75+
runs-on: ubuntu-20.04
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
with:
80+
submodules: true
81+
82+
- name: Configure
83+
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
84+
85+
- name: Build
86+
run: cd build && make -j3
87+
88+
- name: Test
89+
run: cd build && make test
90+
7091
wasp:
71-
name: No JIT
72-
runs-on: ubuntu-24.04
92+
# Tests with: French locale; oldest supported CMake; no JIT; -Os
93+
name: GCC -Os, CMake+ninja, no JIT
94+
runs-on: ubuntu-latest
95+
env:
96+
CMAKE_VER: "3.15.7"
7397
steps:
7498
- name: Checkout
7599
uses: actions/checkout@v4
@@ -79,25 +103,33 @@ jobs:
79103
- name: Prepare
80104
run: |
81105
sudo apt-get -qq update
82-
sudo apt-get -qq install language-pack-fr
83-
./autogen.sh
106+
sudo apt-get -qq install language-pack-fr ninja-build
84107
85-
- name: Configure
86-
run: ./configure CC='clang -fsanitize=undefined,address,integer -fno-sanitize-recover=undefined,integer -fno-sanitize=unsigned-shift-base,function' --enable-pcre2-16 --enable-pcre2-32 --enable-debug
108+
- name: Cache CMake
109+
uses: actions/cache@v4
110+
with:
111+
key: cmake-${{ env.CMAKE_VER }}-Linux-x86_64
112+
path: cmake-${{ env.CMAKE_VER }}-Linux-x86_64.tar.gz
87113

88-
- name: Build
89-
run: make CPPFLAGS='-pedantic -Wall -Wextra -Wpedantic -Wdeclaration-after-statement -Wshadow -Wno-overlength-strings -Werror -Wno-error=incompatible-pointer-types-discards-qualifiers' -j3
114+
- name: Install CMake
115+
run: |
116+
[ -f cmake-${CMAKE_VER}-Linux-x86_64.tar.gz ] || curl -L -S -O "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.tar.gz"
117+
tar -xz -f cmake-${CMAKE_VER}-Linux-x86_64.tar.gz
118+
realpath "cmake-${CMAKE_VER}-Linux-x86_64/bin" >> "$GITHUB_PATH"
90119
91-
- name: Test (main test script)
92-
run: ./RunTest
120+
- name: Configure
121+
run: |
122+
cmake --version | grep "version ${CMAKE_VER}" || (echo "CMake version mismatch" && exit 1)
123+
CC='clang' CFLAGS='-fsanitize=undefined,address,integer -fno-sanitize-recover=undefined,integer -fno-sanitize=unsigned-shift-base,function -pedantic -Wall -Wextra -Wpedantic -Wdeclaration-after-statement -Wshadow -Wno-overlength-strings -Werror -Wno-error=incompatible-pointer-types-discards-qualifiers' cmake -G Ninja -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DCMAKE_BUILD_TYPE=MinSizeRel -B build
93124
94-
- name: Test (pcre2grep test script)
95-
run: ./RunGrepTest
125+
- name: Build
126+
run: ninja -C build
96127

97-
- name: Test (pcre2posix program)
98-
run: ./pcre2posix_test -v
128+
- name: Test
129+
run: ninja -C build test
99130

100131
bat:
132+
# Tests with: MSVC 32-bit, and a variety of CMake options
101133
name: 32bit MSVC
102134
runs-on: windows-latest
103135
steps:
@@ -110,17 +142,17 @@ jobs:
110142
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2GREP_SUPPORT_CALLOUT_FORK=OFF -DPCRE2_DEBUG=ON -DPCRE2_NEWLINE=ANYCRLF -DPCRE2_STATIC_PIC=ON -DPCRE2_STATIC_RUNTIME=ON -DPCRE2_SUPPORT_BSR_ANYCRLF=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_VERBOSE_MAKEFILE=ON -B build -A Win32
111143

112144
- name: Build
113-
run: cmake --build build
145+
run: cmake --build build --config RelWithDebInfo
114146

115147
- name: Test
116148
shell: cmd
117149
run: |
118150
cd build
119-
ctest -C Debug .
120-
type Testing\Temporary\LastTest.log
151+
ctest -C RelWithDebInfo .
121152
122153
pterodactyl:
123-
name: MSVC
154+
# Tests with: MSVC 64-bit, Debug, shared libraries
155+
name: 64bit MSVC
124156
runs-on: windows-latest
125157
steps:
126158
- name: Checkout
@@ -129,19 +161,19 @@ jobs:
129161
submodules: true
130162

131163
- name: Configure
132-
run: cmake -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DPCRE2_BUILD_PCRE2GREP=OFF -DPCRE2_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build
164+
run: cmake -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DPCRE2_BUILD_PCRE2GREP=OFF -DPCRE2_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A x64
133165

134166
- name: Build
135-
run: cmake --build build
167+
run: cmake --build build --config Debug
136168

137169
- name: Test
138170
shell: cmd
139171
run: |
140172
cd build
141173
ctest -C Debug .
142-
type Testing\Temporary\LastTest.log
143174
144175
bigbird:
176+
# Job to execute ManyConfigTests
145177
name: manyconfig
146178
runs-on: ubuntu-latest
147179
steps:
@@ -161,6 +193,7 @@ jobs:
161193
./maint/ManyConfigTests
162194
163195
camel:
196+
# Job to execute RunPerlTest
164197
name: perl
165198
runs-on: ubuntu-latest
166199
container: perl:devel
@@ -176,7 +209,7 @@ jobs:
176209
apt-get -qq install cmake ninja-build
177210
178211
- name: Configure
179-
run: cmake -G Ninja -B build -DPCRE2_BUILD_PCRE2_8=OFF -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_NEVER_BACKSLASH_C=ON
212+
run: cmake -G Ninja -B build -DPCRE2_BUILD_PCRE2_8=OFF -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_NEVER_BACKSLASH_C=ON -DPCRE2_DEBUG=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
180213

181214
- name: Build
182215
run: cmake --build build

0 commit comments

Comments
 (0)