-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No std support? #98
Comments
I've pondered on this a bit and can't really come up with a good solution. Moving away from serde is a non-starter for me.
If you are shelling out anyway, you could create a binary crate that when run, runs your Basically move your |
I like your proposal, it sounds promising. Thank you! |
Hi, just fyi, there was a recent PR to So another possibility is to select In our build we resolved in a different way so I don't have a patch to offer, but if someone else has this problem and sees this issue, it might help them |
This is not currently possible because cargo_metadata exposes
So I'm not sure this makes sense to keep open. |
this was basically fixed by cargo adding the new resolver, which allows to avoid unifying build dependencies and source dependencies. so fwiw if you want to close it, that seems reasonable |
Ahhh, I missed that this was the issue - you don't need cargo_metadata itself to be no_std, just its dependencies. Yes, I think this makes sense to close then. |
Hi, this issue may sound a bit strange, let me explain:
libstd
.build.rs
shells out tocargo
in order to build the enclave package. That invocation takes place in a different cargo workspace.cargo:rerun-if-changed
directives from that build.rs, corresponding to any local packages depended on by the enclave.cargo_metadata
to find any local packages depended on by the enclave, which works :)cargo_metadata
depends onserde_json
, it brings thestd
feature intoserde
and then breaks the enclave build. This feature unification across dependencies and build-dependencies is a long-standing cargo bug, with no fix in sight: build-dependencies and dependencies should not have features unified rust-lang/cargo#4866After some deliberation, what I have done now is clone
cargo_metadata
and republish it on crates.io asalt_cargo_metadata
. I have also republishedalt_serde
andalt_serde_json
, and patched their Cargo.toml's to depend on alt versions of each other. Cargo allows renaming dependencies viapackage =
so the code still refers toserde
, but Cargo does not unify features betweenserde
andalt-serde
, so our build can limp along.What I'd like to ask is, would you consider accepting a patch that migrates
cargo_metadata
away fromserde_json
towards something that does not usestd
, and specifically, doesn't requireserde/std
? It seems like a design flaw thatserde_json
cannot be used at all withoutserde/std
, it seriously limits its usefulness.I'd also be interested if you think there's a better way to track dependencies of a cargo invocation made from a build.rs script than using this package -- I guess that you are mainly interested in supporting cargo subcommand tools, so maybe this use is out of scope?
Thanks!
The text was updated successfully, but these errors were encountered: