diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ea7677..1fb3002 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: for wf in build-macos.yml build-windows.yml test.yml; do key=$(echo "${wf%.*}" | tr '-' '_') run_id=$(gh run list --repo "${{ github.repository }}" --workflow "$wf" \ - --branch main --status success --json databaseId,headSha \ + --branch main --status success --limit 200 --json databaseId,headSha \ --jq ".[] | select(.headSha == \"${{ github.sha }}\") | .databaseId" | head -n1) if [ -z "$run_id" ]; then echo "::error::No successful $wf run on main for commit ${{ github.sha }}. Push to main and wait for it to build before tagging." @@ -113,6 +113,11 @@ jobs: mkdir -p ../release-assets zip -r ../release-assets/coverage_monero_cpp_html.zip coverage_monero_cpp_html + # to check a download against what the workflow published: sha256sum -c SHA256SUMS + - name: Checksum the assets + working-directory: release-assets + run: sha256sum -- *.deb *.whl *.zip > SHA256SUMS + - name: Create draft release env: GH_TOKEN: ${{ github.token }} @@ -122,4 +127,4 @@ jobs: --draft \ --title "${{ github.ref_name }}" \ --generate-notes \ - release-assets/*.deb release-assets/*.whl release-assets/*.zip + release-assets/*.deb release-assets/*.whl release-assets/*.zip release-assets/SHA256SUMS diff --git a/CMakeLists.txt b/CMakeLists.txt index c59ceca..2a97f3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,4 +351,14 @@ set(MONERO_PYTHON_LINK_LIBS target_link_libraries(monero PRIVATE ${MONERO_PYTHON_LINK_LIBS}) +# A python module has to export PyInit_monero and nothing else. Left to itself the linker also exports every +# symbol of the static libraries it takes in, those of monero-project and monero-cpp: about 27000 on linux, from +# 7000 to 11000 on macOS and 1100 on windows. They make the module bigger and can clash with the symbols that +# another extension of the same process brings, a boost or a protobuf for one. +if(APPLE) + target_link_options(monero PRIVATE -Wl,-dead_strip -Wl,-exported_symbol,_PyInit_monero) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_link_options(monero PRIVATE -Wl,--exclude-libs,ALL -Wl,--gc-sections) +endif() + install(TARGETS monero DESTINATION .)