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 263 forks source link

Support for swapping 'std' in sysroot using xargo #38

Closed tarcieri closed 5 years ago

tarcieri commented 6 years ago

xargo can potentially be used to swap in sgx_tstd for std using the custom sysroot crate feature.

Xargo lets you create a sysroot with custom crates. You can virtually put any crate in the sysroot. However, this feature is mainly used to create alternative std facades.

Hypothetically this would be something like:

[dependencies.std]
git = "https://github.com/baidu/sgx_tstd" # or whatever
stage = 2

I tried this at one point and ran into a weird error with rustc (something about a hack to prevent you from accidentally loading crates from the sysroot when you didn't mean to).

That said, if you can get it to work, it would allow any crate which is compatible with the subset of std which sgx_tstd implements to work out-of-the-box.

dingelish commented 6 years ago

Hi @tarcieri ,

Sorry for the late reply. I'll prepare for the 'mirror' very soon. Thanks!

dingelish commented 6 years ago

Hi @tarcieri , i found this. It works amazingly on my code samples.