From bebab8d76e401e0aad5ff375eb1dad2f9b9a6ccb Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 13 Jul 2023 18:46:46 +0100 Subject: [PATCH] ci: Run `tools/symbol-check.py` --- .cirrus.yml | 22 +++++++++++++++++----- ci/cirrus.sh | 15 ++++++++++++++- ci/linux-debian.Dockerfile | 6 ++++++ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ae205c624c..658455ee37 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 @@ -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} @@ -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 @@ -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. @@ -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: @@ -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 @@ -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 diff --git a/ci/cirrus.sh b/ci/cirrus.sh index 48a9783cc4..b69c2d5336 100755 --- a/ci/cirrus.sh +++ b/ci/cirrus.sh @@ -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 @@ -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" diff --git a/ci/linux-debian.Dockerfile b/ci/linux-debian.Dockerfile index dbb1dd2919..54177460a1 100644 --- a/ci/linux-debian.Dockerfile +++ b/ci/linux-debian.Dockerfile @@ -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 @@ -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