error-chain icon indicating copy to clipboard operation
error-chain copied to clipboard

How to make libraries that use error-chain and error-chain-derive parametric over the feature backtrace?

Open golddranks opened this issue 8 years ago • 2 comments
trafficstars

I'm having a problem with dotenv which uses both error-chain and error-chain-derive: https://github.com/slapresta/rust-dotenv/issues/65

This isn't a specific problem of dotenv, but any library that uses error-chain and error-chain-derive as a combination and still wants to provide full flexibility to let the users decide whether to enable backtraces or not.

It may be that the feature system is fundamentally ill-posed for such a problem. What do you think?

golddranks avatar Jun 19 '17 10:06 golddranks

Yeah, it's a problem. See https://github.com/Arnavion/derive-error-chain/issues/11#issuecomment-277786180 for some discussion about common code path.

Yamakaky avatar Jun 19 '17 18:06 Yamakaky

I don't think derive-error-chain is involved, right? It seems to me the situation is that crate A uses error-chain with the backtrace feature and does not expose a feature to turn it off, so crate B that wants to use error-chain without the backtrace feature can't do that.

Arnavion avatar Aug 07 '17 23:08 Arnavion