LLFourn / secp256kfun

A pure-rust secp256k1 library optimised for fun
BSD Zero Clause License
102 stars 29 forks source link

ci: add armv7 target #108

Closed delta1 closed 2 years ago

delta1 commented 2 years ago

Adds the armv7-unknown-linux-gnueabihf target to CI strategy matrix, but fails to compile secp256kfun_parity_backend in cargo test, even though cargo build works?

cargo build --target armv7-unknown-linux-gnueabihf -p secp256kfun_parity_backend -> works

cargo test --target armv7-unknown-linux-gnueabihf -p secp256kfun_parity_backend -> fails

delta1 commented 2 years ago

@LLFourn if you approve the workflow you'll see the relevant error

nickfarrow commented 2 years ago

Does adding this to .cargo/config help?

# You need to install the "arm-none-linux-gnueabihf" linker on your system
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-none-linux-gnueabihf-gcc"

It gets me to a different error

    Finished test [unoptimized + debuginfo] target(s) in 0.02s
     Running unittests src/lib.rs (/home/nick/repos/secp256kfun/target/armv7-unknown-linux-gnueabihf/debug/deps/secp256kfun_parity_backend-94ce32d7b35c0a66)
error: test failed, to rerun pass '-p secp256kfun_parity_backend --lib'

Caused by:
  could not execute process `/home/nick/repos/secp256kfun/target/armv7-unknown-linux-gnueabihf/debug/deps/secp256kfun_parity_backend-94ce32d7b35c0a66` (never executed)

Or is that just because i'm on the wrong architecture?

Whereas on my RPi I get running 0 tests.

Maybe we need to add linker to CI too somehow?

delta1 commented 2 years ago

Hey @nickfarrow thanks for the suggestions, you gave me the idea to use cargo cross, which is working and showing the error fixed in https://github.com/LLFourn/elliptic-curves/pull/1

Here's the example workflow run: https://github.com/delta1/secp256kfun/runs/8135135847?check_suite_focus=true

delta1 commented 2 years ago

Updated, but some builds failed. I think their cache was restored from the wrong target

You can see the failures here: https://github.com/delta1/secp256kfun/runs/8186507180?check_suite_focus=true

delta1 commented 2 years ago

I think their cache was restored from the wrong target

Updated the rust-cache action to v2

LLFourn commented 2 years ago

LGTM. Thanks @delta1!