Closed yuguorui closed 3 years ago
Seems some checks are not passed, I will check that.
Hi,
Thanks for your PR!
I am interesting in adding no_std support, and originally I thought Cow
would be a problem, and it's nice to have a solution.
The most important error seems to be:
Error: --> src/ber/serialize.rs:9:11
|
9 | use core::io::Write;
| ^^ could not find `io` in `core`
Thanks!
Please note that other upstream repo (such as oid-registry) may not compile due to current changes, I am working on it.
Thanks for the PR update The rustfmt error can be ignored, I'll fix it later
One question: how can we test that the crate is no_std-compliant? (and its dependencies?) I'd like to add that to the CI, to ensure no_std support is not broken by later commits
Thanks for the PR update The rustfmt error can be ignored, I'll fix it later
One question: how can we test that the crate is no_std-compliant? (and its dependencies?) I'd like to add that to the CI, to ensure no_std support is not broken by later commits
I think this could be checked by cargo test --no-default-features
?
But as I said at the beginning, in this case we will encounter errors related to newtype_enum
.
$ cargo test --no-default-features
Compiling der-parser v5.1.0 (/mnt/data1/Code/der-parser)
error[E0433]: failed to resolve: could not find `std` in the list of imported crates
--> src/ber/ber.rs:47:1
|
47 | / newtype_enum! {
48 | | impl debug BerTag {
49 | | EndOfContent = 0x0,
50 | | Boolean = 0x1,
... |
83 | | }
84 | | }
| |_^ could not find `std` in the list of imported crates
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Please note that other upstream repo (such as oid-registry) may not compile due to current changes, I am working on it.
Now, oid-registry can be compiled directly without any modification.
I think this could be checked by
cargo test --no-default-features
?
Indeed, I don't know why I was confused.
But as I said at the beginning, in this case we will encounter errors related to
newtype_enum
.
I encountered this one while testing another crate. I'll update rusticata-macros
to provide a no_std
-friendly version of the macro. I'm taking care of this one.
BTW, it's really annoying to have to add extern crate core
, this makes providing an impl
in the macro for both std
and no_std
quite complex :/
I encountered this one while testing another crate. I'll update
rusticata-macros
to provide ano_std
-friendly version of the macro. I'm taking care of this one.
Fixed in (released) rusticata-macros
3.1.0
I'm merging this now, and will add some commits (rustfmt, add no_std to CI, and maybe update the exports for alloc
).
Thanks for your contribution!
You may need to accept https://github.com/rusticata/rusticata-macros/pull/3 first to use macro
newtype_enum
.