apache / incubator-teaclave-sgx-sdk

Apache Teaclave (incubating) SGX SDK helps developers to write Intel SGX applications in the Rust programming language, and also known as Rust SGX SDK.
https://teaclave.apache.org
Apache License 2.0
1.17k stars 262 forks source link

How to correctly port third party crates like time #223

Closed RMheng closed 4 years ago

RMheng commented 4 years ago

Rust SGX SDK v1.0.4 Release Notes said

New third party libraries bit-vec, chrono, erased-serde, fxhash, nan-preserving-float, num-bigint, quick-error, raft-rs, time, webpki-roots, yasna.

This means that we can port third party crate like crate time in the rust-sgx. But I’m confused how to express correctly in the Cargo.toml. I wrote in the Cargo.toml

[dependencies.time]
version = "0.1"
default-features = false

And my code is

extern crate time;

But got error like

error: duplicate lang item in crate `std` (which `time` depends on): `f32_runtime`.
  |
  = note: the lang item is first defined in crate `sgx_tstd` (which `helloworldsampleenclave` depends on)

When we import the third party, are there any requirement?And how we define the requirements if I want to import other party? Thanks for your reading and looking forward to your reply:)

duanbing commented 4 years ago

Here is a ported crate time : https://github.com/xuperdata/untrusted-time

RMheng notifications@github.com 于2020年4月12日周日 下午9:41写道:

Rust SGX SDK v1.0.4 Release Notes https://github.com/apache/incubator-teaclave-sgx-sdk#v104-release said

New third party libraries bit-vec, chrono, erased-serde, fxhash, nan-preserving-float, num-bigint, quick-error, raft-rs, time, webpki-roots, yasna.

This means that we can port third party crate like crate time in the rust-sgx. But I’m confused how to express correctly in the Cargo.toml. I wrote in the Cargo.toml

[dependencies.time]

version = "0.1"

default-features = false

And my code is

extern crate time;

But got error like

error: duplicate lang item in crate std (which time depends on): f32_runtime.

|

= note: the lang item is first defined in crate sgx_tstd (which helloworldsampleenclave depends on)

When we import the third party, are there any requirement?And how we define the requirements if I want to import other party? Thanks for your reading and looking forward to your reply:)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-teaclave-sgx-sdk/issues/223, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5PZAFXJYQ4FUHO7LHRPPLRMHAHTANCNFSM4MGNLMQQ .

RMheng commented 4 years ago

It works. Thanks!

mssun commented 4 years ago

Thanks.

@RMheng, @duanbing, we are working on a separate project called "crates-sgx" (https://github.com/universal-secure-computing-community/crates-sgx) which is a monorepo of all Rust crates ported for Teaclave SGX SDK targeting the Intel SGX platform.

In this project, we want to establish a clear porting process and accept high quality SGX crates. We have several people working on this. Feel free to contribute if you are interested. Thanks.