rusticata / der-parser

BER/DER parser written in pure Rust. Fast, zero-copy, safe.
Apache License 2.0
84 stars 29 forks source link

Dependency trouble with nom_pem #6

Closed focusaurus closed 6 years ago

focusaurus commented 6 years ago

I'm running into some kind of dependency conflict trying to use both der-parser=0.4.4 and nom_pem=1.0.3. When I add both of these, I can't compile nom_pem.

   Compiling nom_pem v1.0.3
error[E0243]: wrong number of type arguments: expected at least 1, found 0
  --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/nom_pem-1.0.3/src/lib.rs:63:14
   |
63 |     NomError(nom::Err),
   |              ^^^^^^^^ expected at least 1 type argument

I think maybe it has something to do with the verbose-errors feature maybe?

chifflier commented 6 years ago

Hi, Indeed, it seems nom_pem does not build when enabling the verbose_errors feature. This is caused by this line (https://github.com/bpressure/nom_pem/blob/master/src/lib.rs#L63):

pub enum PemParsingError {
    NomError(nom::Err),  // <----------
    Incomplete(nom::Needed)
}

The Err type is different with simple_errors (Err<E>) and verbose_errors (Err<P,E>), so it's not possible to link the two crates. @Geal, any idea ?

Geal commented 6 years ago

this is something that's solved in nom 4.0, but it's not released yet (there's an alpha version at nom 4.0.0-alpha1). Right now, I'd advise to translate the nom error to something else, so that this version does not appear in nom_pem's public API.

On Thu, Dec 14, 2017 at 9:00 PM, Pierre Chifflier notifications@github.com wrote:

Hi, Indeed, it seems nom_pem does not build when enabling the verbose_errors feature. This is caused by this line (https://github.com/bpressure/ nom_pem/blob/master/src/lib.rs#L63):

pub enum PemParsingError { NomError(nom::Err), // <---------- Incomplete(nom::Needed) }

The Err type is different with simple_errors (Err) and verbose_errors ( Err<P,E>), so it's not possible to link the two crates. @Geal https://github.com/geal, any idea ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rusticata/der-parser/issues/6#issuecomment-351820054, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHSADQAAvNhcW9yjxsPMaqEoWwx-gz4ks5tAX55gaJpZM4RCjo5 .

-- http://geoffroycouprie.com/

focusaurus commented 6 years ago

CC @bpressure FYI.

focusaurus commented 6 years ago

I have a working work around by forking nom_pem and adjusting to use verbose-errors.