From 230b635884251b379b90ad3fac25a48c2747f30b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 25 Jun 2023 07:40:49 +0100 Subject: [PATCH] ci: Run `tools/symbol-check.py` --- .cirrus.yml | 12 ++++++++++++ ci/cirrus.sh | 15 ++++++++++++++- ci/linux-debian.Dockerfile | 6 ++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5a00b65a33..4c946ef508 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,6 +27,7 @@ env: BENCH: yes SECP256K1_BENCH_ITERS: 2 CTIMETESTS: yes + SYMBOL_CHECK: yes # Compile and run the tests EXAMPLES: yes @@ -131,6 +132,7 @@ task: ASM: no WITH_VALGRIND: no CTIMETESTS: no + SYMBOL_CHECK: no matrix: - env: CC: gcc @@ -141,6 +143,9 @@ task: << : *MERGE_BASE test_script: - ./ci/cirrus.sh + symbol_check_script: + - python3 -m pip install lief + - python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib << : *CAT_LOGS << : *CREDITS @@ -254,6 +259,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. @@ -311,6 +317,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: @@ -409,6 +416,11 @@ task: build_script: - '%x64_NATIVE_TOOLS%' - cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5 + 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 check_script: - '%x64_NATIVE_TOOLS%' - ctest -C RelWithDebInfo --test-dir build -j 5 diff --git a/ci/cirrus.sh b/ci/cirrus.sh index cb3c42194c..cddaf2555e 100755 --- a/ci/cirrus.sh +++ b/ci/cirrus.sh @@ -13,7 +13,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 @@ -92,6 +92,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" diff --git a/ci/linux-debian.Dockerfile b/ci/linux-debian.Dockerfile index 0a5bd54e63..8e4be64bf8 100644 --- a/ci/linux-debian.Dockerfile +++ b/ci/linux-debian.Dockerfile @@ -20,6 +20,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 @@ -39,3 +40,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