Closed puzzlewolf closed 5 years ago
I just realized the error in #31 refers to std
, which is not the same as my error.
Maybe it's relevant: My project is based on the hello-rust samplecode. Adding the lines above to its enclave/Cargo.toml and enclave/src/lib.rs also gives the error.
@sonea-pm8
This means a collision of "sgx_tstd" and "sgxtstd". If you look into the hello-rust sample code, you'll find that it depends on sgx* crates fetched from github directly as:
sgx_types = { rev = "v1.0.8", git = "https://github.com/baidu/rust-sgx-sdk.git" }
sgx_tstd = { rev = "v1.0.8", git = "https://github.com/baidu/rust-sgx-sdk.git" }
So if you put something like ring = { path = "../../../third_party/ring" }
there, ring
in that directory would depends on local sgx_* crates, instead of fetch them from github. So there are two sgx_tstd, one from local, and one from github -- they cannot live together.
I'm maintaining forks for third_party crates, and finally I'll remove the third_party dir and replace it with an index of those forks. The proper way to use ring in hello-rust sample is to use the fork like
[dependencies]
ring = { git = "https://github.com/mesalock-linux/ring-sgx" }
One sample usage is at the ported webpki at https://github.com/mesalock-linux/webpki/blob/1f0412bb199158191bd96b5d1d28939e1d7a245d/Cargo.toml#L70
That was it, thank you
I would like to use either rust-crypto or ring inside the enclave, both exist in the sgx/third_party folder. For rust-crypto, I use Cargo.toml
and lib.rs:
For ring:
and
Both give the same error:
I saw #31 and tried
default-features = false
with both crates, but the error remains. What is going on here, and can you please suggest a fix or workaround?What does it mean when a crate is in the sgx/third_party folder?