-
Notifications
You must be signed in to change notification settings - Fork 259
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
Support stable rust? #315
Comments
Hi @xu-cheng , Rust builds itself by using |
If you look at |
As far as I understand, there are two ways to use this SDK to write enclave codes: (a) build SGX's version of the std and use it normally; (b) write the enclave codes in no_std. Can stable rust be used if the second way is used? Here we don't need to deal with xcargo or std aware cargo. Or am I understanding incorrectly? |
Yes you are correct. But both of them are logically building a sysroot, so I don't recommend to use stable Rust.
Yes you can. Just make sure |
FYI, you may want to look at https://github.com/mobilecoinfoundation/mobilecoin/tree/master/sgx, which is essentially a fork of this project. However, it introduces several major differences in design.
|
Thanks, I will try and report back.
I don't think creating a separated branch is a good idea. Would it be possible to officially support this no_std + stable rust approach? If so, a CI workflow can be created to test this approach and ensure it working in the future. |
@xu-cheng @dingelish, I found that the mentioned Please don't read and refer to any GPL-licensed code. Thank you so much. Since we are an Apache Incubator project and under the Apache license, please read this article about GPL-compatibility: https://www.apache.org/licenses/GPL-compatibility.html |
Sorry, I didn't realize there is a license incompatibility. I merely mention it to point a different design. |
That's OK. You may look at this issue #311 about a better implementation of the SDK using std-aware Cargo. |
thanks @xu-cheng for the pointer! the sad fact is that: people wants std here :-( that's why things are so complicated. and std-aware cargo is sometimes buggy :-( only I'd try to support both stable and nightly in the same branch. but I do have users who wants to always keep updated with latest nightly. and recent frequent breaking changes in |
Ok, I tested a bit and got the following errors:
Understood. Thanks for creating this SDK. If you want to support both versions of Rust, it may be a good idea to setup CI to test them periodically. |
Thinking a bit more. I think this is right that stable + |
Hi @xu-cheng please checkout beta/stable support at https://github.com/apache/incubator-teaclave-sgx-sdk/tree/stable-support |
Thanks. It works. |
@dingelish Any chance to merge https://github.com/apache/incubator-teaclave-sgx-sdk/tree/stable-support into the master branch? Furthermore, is it possible to bump the compiler support to the latest nightly? I saw the following error and warning when compiling with the latest nightly.
|
Hey - just to emphasize, a compiler update for the SDK is really, really crucial moving forward. https://github.com/rust-lang/rust/releases 1.50 introduced const generics which - since it's considered stable - will make its way into all other crates down the line, since it's a very handy upgrade. Case in point, arrayvec already made the switch: https://docs.rs/arrayvec/0.7.0/arrayvec/#rust-version This means that whether inside or outside the enclave, we'd be locked to crate versions that build with 1.49. What's blocking the move to stable Rust exactly? |
Hi @dingelish, I am wondering whether it is possible to update this SDK to support the latest version of stable or nightly Rust. This SDK really needs update to support mini const generics. |
Hey everyone - I created a quick fix for using Rust 1.55 nightly. Use at your own peril 😅 PR #349 |
Another solution to supporting stable rust: https://www.crowdsupply.com/sutajio-kosagi/precursor/updates/adding-rust-stable-libstd-support-for-xous In a nutshell, we can put compiled std |
Why nightly rust is needed? Using nightly rust has several major disadvantages:
Can stable rust be supported, specially if the enclave code is written in
no_std
?The text was updated successfully, but these errors were encountered: