Initial commit
This commit is contained in:
23
.devcontainer/Dockerfile
Normal file
23
.devcontainer/Dockerfile
Normal file
@@ -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/*
|
||||
14
.devcontainer/devcontainer.json
Normal file
14
.devcontainer/devcontainer.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
3
.devcontainer/settings.vscode.json
Normal file
3
.devcontainer/settings.vscode.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"lldb.executable": "/usr/bin/lldb-3.9"
|
||||
}
|
||||
23
.vscode/launch.json
vendored
Normal file
23
.vscode/launch.json
vendored
Normal file
@@ -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": []
|
||||
}
|
||||
]
|
||||
}
|
||||
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"search.exclude": {
|
||||
"**/target": true
|
||||
},
|
||||
"lldb.verboseLogging": true
|
||||
}
|
||||
6
Cargo.lock
generated
Normal file
6
Cargo.lock
generated
Normal file
@@ -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"
|
||||
|
||||
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "hello_remote_world"
|
||||
version = "0.1.0"
|
||||
authors = ["VS Code <vscode@microsoft.com>"]
|
||||
|
||||
[[bin]]
|
||||
name = "hello_remote_world"
|
||||
path = "main.rs"
|
||||
41
README.md
41
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 <kbd>F1</kbd> 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 <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>\`</kbd> 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 <kbd>F5</kbd> 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.<br />
|
||||
Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
9
main.rs
Normal file
9
main.rs
Normal file
@@ -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);
|
||||
}
|
||||
1
target/.rustc_info.json
Normal file
1
target/.rustc_info.json
Normal file
@@ -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":{}}
|
||||
1
target/rls/.rustc_info.json
Normal file
1
target/rls/.rustc_info.json
Normal file
@@ -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":{}}
|
||||
Reference in New Issue
Block a user