-
Notifications
You must be signed in to change notification settings - Fork 265
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
rustc_private error when compiling crates.io dependencies with Xargo configuration #231
Comments
|
Me and my team are using the correct compiler version for the sdk versions that we use. The problem is that adding this feature in our crate does not disable this error in crates we depend on. We shouldn't have to fork half our dependency tree because of a misconfiguration, nor should we be adding this workaround to our top-level crate. |
Which crate will trigger this error? Can you provide a specific crate name? |
Off the top of my head, we've seen it getting triggered by lazy_static in our dependencies.
|
@reuvenpo You can try to use -Z force-unstable-if-unmarked flag to solve your problem. This flag forces the crate to be unstable, while also allowing them to use other "unstable" crates. |
My verification result is that after using the -Z force-unstable-if-unmarked flag, you do not need to set rustc_private for your crate and all crates it depends on. |
Ok, awesome :D That being said, this is still an issue that needs to be investigated... The Xargo docs don't mention anything like this, which indicates that something is missing from the sgx-sdk. Until a solution is found though, can you please document the need for this flag when using Xargo to compile the stack? As a side question, why do you show examples of compiling packages without Xargo? It's not very useful to have your crate marked as no_std and then add tstd as a dependency of that crate alone. It forces you to only use no_std dependencies, while you're still linking to a mostly-usual std anyways so you don't get any of the benefits of no_std. |
Yes, I also see that there is no mention of any information about this flag(force-unstable-if-unmarked) in the xargo doc, so this issue still needs analysis. If there is any progress, I will record the analysis results in this issue. |
The issue is because crates in SGX custom sysroot do not declare # [staged_api] and # [stable] features. If set the -Z force-unstable-if-unmarked flag, rustc will automatically mark rustc_private features, so setting the -Z force-unstable-if-unmarked flag will not compile errors when building crates. Xargo uses the -Z force-unstable-if-unmarked flag when building a custom sysroot, but this flag is not set when building the top-level crate, so there will be no compilation errors when building custom sysroot. There are two ways to solve this problem: Which solution would be better, any idea? |
interesting... I imagine it depends on how much effort you want to put into this... If you don't want to go back and mark all the public functions with these annotations, then i suppose it's acceptable for most use cases to point out and explain the usage of this flag when using Xargo. Does the SDK compile with stable compilers? If so, then this might cause issues for that workflow (although we specifically use nightly compilers) |
When an enclave crate is configured to compile with Xargo, instead of manually importing the
sgx_tstd
standard library, you randomly get the following error from some dependencies:A lot of crates compile with no issue at all, correctly linking to the tstd, but random expressions used in some crates trigger this error.
This is probably due to some miss-configuration of the tstd.
Which version of rust's std is the tstd based on? Are updates from stable Rust pulled into the tstd?
The text was updated successfully, but these errors were encountered: