Skip to content

Commit 4e423a0

Browse files
committed
ci: Run tools/symbol-check.py
1 parent 1c53db0 commit 4e423a0

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

.cirrus.yml

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

@@ -52,6 +54,7 @@ cat_logs_snippet: &CAT_LOGS
5254

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

.github/workflows/ci.yml

+27
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ env:
3939
BENCH: 'yes'
4040
SECP256K1_BENCH_ITERS: 2
4141
CTIMETESTS: 'yes'
42+
SYMBOL_CHECK: 'yes'
4243
# Compile and run the examples.
4344
EXAMPLES: 'yes'
4445

@@ -453,6 +454,7 @@ jobs:
453454
ASAN_OPTIONS: 'strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1'
454455
LSAN_OPTIONS: 'use_unaligned=1'
455456
SECP256K1_TEST_ITERS: 32
457+
SYMBOL_CHECK: 'no'
456458

457459
steps:
458460
- name: Checkout
@@ -516,6 +518,7 @@ jobs:
516518
SECP256K1_TEST_ITERS: 32
517519
ASM: 'no'
518520
WITH_VALGRIND: 'no'
521+
SYMBOL_CHECK: 'no'
519522

520523
steps:
521524
- name: Checkout
@@ -610,6 +613,7 @@ jobs:
610613
CC: 'clang'
611614
HOMEBREW_NO_AUTO_UPDATE: 1
612615
HOMEBREW_NO_INSTALL_CLEANUP: 1
616+
SYMBOL_CHECK: 'no'
613617

614618
strategy:
615619
fail-fast: false
@@ -642,6 +646,11 @@ jobs:
642646
env: ${{ matrix.env_vars }}
643647
run: ./ci/ci.sh
644648

649+
- name: Symbol check
650+
run: |
651+
python3 -m pip install lief
652+
python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib
653+
645654
- run: cat tests.log || true
646655
if: ${{ always() }}
647656
- run: cat noverify_tests.log || true
@@ -671,6 +680,7 @@ jobs:
671680
HOMEBREW_NO_INSTALL_CLEANUP: 1
672681
WITH_VALGRIND: 'no'
673682
CTIMETESTS: 'no'
683+
SYMBOL_CHECK: 'no'
674684

675685
strategy:
676686
fail-fast: false
@@ -698,6 +708,15 @@ jobs:
698708
env: ${{ matrix.env_vars }}
699709
run: ./ci/ci.sh
700710

711+
- name: Symbol check
712+
env:
713+
VIRTUAL_ENV: '${{ github.workspace }}/venv'
714+
run: |
715+
python3 -m venv $VIRTUAL_ENV
716+
export PATH="$VIRTUAL_ENV/bin:$PATH"
717+
python3 -m pip install lief
718+
python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib
719+
701720
- run: cat tests.log || true
702721
if: ${{ always() }}
703722
- run: cat noverify_tests.log || true
@@ -753,6 +772,14 @@ jobs:
753772
run: |
754773
cd build/src/RelWithDebInfo && file *tests.exe bench*.exe libsecp256k1-*.dll || true
755774
775+
- name: Symbol check
776+
if: ${{ matrix.configuration.cmake_options != '-A x64 -DBUILD_SHARED_LIBS=OFF' }}
777+
run: |
778+
choco install --yes --no-progress python3
779+
refreshenv
780+
python -m pip install lief
781+
python .\tools\symbol-check.py build\src\RelWithDebInfo\libsecp256k1-2.dll
782+
756783
- name: Check
757784
run: |
758785
ctest -C RelWithDebInfo --test-dir build -j ([int]$env:NUMBER_OF_PROCESSORS + 1)

ci/ci.sh

+14-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 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 \
@@ -106,6 +106,19 @@ file *tests* || true
106106
file bench* || true
107107
file .libs/* || true
108108

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

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)