rust-bitcoin / rust-bitcoinconsensus

Bitcoin's libbitcoinconsenus.a with Rust binding. Built from Bitcoin sources with cargo.
Apache License 2.0
46 stars 33 forks source link

secp256k1: enable ellswift module #94

Closed benma closed 2 months ago

benma commented 2 months ago

When running cargo tarpaulin (for test coverage) in a project that depends on this crate, compilation fails with:

= note: /usr/bin/ld: /rust-bitcoinconsensus/target/debug/build/bitcoinconsensus-6e1dd1af27ef0a27/out/libbitcoinconsensus.a(0ad13e9c6ad06456-pubkey.o): in function `EllSwiftPubKey::Decode() const':
          /rust-bitcoinconsensus/depend/bitcoin/src/pubkey.cpp:355: undefined reference to `secp256k1_ellswift_decode'
          collect2: error: ld returned 1 exit status

I am not sure why it's not a problem when compiling using cargo test, but the code does reference this function, so the module should be enabled.

apoelstra commented 2 months ago

Thanks! Yeah, it's super frustrating that you have to explicitly call everything before the linker will complain that the code isn't even there.