You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2021/06/15 15:53:38 UTC

[GitHub] [incubator-teaclave-sgx-sdk] clangenb opened a new issue #345: Intuition behind feature flags

clangenb opened a new issue #345:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/345


   I have a question about the feature flags use in the crates. I just can't understand them.
   
   I thought the below means that we use these dependencies, when we are not in sgx environment. But is this not exactly contrary to what the intuition is?
   
   ```
   [target.'cfg(not(target_env = "sgx"))'.dependencies]
   ```
   
   Further, we have this:
   
   ```
   #![cfg_attr(not(target_env = "sgx"), no_std)]
   #![cfg_attr(target_env = "sgx", feature(rustc_private))]
   ```
   
   If we are not in environment sgx, we are no std. But I thought sgx is exactly the no_std environment. And I don't understand why the line below is the exact opposite.
   
   Last one:
   
   ```
   #[cfg(not(target_env = "sgx"))]
   extern crate sgx_tstd as std;
   ```
   which to me is also: `import extern crate sgx_tstd as std` if we are not in sgx.
   
   I have been using sgx for over a year now and never understood this. I thought it will be clear one day, but the more time passes, the more that the flags are used wrongly here.
   
   So I would finally like to know, do I lack a fundamental understanding here, or are we somewhat working against the cargo system?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave-sgx-sdk] clangenb closed issue #345: Intuition behind cargo config flags and cargo attributes.

Posted by GitBox <gi...@apache.org>.
clangenb closed issue #345:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/345


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave-sgx-sdk] volcano0dr commented on issue #345: Intuition behind cargo config flags and cargo attributes.

Posted by GitBox <gi...@apache.org>.
volcano0dr commented on issue #345:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/345#issuecomment-864337130


   `target_env = "sgx"`
   It does not mean that you are currently in the SGX environment.
   It is defined in the target specification file of the custom SGX target and is used by xargo to build the sysroot of the SGX target.
   [https://github.com/apache/incubator-teaclave-sgx-sdk/blob/master/xargo/x86_64-unknown-linux-sgx.json#L6](url)
   [https://github.com/japaric/xargo#compiling-the-sysroot-for-a-custom-target](url)
   
   `#[cfg(not(target_env = "sgx"))]`
   Use `cfg` to check if your enclave is being compiled with the sysroot of the SGX target.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave-sgx-sdk] clangenb commented on issue #345: Intuition behind cargo config flags and cargo attributes.

Posted by GitBox <gi...@apache.org>.
clangenb commented on issue #345:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/345#issuecomment-869110521


   Thank you very much. Your explanation and links made it much more clear for me. 👍 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org