Skip to content

Commit 30a6368

Browse files
committed
ci: Run tools/symbol-check.py
1 parent e0cc321 commit 30a6368

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

@@ -461,6 +462,7 @@ jobs:
461462
ASAN_OPTIONS: 'strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1'
462463
LSAN_OPTIONS: 'use_unaligned=1'
463464
SECP256K1_TEST_ITERS: 32
465+
SYMBOL_CHECK: 'no'
464466

465467
steps:
466468
- name: Checkout
@@ -525,6 +527,7 @@ jobs:
525527
SECP256K1_TEST_ITERS: 32
526528
ASM: 'no'
527529
WITH_VALGRIND: 'no'
530+
SYMBOL_CHECK: 'no'
528531

529532
steps:
530533
- name: Checkout
@@ -620,6 +623,7 @@ jobs:
620623
CC: 'clang'
621624
HOMEBREW_NO_AUTO_UPDATE: 1
622625
HOMEBREW_NO_INSTALL_CLEANUP: 1
626+
SYMBOL_CHECK: 'no'
623627

624628
strategy:
625629
fail-fast: false
@@ -652,6 +656,12 @@ jobs:
652656
env: ${{ matrix.env_vars }}
653657
run: ./ci/ci.sh
654658

659+
- name: Symbol check
660+
run: |
661+
python3 --version
662+
python3 -m pip install lief
663+
python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib
664+
655665
- run: cat tests.log || true
656666
if: ${{ always() }}
657667
- run: cat noverify_tests.log || true
@@ -681,6 +691,7 @@ jobs:
681691
HOMEBREW_NO_INSTALL_CLEANUP: 1
682692
WITH_VALGRIND: 'no'
683693
CTIMETESTS: 'no'
694+
SYMBOL_CHECK: 'no'
684695

685696
strategy:
686697
fail-fast: false
@@ -708,6 +719,16 @@ jobs:
708719
env: ${{ matrix.env_vars }}
709720
run: ./ci/ci.sh
710721

722+
- name: Symbol check
723+
env:
724+
VIRTUAL_ENV: '${{ github.workspace }}/venv'
725+
run: |
726+
python3 --version
727+
python3 -m venv $VIRTUAL_ENV
728+
export PATH="$VIRTUAL_ENV/bin:$PATH"
729+
python3 -m pip install lief
730+
python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib
731+
711732
- run: cat tests.log || true
712733
if: ${{ always() }}
713734
- run: cat noverify_tests.log || true
@@ -737,6 +758,7 @@ jobs:
737758
configuration:
738759
- job_name: 'x64 (MSVC): Windows (VS 2022, shared)'
739760
cmake_options: '-A x64 -DBUILD_SHARED_LIBS=ON'
761+
symbol_check: 'true'
740762
- job_name: 'x64 (MSVC): Windows (VS 2022, static)'
741763
cmake_options: '-A x64 -DBUILD_SHARED_LIBS=OFF'
742764
- job_name: 'x64 (MSVC): Windows (VS 2022, int128_struct)'
@@ -763,6 +785,13 @@ jobs:
763785
run: |
764786
cd build/bin/RelWithDebInfo && file *tests.exe bench*.exe libsecp256k1-*.dll || true
765787
788+
- name: Symbol check
789+
if: ${{ matrix.configuration.symbol_check }}
790+
run: |
791+
py -3 --version
792+
py -3 -m pip install lief
793+
py -3 .\tools\symbol-check.py build\bin\RelWithDebInfo\libsecp256k1-2.dll
794+
766795
- name: Check
767796
run: |
768797
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-2.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)