coincurve icon indicating copy to clipboard operation
coincurve copied to clipboard

Hack to build fastecdsa

Open DimitriPapadopoulos opened this issue 2 months ago • 5 comments

Fixes the effect of GitHub Action cache misses for key setup-uv-1-aarch64-apple-darwin-3.14.0-no-dependency-glob experienced in #203.

But then it's unclear why this kind of failure affects only Python 3.14. Other versions of Python should have failed as well when creating the cache. While I haven't got to the bottom of this, this is a common issue after installing GMP with Homebrew on macOS, and we apply the currently preferred workaround:

I haven't found a way to define environment variables CFLAGS/LDFLAGS for macOS only.

DimitriPapadopoulos avatar Oct 21 '25 07:10 DimitriPapadopoulos

The CI error looks like a transient GitHub error:

        [1/9] Performing download step (download, verify and extract) for 'vendored_library-populate'
        -- Downloading...
           dst='/tmp/tmpgmgqqevi/build/_deps/vendored_library-subbuild/vendored_library-populate-prefix/src/0cdc758a56360bf58a851fe91085a327ec97685a.tar.gz'
           timeout='none'
           inactivity timeout='none'
        -- Using src='https://github.com/bitcoin-core/secp256k1/archive//0cdc758a56360bf58a851fe91085a327ec97685a.tar.gz'
        CMake Error at vendored_library-subbuild/vendored_library-populate-prefix/src/vendored_library-populate-stamp/download-vendored_library-populate.cmake:163 (message):
          Each download failed!
        
            error: downloading 'https://github.com/bitcoin-core/secp256k1/archive//0cdc758a56360bf58a851fe91085a327ec97685a.tar.gz' failed
                  status_code: 22
                  status_string: "HTTP response code said error"

I'll push again.

DimitriPapadopoulos avatar Oct 21 '25 07:10 DimitriPapadopoulos

Out of curiosity, why is this necessary since fastecdsa is only used for benchmarks?

ofek avatar Oct 21 '25 13:10 ofek

It looks like hatch fmt --check runs the benchmarks, and for that it needs to build fastecdsa.

DimitriPapadopoulos avatar Oct 21 '25 14:10 DimitriPapadopoulos

Where are you seeing that? From what I can tell the benchmarks are invoked only by running uv run and it automatically installs that benchmark dependency to an isolated virtual environment based on inline metadata https://github.com/ofek/coincurve/blob/7829b29c08ebb1cc80386a1cdaf8c2243c4ef5c5/scripts/bench.py#L4

ofek avatar Oct 21 '25 14:10 ofek

It's indeed the benchmark failing while trying to build fastecdsa==3.0.1: https://github.com/ofek/coincurve/actions/runs/18672653134/job/53236594428#step:11:40

I suspect the env might be shared by all steps. I will nevertheless move env to the proper step.

Not sure why this is needed in build.yml but not in verify_*_build.yml.

DimitriPapadopoulos avatar Oct 21 '25 15:10 DimitriPapadopoulos