LLFourn / secp256kfun

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

Clean up feature flags make things compile with alloc and --no-default-features #132

Closed LLFourn closed 1 year ago

LLFourn commented 1 year ago

I've noticed that secp256kfun doesn't actually compile with --no-default-features. This is weird because we test it. The problem is that it works at the workspace root but if you cd into the directory and run the same command it breaks. According to https://github.com/rust-lang/cargo/issues/4753 this issue as been fixed ages ago but it's happening for me.

So this PR is for investigating this and cleaning up feature flags in general.

LLFourn commented 1 year ago

The original problem seems to be a bug in cargo that I can't find reference to anywhere. The work around is to test each package independently.

I've pushed some commits to use the new cargo features available in v1.60.0. Now the dependencies section for schnorr_fun looks like:

[dependencies]
secp256kfun = { path = "../secp256kfun", version = "0.7.1",  default-features = false }

:tada:

and that's it! I've managed to re-export serde which I could never figure out how to do before.

Now ecdsa_fun's adaptor feature can be used without serde (this was impossible to arrange before).

I think I'll go ahead and try and add some "only if this feature is enabled" doc thingos and that will be it for this PR.