coincurve icon indicating copy to clipboard operation
coincurve copied to clipboard

FEAT: add shared to cmake extension

Open MementoRC opened this issue 11 months ago • 1 comments

This adds a verification flow to check that a shared build works

MementoRC avatar Mar 18 '24 21:03 MementoRC

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.68%. Comparing base (07d332e) to head (53fb299). Report is 1 commits behind head on master.

:exclamation: Current head 53fb299 differs from pull request most recent head 74e791c

Please upload reports for the commit 74e791c to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #159   +/-   ##
=======================================
  Coverage   85.68%   85.68%           
=======================================
  Files          11       11           
  Lines         566      566           
  Branches       67       67           
=======================================
  Hits          485      485           
  Misses         45       45           
  Partials       36       36           

codecov[bot] avatar Mar 18 '24 21:03 codecov[bot]

Is this still relevant? I'm sorry I don't have much time to look into it! If so I will merge.

ofek avatar Jun 01 '24 20:06 ofek

Well, yes it is. It only adds a n additional workflow to verify that shared library can be used. It is not urgent or critical. It's better to review it, in fact I need to remove the pgkconfiglite. Ping me when you get another window of availability for coincurve. Thanks

MementoRC avatar Jun 01 '24 20:06 MementoRC

What's this, a hash of the source tar ball? https://github.com/ofek/coincurve/blob/adff792cc1fe0cfa634fdd7c584dedee17107874/pyproject.toml#L82

ofek avatar Jun 02 '24 02:06 ofek

Yes, I think I used it in the CMake fetching the secp256k1 tarball. It's likely the sha256sum

    if (NOT VENDORED_UPSTREAM_SHA)
        set(VENDORED_UPSTREAM_SHA "ba34be4319f505c5766aa80b99cfa696cbb2993bfecf7d7eb8696106c493cb8c")
    endif()

    if (NOT CMAKE_BUILD_TYPE)
        set(CMAKE_BUILD_TYPE Release)
    endif()

    # -fPIC is needed since we will link it from a shared object
    if (VENDORED_LIBRARY_STATIC_BUILD)
        set(CMAKE_POSITION_INDEPENDENT_CODE ON)
    endif()

    include(UpdateVendoredLibraryOptions)
    UpdateVendoredLibraryOptions("VENDORED_OPTION" "${VENDORED_LIBRARY_OPTION_PREFIX}")


    FetchContent_Declare(
        vendored_library
        URL "${VENDORED_UPSTREAM_URL}/${VENDORED_UPSTREAM_REF}.tar.gz"
        URL_HASH "SHA256=${VENDORED_UPSTREAM_SHA}"
    )

MementoRC avatar Jun 02 '24 14:06 MementoRC