Skip to content

Commit 8ed1d83

Browse files
committed
ci: Run tools/symbol-check.py
1 parent 41d32ab commit 8ed1d83

File tree

4 files changed

+52
-2
lines changed

4 files changed

+52
-2
lines changed

.cirrus.yml

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ env:
2929
BENCH: yes
3030
SECP256K1_BENCH_ITERS: 2
3131
CTIMETESTS: yes
32+
SYMBOL_CHECK: yes
33+
VIRTUAL_ENV: /root/venv
3234
# Compile and run the tests
3335
EXAMPLES: yes
3436

@@ -53,6 +55,7 @@ cat_logs_snippet: &CAT_LOGS
5355

5456
linux_arm64_container_snippet: &LINUX_ARM64_CONTAINER
5557
env_script:
58+
- export PATH="$VIRTUAL_ENV/bin:$PATH"
5659
- env | tee /tmp/env
5760
build_script:
5861
- DOCKER_BUILDKIT=1 docker build --file "ci/linux-debian.Dockerfile" --tag="ci_secp256k1_arm"

.github/workflows/ci.yml

+29
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ env:
4040
BENCH: 'yes'
4141
SECP256K1_BENCH_ITERS: 2
4242
CTIMETESTS: 'yes'
43+
SYMBOL_CHECK: 'yes'
4344
# Compile and run the examples.
4445
EXAMPLES: 'yes'
4546

@@ -365,6 +366,7 @@ jobs:
365366
ASAN_OPTIONS: 'strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1'
366367
LSAN_OPTIONS: 'use_unaligned=1'
367368
SECP256K1_TEST_ITERS: 32
369+
SYMBOL_CHECK: 'no'
368370

369371
steps:
370372
- name: Checkout
@@ -415,6 +417,7 @@ jobs:
415417
SECP256K1_TEST_ITERS: 32
416418
ASM: 'no'
417419
WITH_VALGRIND: 'no'
420+
SYMBOL_CHECK: 'no'
418421

419422
steps:
420423
- name: Checkout
@@ -483,6 +486,7 @@ jobs:
483486
CC: 'clang'
484487
HOMEBREW_NO_AUTO_UPDATE: 1
485488
HOMEBREW_NO_INSTALL_CLEANUP: 1
489+
SYMBOL_CHECK: 'no'
486490

487491
strategy:
488492
fail-fast: false
@@ -515,6 +519,12 @@ jobs:
515519
env: ${{ matrix.env_vars }}
516520
run: ./ci/ci.sh
517521

522+
- name: Symbol check
523+
run: |
524+
python3 --version
525+
python3 -m pip install lief
526+
python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib
527+
518528
- name: Print logs
519529
uses: ./.github/actions/print-logs
520530
if: ${{ !cancelled() }}
@@ -530,6 +540,7 @@ jobs:
530540
HOMEBREW_NO_INSTALL_CLEANUP: 1
531541
WITH_VALGRIND: 'no'
532542
CTIMETESTS: 'no'
543+
SYMBOL_CHECK: 'no'
533544

534545
strategy:
535546
fail-fast: false
@@ -557,6 +568,16 @@ jobs:
557568
env: ${{ matrix.env_vars }}
558569
run: ./ci/ci.sh
559570

571+
- name: Symbol check
572+
env:
573+
VIRTUAL_ENV: '${{ github.workspace }}/venv'
574+
run: |
575+
python3 --version
576+
python3 -m venv $VIRTUAL_ENV
577+
export PATH="$VIRTUAL_ENV/bin:$PATH"
578+
python3 -m pip install lief
579+
python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib
580+
560581
- name: Print logs
561582
uses: ./.github/actions/print-logs
562583
if: ${{ !cancelled() }}
@@ -573,6 +594,7 @@ jobs:
573594
configuration:
574595
- job_name: 'x64 (MSVC): Windows (VS 2022, shared)'
575596
cmake_options: '-A x64 -DBUILD_SHARED_LIBS=ON'
597+
symbol_check: 'true'
576598
- job_name: 'x64 (MSVC): Windows (VS 2022, static)'
577599
cmake_options: '-A x64 -DBUILD_SHARED_LIBS=OFF'
578600
- job_name: 'x64 (MSVC): Windows (VS 2022, int128_struct)'
@@ -601,6 +623,13 @@ jobs:
601623
run: |
602624
cd build/bin/RelWithDebInfo && file *tests.exe bench*.exe libsecp256k1-*.dll || true
603625
626+
- name: Symbol check
627+
if: ${{ matrix.configuration.symbol_check }}
628+
run: |
629+
py -3 --version
630+
py -3 -m pip install lief
631+
py -3 .\tools\symbol-check.py build\bin\RelWithDebInfo\libsecp256k1-5.dll
632+
604633
- name: Check
605634
run: |
606635
ctest -C RelWithDebInfo --test-dir build -j ([int]$env:NUMBER_OF_PROCESSORS + 1)

ci/ci.sh

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ print_environment() {
1414
for var in WERROR_CFLAGS MAKEFLAGS BUILD \
1515
ECMULTWINDOW ECMULTGENKB ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
1616
EXPERIMENTAL ECDH RECOVERY EXTRAKEYS MUSIG SCHNORRSIG ELLSWIFT \
17-
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS\
17+
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS SYMBOL_CHECK \
1818
EXAMPLES \
1919
HOST WRAPPER_CMD \
2020
CC CFLAGS CPPFLAGS AR NM \
@@ -107,6 +107,20 @@ file *tests* || true
107107
file bench* || true
108108
file .libs/* || true
109109

110+
if [ "$SYMBOL_CHECK" = "yes" ]
111+
then
112+
python3 --version
113+
case "$HOST" in
114+
*mingw*)
115+
ls -l .libs
116+
python3 ./tools/symbol-check.py .libs/libsecp256k1-5.dll
117+
;;
118+
*)
119+
python3 ./tools/symbol-check.py .libs/libsecp256k1.so
120+
;;
121+
esac
122+
fi
123+
110124
# This tells `make check` to wrap test invocations.
111125
export LOG_COMPILER="$WRAPPER_CMD"
112126

ci/linux-debian.Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
3232
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross libc6-dbg:ppc64el \
3333
gcc-mingw-w64-x86-64-win32 wine64 wine \
3434
gcc-mingw-w64-i686-win32 wine32 \
35-
python3 && \
35+
python3-full && \
3636
if ! ( dpkg --print-architecture | grep --quiet "arm64" ) ; then \
3737
apt-get install --no-install-recommends -y \
3838
gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 ;\
@@ -77,3 +77,7 @@ RUN \
7777
apt-get autoremove -y wget && \
7878
apt-get clean && rm -rf /var/lib/apt/lists/*
7979

80+
ENV VIRTUAL_ENV=/root/venv
81+
RUN python3 -m venv $VIRTUAL_ENV
82+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
83+
RUN pip install lief

0 commit comments

Comments
 (0)