This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git


The following commit(s) were added to refs/heads/master by this push:
     new d9f91f1  Add development tips to use IDEs (RLS/rust-analyzer) (#355)
d9f91f1 is described below

commit d9f91f169338b9ddb2da7ddd3e00ffccc6fe33fc
Author: Mingshen Sun <[email protected]>
AuthorDate: Mon Jun 15 18:54:58 2020 -0700

    Add development tips to use IDEs (RLS/rust-analyzer) (#355)
---
 .gitignore                               |  1 +
 README.md                                |  5 +++++
 cmake/tomls/Cargo.sgx_trusted_lib.toml   |  2 ++
 cmake/tomls/Cargo.sgx_untrusted_app.toml |  2 ++
 docs/README.md                           |  1 +
 docs/development-tips.md                 | 29 +++++++++++++++++++++++++++++
 6 files changed, 40 insertions(+)

diff --git a/.gitignore b/.gitignore
index 1426c42..91d66ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ cov_report
 # ignore the build dir which usually for cmake
 /build
 /release
+/Cargo.toml
diff --git a/README.md b/README.md
index 907733d..ab9aae5 100644
--- a/README.md
+++ b/README.md
@@ -44,6 +44,11 @@ platform, making computation on privacy-sensitive data safe 
and simple.
 - [Access Control](docs/access-control.md)
 - [Build System](docs/build-system.md)
 
+### Contribute to Teaclave
+
+- [Rust Development Guideline](docs/rust-guideline.md)
+- [Development Tips](docs/development-tips.md)
+
 ### Codebase
 
 - [Attestation](attestation)
diff --git a/cmake/tomls/Cargo.sgx_trusted_lib.toml 
b/cmake/tomls/Cargo.sgx_trusted_lib.toml
index 1eab052..959603e 100644
--- a/cmake/tomls/Cargo.sgx_trusted_lib.toml
+++ b/cmake/tomls/Cargo.sgx_trusted_lib.toml
@@ -33,6 +33,7 @@ sgx_tstd          = { git = 
"https://github.com/apache/teaclave-sgx-sdk";, rev =
 # sgx_tunittest     = { git = "https://github.com/apache/teaclave-sgx-sdk";, 
rev = "v1.1.2" }
 sgx_types         = { git = "https://github.com/apache/teaclave-sgx-sdk";, rev 
= "v1.1.2" }
 sgx_unwind        = { git = "https://github.com/apache/teaclave-sgx-sdk";, rev 
= "v1.1.2" }
+sgx_urts          = { git = "https://github.com/apache/teaclave-sgx-sdk";, rev 
= "v1.1.2" }
 
 # SGX crates
 # adler32           = { git = 
"https://github.com/mesalock-linux/adler32-rs-sgx"; }
@@ -46,6 +47,7 @@ chrono            = { git = 
"https://github.com/mesalock-linux/chrono-sgx"; }
 # deflate           = { git = 
"https://github.com/mesalock-linux/deflate-rs-sgx";, branch = "dev" }
 gbdt              = { git = "https://github.com/mesalock-linux/gbdt-rs";, 
branch = "mesatee-sgx" }
 getrandom         = { git = "https://github.com/mesalock-linux/getrandom-sgx"; }
+crc               = { git = "https://github.com/mesalock-linux/crc-rs-sgx"; }
 # gif               = { git = 
"https://github.com/mesalock-linux/image-gif-sgx"; }
 # image             = { git = "https://github.com/mesalock-linux/image-sgx"; }
 # inflate           = { git = "https://github.com/mesalock-linux/inflate-sgx"; }
diff --git a/cmake/tomls/Cargo.sgx_untrusted_app.toml 
b/cmake/tomls/Cargo.sgx_untrusted_app.toml
index 17a22f1..21fe9b3 100644
--- a/cmake/tomls/Cargo.sgx_untrusted_app.toml
+++ b/cmake/tomls/Cargo.sgx_untrusted_app.toml
@@ -20,3 +20,5 @@ exclude = [
 # We cannot remove these crates, because proto crates depend on them
 sgx_urts = { git = "https://github.com/apache/teaclave-sgx-sdk";, rev = 
"v1.1.2" }
 sgx_types = { git = "https://github.com/apache/teaclave-sgx-sdk";, rev = 
"v1.1.2" }
+sgx_tstd = { git = "https://github.com/apache/teaclave-sgx-sdk";, rev = 
"v1.1.2" }
+sgx_trts = { git = "https://github.com/apache/teaclave-sgx-sdk";, rev = 
"v1.1.2" }
diff --git a/docs/README.md b/docs/README.md
index c1b8789..ef5a1e7 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -10,4 +10,5 @@ permalink: /docs/
 - [Mutual Attestation: Why and How](mutual-attestation.md)
 - [My First Function](my-first-function.md)
 - [Rust Development Guideline](rust-guideline.md)
+- [Development Tips](development-tips.md)
 - [Threat Model](threat-model.md)
diff --git a/docs/development-tips.md b/docs/development-tips.md
new file mode 100644
index 0000000..7e8d921
--- /dev/null
+++ b/docs/development-tips.md
@@ -0,0 +1,29 @@
+---
+permalink: /docs/development-tips
+---
+
+# Development Tips
+
+## RLS/rust-analyzer and IDEs
+
+The most common question on developing Teaclave is how to use Rust IDEs to
+improve help the development, e.g., code completions, type hints and cross
+references. Internally, these features are supported by either
+[RLS](https://github.com/rust-lang/rls) or
+[rust-analyzer](https://github.com/rust-analyzer/rust-analyzer). Unfortunately,
+these features are not supported in Teaclave's codebase out-of-box.
+The reason is that Teaclave has components targeting different environments 
(SGX
+enclave and Linux app) which need different set of dependencies (SGX crates and
+vanilla crates). To support this flexible building and linking process, we are
+using cmake for our [build system](build-system.md). However, there are still
+ways to workaround and let the analyzer understand the project structures.
+
+When developing SGX enclaves and corresponding dependent crates, you need to
+prepare a `Cargo.toml` in the root directory to help the analyzer. This
+`Cargo.toml` file can be copied from our build system:
+`cmake/tomls/Cargo.sgx_trusted_lib.toml`. Similarly, when developing the app
+parts, you can copy the `cmake/tomls/Cargo.sgx_untrusted_lib.toml` file to the
+root directory as `Cargo.toml`. For standalone Rust applications such as CLI, 
no
+`Cargo.toml` is needed. After the preparation of `Cargo.toml` in root,
+RLS/rust-analyzer can understand the projects finally. You will see type hints
+and cross references using IDEs with extensions.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to