From 0207c629b917e5058f949f5fd534804db5065a42 Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Wed, 1 May 2019 13:00:29 -0700 Subject: [PATCH] Initial commit --- .devcontainer/Dockerfile | 23 +++++++++++++++++ .devcontainer/devcontainer.json | 14 ++++++++++ .devcontainer/settings.vscode.json | 3 +++ .vscode/launch.json | 23 +++++++++++++++++ .vscode/settings.json | 6 +++++ Cargo.lock | 6 +++++ Cargo.toml | 8 ++++++ README.md | 41 ++++++++++++++++++++++++++++-- main.rs | 9 +++++++ target/.rustc_info.json | 1 + target/rls/.rustc_info.json | 1 + 11 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/settings.vscode.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 main.rs create mode 100644 target/.rustc_info.json create mode 100644 target/rls/.rustc_info.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..3cd126c --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- + +FROM rust:1 + +# Copy endpoint specific user setting overrides into container +COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json + +RUN rustup update +RUN rustup component add rls rust-analysis rust-src + +# Install git, process tools +RUN apt-get update && apt-get -y install git procps + +# Install other dependencies +RUN apt-get install -y lldb-3.9 + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..d81b282 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,14 @@ +{ + "name": "Rust", + "dockerFile": "Dockerfile", + "extensions": [ + "rust-lang.rust", + "bungcip.better-toml", + "vadimcn.vscode-lldb" + ], + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ] +} \ No newline at end of file diff --git a/.devcontainer/settings.vscode.json b/.devcontainer/settings.vscode.json new file mode 100644 index 0000000..746a7be --- /dev/null +++ b/.devcontainer/settings.vscode.json @@ -0,0 +1,3 @@ +{ + "lldb.executable": "/usr/bin/lldb-3.9" +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f74c15a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ + +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug executable", + "cargo": { + "args": [ + "build", + "--bin=hello_remote_world", + "--package=hello_remote_world", + "--manifest-path=Cargo.toml" + ], + "filter": { + "kind": "bin" + } + }, + "args": [] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..80af8ee --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "search.exclude": { + "**/target": true + }, + "lldb.verboseLogging": true +} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..a01e704 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_remote_world" +version = "0.1.0" + diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..82bf78b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "hello_remote_world" +version = "0.1.0" +authors = ["VS Code "] + +[[bin]] +name = "hello_remote_world" +path = "main.rs" \ No newline at end of file diff --git a/README.md b/README.md index 29f7ebd..6c12ebc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,39 @@ +# Try Out Development Containers: Rust -# Contributing +This is a sample project that lets you try out the **[VS Code Remote - Containers](https://aka.ms/vscode-remote/containers)** extension in a few easy steps. -This project welcomes contributions and suggestions. Most contributions require you to agree to a +> **Note:** If you're following the quick start, you can jump to the [Things to try](#things-to-try) section. + +## Setting up the development container + +Follow these steps to open this sample in a container: + +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started). + +2. If you're not yet in a development container: + - Clone this repository. + - Press F1 and select the **Remote-Container: Open Folder in Container...** command. + - Select the cloned copy of this folder, wait for the container to start, and try things out! + +## Things to try + +Once you have this sample opened in a container, you'll be able to work with it like you would locally. + +Some things to try: + +1. **Edit:** + - Open `main.rs` + - Try adding some code and check out the language features. +1. **Terminal:** Press ctrl+shift+\` and type `uname` and other Linux commands from the terminal window. +1. **Build, Run, and Debug:** + - Open `main.rs` + - Add a breakpoint (e.g. on line 8). + - Press F5 to launch the app in the container. + - Once the breakpoint is hit, try hovering over variables, examining locals, and more. + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -12,3 +44,8 @@ provided by the bot. You will only need to do this once across all repos using o This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## License + +Copyright © Microsoft Corporation All rights reserved.
+Licensed under the MIT License. See LICENSE in the project root for license information. \ No newline at end of file diff --git a/main.rs b/main.rs new file mode 100644 index 0000000..9151108 --- /dev/null +++ b/main.rs @@ -0,0 +1,9 @@ +/*-------------------------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. + *-------------------------------------------------------------------------------------------------------------*/ + +fn main() { + let name = "VS Code Remote - Containers"; + println!("Hello, {}!", name); +} \ No newline at end of file diff --git a/target/.rustc_info.json b/target/.rustc_info.json new file mode 100644 index 0000000..59899ea --- /dev/null +++ b/target/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":17875471065296811878,"outputs":{"15337506775154344876":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr/local/rustup/toolchains/1.34.1-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""],"1164083562126845933":["rustc 1.34.1 (fc50f328b 2019-04-24)\nbinary: rustc\ncommit-hash: fc50f328b0353b285421b8ff5d4100966387a997\ncommit-date: 2019-04-24\nhost: x86_64-unknown-linux-gnu\nrelease: 1.34.1\nLLVM version: 8.0\n",""],"1617349019360157463":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr/local/rustup/toolchains/1.34.1-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""]},"successes":{}} \ No newline at end of file diff --git a/target/rls/.rustc_info.json b/target/rls/.rustc_info.json new file mode 100644 index 0000000..e9ae1fe --- /dev/null +++ b/target/rls/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":17875471065296811878,"outputs":{"1164083562126845933":["rustc 1.34.1 (fc50f328b 2019-04-24)\nbinary: rustc\ncommit-hash: fc50f328b0353b285421b8ff5d4100966387a997\ncommit-date: 2019-04-24\nhost: x86_64-unknown-linux-gnu\nrelease: 1.34.1\nLLVM version: 8.0\n",""],"15337506775154344876":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr/local/rustup/toolchains/1.34.1-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""],"1617349019360157463":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr/local/rustup/toolchains/1.34.1-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""]},"successes":{}} \ No newline at end of file