-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add development tips to use IDEs (RLS/rust-analyzer) (#355)
- Loading branch information
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ cov_report | |
# ignore the build dir which usually for cmake | ||
/build | ||
/release | ||
/Cargo.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |