helix-onchain / filecoin

Collection of libraries to implement common patterns and standards on the Filecoin Virtual Machine
Other
16 stars 14 forks source link

replace the `no_sdk` feature with `use_sdk` #215

Closed lemmih closed 1 year ago

lemmih commented 1 year ago

Compile features work better when they are additive.

lemmih commented 1 year ago

Before this PR, the no_sdk feature was independent from the dependencies and compiling without default features would fail:

$ cargo build --no-default-features
   Compiling frc42_hasher v1.5.0 (/home/lemmih/coding/filecoin/frc42_dispatch/hasher)
error[E0432]: unresolved import `fvm_sdk`
 --> frc42_dispatch/hasher/src/hash.rs:2:5
  |
2 | use fvm_sdk::crypto;
  |     ^^^^^^^ use of undeclared crate or module `fvm_sdk`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `frc42_hasher` due to previous error

With this PR, all feature combinations work as intended. Compiling without default features disables the SDK code, and compiling with default features (or explicitly enabling use_sdk) will pull in the right dependencies.

coveralls commented 1 year ago

Coverage Status

coverage: 86.776% (-0.02%) from 86.797% when pulling 68bd7ab169f36449c4e7aed8aa9c2538b7254a84 on lemmih:lemmih/additive-feature into 2d24c6a8ec46483f5ae36c128e9d4bf60f6829e0 on helix-onchain:main.