Skip to content

Commit 971de5f

Browse files
authored
Add multiarch build jobs (#663)
* S390x is important, because it's basically the only supported big-endian architecture I can find anywhere. I used to work on SPARC and PPC-be systems a long time ago, but even Debian has dropped those architectures now, so it's nice that there's *least one* arch remaining to shake out endian assumptions. * PPC64LE is Big-iron POWER only (this is not the PowerPC arch used in old Apple Macs) * ARMv7 is a 32-bit Linux build. i386 is mostly gone now, so ARMv7 is all that's left. * AARCH64 is the only really widely-deployed non-x86 archicture, at least that's likely to be running PCRE2. * RiscV, since it's the Next Big Thing™.
1 parent 9a868b0 commit 971de5f

File tree

5 files changed

+76
-11
lines changed

5 files changed

+76
-11
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
179179
./configure CFLAGS="$CFLAGS_GCC_STYLE" --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-Werror
180180
make -j3
181-
make check
181+
make check || (cat ./test-suite.log; false)
182182
183183
make install "DESTDIR=`pwd`/install-dir"
184184
maint/RunManifestTest install-dir maint/manifest-makeinstall-freebsd
@@ -247,7 +247,7 @@ jobs:
247247
248248
./configure CC="cc -m32" CFLAGS="$CFLAGS_SOLARIS_CC" --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-errwarn
249249
make
250-
make check
250+
make check || (cat ./test-suite.log; false)
251251
252252
make install "DESTDIR=`pwd`/install-dir"
253253
maint/RunManifestTest install-dir maint/manifest-makeinstall-solaris
@@ -257,7 +257,7 @@ jobs:
257257
258258
./configure CC="cc -m64" CFLAGS="$CFLAGS_SOLARIS_CC" --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-errwarn
259259
make
260-
make check
260+
make check || (cat ./test-suite.log; false)
261261
262262
make install "DESTDIR=`pwd`/install-dir"
263263
maint/RunManifestTest install-dir maint/manifest-makeinstall-solaris

.github/workflows/dev.yml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
run: make -j3
134134

135135
- name: Test
136-
run: make check
136+
run: make check || (cat ./test-suite.log; false)
137137

138138
- name: Install
139139
run: |
@@ -331,6 +331,71 @@ jobs:
331331
shell: msys2 {0}
332332
run: cd build && ctest -j3 --output-on-failure
333333

334+
ptarmigan:
335+
# Tests with various unusual processor architectures
336+
name: Multiarch
337+
strategy:
338+
fail-fast: false
339+
matrix:
340+
include:
341+
# S390x is important, because it's basically the only supported big-endian
342+
# architecture I can find anywhere. I used to work on SPARC and PPC-be systems
343+
# a long time ago, but even Debian has dropped those architectures now, so
344+
# it's nice that there's *least one* arch remaining to shake out endian
345+
# assumptions.
346+
- arch: "s390x"
347+
distro: ubuntu_latest
348+
# Big-iron POWER only (this is not the PowerPC arch used in old Apple Macs)
349+
- arch: "ppc64le"
350+
distro: "ubuntu_latest"
351+
# A 32-bit Linux build. i386 is mostly gone now, so ARMv7 is all that's left.
352+
- arch: "armv7"
353+
distro: "ubuntu_latest"
354+
# The only really widely-deployed non-x86 archicture, at least that's likely
355+
# to be running PCRE2.
356+
- arch: "aarch64"
357+
distro: "ubuntu_latest"
358+
# Not used by anyone yet, really, but potentially the "next big thing".
359+
- arch: "riscv64"
360+
distro: "ubuntu_latest"
361+
runs-on: ubuntu-24.04
362+
permissions:
363+
contents: read
364+
packages: write # Necessary for uraimo/run-on-arch-action to use GitHub's Docker repository as a cache
365+
if: github.event_name != 'pull_request'
366+
steps:
367+
- name: Checkout
368+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
369+
with:
370+
submodules: true
371+
372+
- name: Prepare
373+
run: ./autogen.sh
374+
375+
- uses: uraimo/run-on-arch-action@ac33288c3728ca72563c97b8b88dda5a65a84448 # v2.8.1
376+
name: Configure, build, and test
377+
with:
378+
arch: ${{ matrix.arch }}
379+
distro: ${{ matrix.distro }}
380+
381+
# Not required, but speeds up builds by storing container images in
382+
# a GitHub package registry.
383+
githubToken: ${{ github.token }}
384+
385+
env: | # YAML, but pipe character is necessary
386+
CFLAGS_GCC_STYLE: ${{ env.CFLAGS_GCC_STYLE }}
387+
388+
install: |
389+
apt-get -qq update
390+
apt-get -qq install -y gcc cmake ninja-build zlib1g-dev libbz2-dev
391+
392+
run: |
393+
set -e
394+
# TODO: Set -DCMAKE_COMPILE_WARNING_AS_ERROR=ON (there's currently a build failure on S390x)
395+
cmake -G Ninja -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DPCRE2_DEBUG=ON -DCMAKE_C_FLAGS="$CFLAGS_GCC_STYLE -Wno-format-truncation -Wno-format-overflow" -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -B build
396+
ninja -C build
397+
(cd build && ctest -j3 --output-on-failure)
398+
334399
zebrilus:
335400
# Tests with: Zig compiler
336401
name: Zig

src/pcre2_jit_char_inc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ static PCRE2_SPTR SLJIT_FUNC do_extuni_utf(jit_arguments *args, PCRE2_SPTR cc)
14861486
{
14871487
PCRE2_SPTR start_subject = args->begin;
14881488
PCRE2_SPTR end_subject = args->end;
1489-
int lgb, rgb, ricount;
1489+
int lgb = 0, rgb, ricount;
14901490
PCRE2_SPTR prevcc, endcc, bptr;
14911491
BOOL first = TRUE;
14921492
BOOL was_ep_ZWJ = FALSE;
@@ -1569,7 +1569,7 @@ static PCRE2_SPTR SLJIT_FUNC do_extuni_utf_invalid(jit_arguments *args, PCRE2_SP
15691569
{
15701570
PCRE2_SPTR start_subject = args->begin;
15711571
PCRE2_SPTR end_subject = args->end;
1572-
int lgb, rgb, ricount;
1572+
int lgb = 0, rgb, ricount;
15731573
PCRE2_SPTR prevcc, endcc, bptr;
15741574
BOOL first = TRUE;
15751575
BOOL was_ep_ZWJ = FALSE;

src/pcre2_jit_simd_inc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ if (char1 != char2)
12891289

12901290
#else /* PCRE2_CODE_UNIT_WIDTH == 32 */
12911291

1292-
for (int i = 0; i < 2; i++)
1292+
for (i = 0; i < 2; i++)
12931293
{
12941294
replicate_imm_vector(compiler, i, cmp1_ind, char1 | bit, TMP1);
12951295

@@ -1483,7 +1483,7 @@ if (char1 != char2)
14831483

14841484
#else /* PCRE2_CODE_UNIT_WIDTH == 32 */
14851485

1486-
for (int i = 0; i < 2; i++)
1486+
for (i = 0; i < 2; i++)
14871487
{
14881488
replicate_imm_vector(compiler, i, cmp1_ind, char1 | bit, TMP3);
14891489

@@ -1699,7 +1699,7 @@ if (char2a != char2b)
16991699

17001700
#else /* PCRE2_CODE_UNIT_WIDTH == 32 */
17011701

1702-
for (int i = 0; i < 2; i++)
1702+
for (i = 0; i < 2; i++)
17031703
{
17041704
replicate_imm_vector(compiler, i, cmp1a_ind, char1a | bit1, TMP1);
17051705

src/pcre2test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ static modstruct modlist[] = {
754754
{ "null_pattern", MOD_PAT, MOD_CTL, CTL2_NULL_PATTERN, PO(control2) },
755755
{ "null_replacement", MOD_DAT, MOD_CTL, CTL2_NULL_REPLACEMENT, DO(control2) },
756756
{ "null_subject", MOD_DAT, MOD_CTL, CTL2_NULL_SUBJECT, DO(control2) },
757-
{ "offset", MOD_DAT, MOD_INT, 0, DO(offset) },
757+
{ "offset", MOD_DAT, MOD_SIZ, 0, DO(offset) },
758758
{ "offset_limit", MOD_CTM, MOD_SIZ, 0, MO(offset_limit)},
759759
{ "optimization_full", MOD_CTC, MOD_OPTMZ, PCRE2_OPTIMIZATION_FULL, 0 },
760760
{ "optimization_none", MOD_CTC, MOD_OPTMZ, PCRE2_OPTIMIZATION_NONE, 0 },
@@ -778,7 +778,7 @@ static modstruct modlist[] = {
778778
{ "start_optimize", MOD_CTC, MOD_OPTMZ, PCRE2_START_OPTIMIZE, 0 },
779779
{ "start_optimize_off", MOD_CTC, MOD_OPTMZ, PCRE2_START_OPTIMIZE_OFF, 0 },
780780
{ "startchar", MOD_PND, MOD_CTL, CTL_STARTCHAR, PO(control) },
781-
{ "startoffset", MOD_DAT, MOD_INT, 0, DO(offset) },
781+
{ "startoffset", MOD_DAT, MOD_SIZ, 0, DO(offset) },
782782
{ "subject_literal", MOD_PATP, MOD_CTL, CTL2_SUBJECT_LITERAL, PO(control2) },
783783
{ "substitute_callout", MOD_PND, MOD_CTL, CTL2_SUBSTITUTE_CALLOUT, PO(control2) },
784784
{ "substitute_case_callout", MOD_PND, MOD_CTL, CTL2_SUBSTITUTE_CASE_CALLOUT, PO(control2) },

0 commit comments

Comments
 (0)