ockam icon indicating copy to clipboard operation
ockam copied to clipboard

Remove unnecessary `core`/`heapless`/`hashbrown` re-exports from `signature_core::lib`

Open thomcc opened this issue 3 years ago • 1 comments

The signature_core crate has a couple issues related to import/exports:

  1. First, it should just be unconditionally no_std. It doesn't declare any features, but has https://github.com/ockam-network/ockam/blob/cc93b3863df2f8343c824ace8b30041bae2fa8f2/implementations/rust/ockam/signature_core/src/lib.rs#L11-L17, so this could just be #![no_std] without any extern crate core or extern crate alloc.

  2. It has this fairly dubious mod lib, which gets used by the other signature_* crates too: https://github.com/ockam-network/ockam/blob/cc93b3863df2f8343c824ace8b30041bae2fa8f2/implementations/rust/ockam/signature_core/src/lib.rs#L56-L85

    I think for the most part everything here should be depended on more directly at the place of usage. This applies especially to the imports from core, heapless, and especially to the re-export of hashbrown (which makes this code require liballoc when it wouldn't otherwise need one). After removing this, I guess it's a bit like a prelude module, perhaps.

So, I think we should:

  1. Fix the no_std issue mentioned above for signature_core (problem 1), and while we're at it, check the other signature_* crates and see if they have the same issue.

  2. Remove all the core, heapless, and hashbrown reexports from signature_core::lib. Crates which were using these should import/depend on them directly. The comment for signature_core should change to just say that it's shared functionality used by the other signature crates, or something.

  3. Remove hashbrown from signature_core's Cargo.toml, since at least that crate doesn't actually need it, (AFAIK).

thomcc avatar Nov 03 '21 22:11 thomcc

Hello 👋🏾 . I made the changes, about point number 2, changing the crates that are using the exports, would love some help with that.

I am getting this error in the /signature_bbs_plus/examples/readme-source.rs file extern location for signature_bbs_plus does not exist: /home/jim_4067/Documents/osca/ockam/target/rls/debug/deps/libsignature_bbs_plus-0473ec9102419dda.rmetarustc

jim4067 avatar Nov 07 '21 09:11 jim4067

The signature_core crate doesn't exist anymore, so I'm closing this issue.

adrianbenavides avatar Apr 10 '23 11:04 adrianbenavides