diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0b002dabd..fd6aa78f7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -59,5 +59,6 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ && rustup target add x86_64-unknown-linux-gnu \ && rustup target add x86_64-unknown-none \ && rustup target add x86_64-pc-windows-msvc \ + && rustup toolchain add nightly-x86_64-unknown-linux-gnu \ && cargo install just diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d76b29854..ebfed8c51 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,7 +27,12 @@ "ms-vscode.cmake-tools", "rust-lang.rust-analyzer", "vadimcn.vscode-lldb" - ] + ], + "settings": { + "rust-analyzer.rustfmt.extraArgs": [ + "+nightly" // required for rustfmt.toml which uses nightly features + ] + } } } } diff --git a/.gitignore b/.gitignore index 1e3a46904..11a19ba7b 100644 --- a/.gitignore +++ b/.gitignore @@ -448,10 +448,6 @@ $RECYCLE.BIN/ ## Visual Studio Code ## .vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json /downloads diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index a3b24b8c9..000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "lldb", - "request": "attach", - "name": "Attach LLDB", - "pid": "${command:pickMyProcess}" // use ${command:pickProcess} to pick other users' processes - }, - // Use this to debug a test build with release optimizations - { - "type": "lldb", - "request": "launch", - "name": "Cargo test", - "cargo": { - "args": [ - "test", - "--profile=release-with-debug", - "--lib", - "--no-run", - ], - "filter": { - "name": "hyperlight_host", - "kind": "lib" - } - }, - "args": ["sandbox::initialized_single_use::tests"] - }, - { - "type": "lldb", - "request": "launch", - "name": "Cargo debug integration_test", - "env": {"GUEST": "c"}, - "cargo": { - "args": [ - "test", - "--profile=dev", - "--no-run", - ], - "filter": { - "name": "sandbox_host_tests", - } - }, - "args": ["--exact", "float_roundtrip"] // the specific test to run - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index c32b44ebc..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "files.associations": { - "*.h": "c", -}, - "rust-analyzer.showUnlinkedFileNotification": false, - "rust-analyzer.linkedProjects": [ - "Cargo.toml", - "src/hyperlight_host/Cargo.toml", - "src/hyperlight_guest/Cargo.toml", - "src/hyperlight_testing/Cargo.toml", - "src/hyperlight_common/Cargo.toml", - "src/hyperlight_guest_capi/Cargo.toml", - "src/tests/rust_guests/dummyguest/Cargo.toml", - "src/tests/rust_guests/simpleguest/Cargo.toml", - "src/tests/rust_guests/callbackguest/Cargo.toml" - ], - "rust-analyzer.rustfmt.extraArgs": [ - "+nightly" // required for rustfmt.toml which uses nightly features - ], - "githubPullRequests.ignoredPullRequestBranches": [ - "dev" - ] -} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67a51168a..05a167088 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,6 +38,7 @@ All contributions come through pull requests. To submit a proposed change, we re #### Use work-in-progress PRs for early feedback A good way to communicate before investing too much time is to create a "Work-in-progress" PR and share it with your reviewers. The standard way of doing this is to add a "[WIP]" prefix in your PR's title and open the pull request as a draft. + ### Developer Certificate of Origin: Signing your work #### Every commit needs to be signed @@ -82,3 +83,7 @@ git push --force-with-lease ``` *Credit: This doc was cribbed from Dapr.* + +### Rust Analyzer + +If you are using the [Rust Analyzer](https://rust-analyzer.github.io/manual.html) then you may need to set the configuration option `rust-analyzer.rustfmt.extraArgs` to `["+nightly"]` to ensure that formatting works correctly as this project has a [`rustfmt.toml`](./rustfmt.toml) file that uses nightly features.