Skip to content

Commit

Permalink
ci: Run tools/symbol-check.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jul 13, 2023
1 parent 78921b1 commit bebab8d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
22 changes: 17 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
BENCH: yes
SECP256K1_BENCH_ITERS: 2
CTIMETESTS: yes
SYMBOL_CHECK: yes
# Compile and run the tests
EXAMPLES: yes

Expand Down Expand Up @@ -127,6 +128,7 @@ task:
WITH_VALGRIND: no
CTIMETESTS: no
CC: clang
SYMBOL_CHECK: no
matrix:
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
Expand All @@ -140,6 +142,9 @@ task:
- brew install automake libtool gcc
test_script:
- ./ci/cirrus.sh
symbol_check_script:
- python3 -m pip install lief
- python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib
<< : *CAT_LOGS
<< : *CREDITS

Expand Down Expand Up @@ -248,6 +253,7 @@ task:
SCHNORRSIG: yes
ELLSWIFT: yes
CTIMETESTS: no
SYMBOL_CHECK: no
# Use a MinGW-w64 host to tell ./configure we're building for Windows.
# This will detect some MinGW-w64 tools but then make will need only
# the MSVC tools CC, AR and NM as specified below.
Expand Down Expand Up @@ -304,6 +310,7 @@ task:
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
LSAN_OPTIONS: "use_unaligned=1"
SECP256K1_TEST_ITERS: 32
SYMBOL_CHECK: no
# Try to cover many configurations with just a tiny matrix.
matrix:
- env:
Expand Down Expand Up @@ -391,11 +398,6 @@ task:
# Ignore MSBuild warning MSB8029.
# See: https://learn.microsoft.com/en-us/visualstudio/msbuild/errors/msb8029?view=vs-2022
IgnoreWarnIntDirInTempDetected: 'true'
matrix:
- env:
BUILD_SHARED_LIBS: ON
- env:
BUILD_SHARED_LIBS: OFF
git_show_script:
# Print commit to allow reproducing the job outside of CI.
- git show --no-patch
Expand All @@ -405,6 +407,16 @@ task:
build_script:
- '%x64_NATIVE_TOOLS%'
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5
matrix:
- env:
BUILD_SHARED_LIBS: ON
symbol_check_script:
- choco install --yes --no-progress python3
- refreshenv
- python -m pip install lief
- python .\tools\symbol-check.py build\src\RelWithDebInfo\libsecp256k1-2.dll
- env:
BUILD_SHARED_LIBS: OFF
check_script:
- '%x64_NATIVE_TOOLS%'
- ctest -C RelWithDebInfo --test-dir build -j 5
Expand Down
15 changes: 14 additions & 1 deletion ci/cirrus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ print_environment() {
for var in WERROR_CFLAGS MAKEFLAGS BUILD \
ECMULTWINDOW ECMULTGENPRECISION ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
EXPERIMENTAL ECDH RECOVERY SCHNORRSIG \
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS\
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS SYMBOL_CHECK \
EXAMPLES \
HOST WRAPPER_CMD \
CC CFLAGS CPPFLAGS AR NM
Expand Down Expand Up @@ -93,6 +93,19 @@ file *tests* || true
file bench* || true
file .libs/* || true

if [ "$SYMBOL_CHECK" = "yes" ]
then
case "$HOST" in
*mingw*)
ls -l .libs
python3 ./tools/symbol-check.py .libs/libsecp256k1-2.dll
;;
*)
python3 ./tools/symbol-check.py .libs/libsecp256k1.so
;;
esac
fi

# This tells `make check` to wrap test invocations.
export LOG_COMPILER="$WRAPPER_CMD"

Expand Down
6 changes: 6 additions & 0 deletions ci/linux-debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross libc6-dbg:ppc64el \
gcc-mingw-w64-x86-64-win32 wine64 wine \
gcc-mingw-w64-i686-win32 wine32 \
python3-full \
sagemath

WORKDIR /root
Expand Down Expand Up @@ -73,3 +74,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
# Wait until the wineserver process has exited before closing the session,
# to avoid corrupting the wine prefix.
while (ps -A | grep wineserver) > /dev/null; do sleep 1; done

ENV VIRTUAL_ENV=/root/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install lief

0 comments on commit bebab8d

Please sign in to comment.