Arnavion / derive-error-chain

A Macros 1.1 implementation of https://crates.io/crates/error-chain
19 stars 1 forks source link

Undocumented dependencies #20

Open reuvenpo opened 6 years ago

reuvenpo commented 6 years ago

It is undocumented that using a given version of derive_error_chain requires the use of a specific version of error_chain.

For example, to use derive-error-chain = "=0.11.2", one also has to specify error-chain = "=0.11.0" in Cargo.toml. otherwise, one gets unexpected errors from inside the procedural macro (Exact errors depend on specific version combination).

This should either be documented, or otherwise include error-chain as an explicit dependency (since one doesn't even need to extern crate error_chain in one's crate root)

Arnavion commented 6 years ago

It's documented, but admittedly not in a place where you'd look. https://github.com/Arnavion/derive-error-chain/blame/741135fc0ef00b204e6661eb283ead6e28fc7fb3/CHANGELOG.md#L60

Making error-chain a dependency of this crate will not work. It needs to be a dependency of the crate where the macro is invoked.

reuvenpo commented 6 years ago

I see... I think it's a good idea to put it somewhere near the top of the documentation. It's a pretty important, non-trivial detail (and i spent an hour before i figured it out...)

Is it possible/desirable to lose that dependency? or would that both break compatibility with error_chain and be too much of a hassle?

(of course, the saner alternative is to just document the dependency :P)

Arnavion commented 6 years ago

Using error-chain's traits is a deliberate decision. https://github.com/Arnavion/derive-error-chain/issues/5

reuvenpo commented 6 years ago

That makes sense.

(Thanks for the cool package, btw :) )