-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Guide: Developing Vector on Windows on AWS
This is a brief guide to developing Vector on Windows via an EC2 Windows VM.
The CI that builds Vector on Windows uses the Github runner with the following installed software, this allows us to run unix commands and use the scripts in the scripts.
Note: The CI runs WSL, it won't be possible to run WSL in EC2 since EC2 itself is a Virtual Machine
Note: It may be possible to set the git bash path to $env:PATH to continue with this AWS setup
- Create an EC2 instance with Windows server 2019 or 2022.
- A t2.2xlarge with at least 120gb storage works well.
- You will need to use Remote Desktop to connect to the machine.
- Assign a keypair to the instance which you can use to decrypt the RDP Administrator password.
-
Install Microsoft C++ Build Tools from here: Microsoft C++ Build Tools - Visual Studio
- Select Desktop Development with C++.
- From Individual Components select C++ Clang compiler for Windows.
- From Individual Components select MSBuild support for LLVM (clang-cl) toolset. This may get more than you need, but it works.
-
To install Rust, install
rustup-init.exe
from:- rustup.rs - The Rust toolchain installer
- You may need to select "See all available versions" and use the exe for the architecture you are running on 64bit or 32bit
-
Install git from Git - Downloading Package
-
Install chocolatey by pasting this into a PowerShell terminal:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
-
Install
cmake
from Download -
Install
perl
from Strawberry Perl for Windows -
Git clone the Vector project (using git bash). In a PowerShell window, cd to the Vector folder and run:
.\scripts\environment\bootstrap-windows-2019.ps1
Note: You will get some errors about FilePath being null. This doesn’t seem to stop things working.
Since we are building Vector on Windows we must use the appropriate feature set
cargo build --no-default-features --features default-msvc
, cargo test
, cargo check
should now work.
Note: If having errors with Building, see 2022 Build Tools Path Update for troubleshooting
When using Microsoft Visual Studio Build Tools 2022 it seems like the PATH is not properly updated. You may want to try the below commands in PowerShell:
-
Open PowerShell with Administrator Privileges
-
Set the environment variables to use the BuildTools PATH
cmd.exe /c "`"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat`" && set"
- Set the LLVM and Clang PATH
$env:PATH += ";C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin"
Install the below extensions
-
CodeLLDB (vadimcn.vscode-lldb)
-
Rust-Analyzer (rust-lang.rust-analyzer)
-
crates (serayuzgur.crates)
-
Better TOML (bungcip.better-toml)
Rust analyzer will not function properly since it will not use the correct feature set.
- Press Ctrl + Shift + P and open User Settings (JSON)
- Paste the below settings for Rust-Analyzer:
"rust-analyzer.cargo.noDefaultFeatures": true,
"rust-analyzer.cargo.features": [
"default-msvc"
]