Open cbeck88 opened 5 years ago
As a temporary workaround, I have republished this crate as alt-failure
on cargo, so that I can make prost-derive
depend on it instead of failure
crate in my project, but renaming it to failure
in prost-derive
Cargo.toml so that no code changes in prost-derive
are needed for this issue. Then the proc-macro is free to use std
without causing std
to infect the main target. Would love a better solution
I'm trying to port
prost
so that it can work in analloc
-only environment. Specifically we want to use it inside of an SGX enclave.prost-derive
is aproc-macro
crate, that usesfailure
crate to do error handling. Unfortunately for us, it turns out thatprost-derive
usesfailure::Error
andfailure::Bail
, which require the featurefailure/std
. But because of long-standing issues in cargo, this means thatfailure
crate will globally bestd
, and so ourno_std
,alloc
-only targets won't build that are usingfailure
crate.There's a separate issue in cargo project so that deps of build.rs and proc-macro don't infect the rest of the build but it's a long way away as I understand.
Are you interested in a patch that adds an
alloc
feature tofailure
crate and makes more offailure
crate, specifically the macros, work inalloc
mode?I'm trying to decide if the best way forward for our project is to patch
prost-derive
away from usingfailure
crate, or to try to make these parts of failure crate more portable.