Skip to content

Guide: Developing Vector on Windows on AWS

Jonathan Padilla edited this page Mar 23, 2023 · 15 revisions

This is a brief guide to developing Vector on Windows via an EC2 Windows VM.

Set up AWS Instance

  • 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.

Set up Developer Environment

  1. Install Microsoft C++ Build Tools from here:

  2. Select Desktop Development with C++, also select CLang. This may get more than you need, but it works.

  3. To install Rust, install rustup-init.exe from:

  4. Install git from Git - Downloading Package

  5. 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'))
  1. Install cmake from Download

  2. Install perl from Strawberry Perl for Windows

  3. 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.

Build

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 issues with Building see 2022 Build Tools Path Update for troubleshooting


2022 Build Tools Path Update

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:

  1. Open PowerShell with Administrator Privileges

  2. 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"
  1. Set the LLVM and Clang PATH
$env:PATH += ";C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin"

Visual Studio Code Set up

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.

  1. Press Ctrl + Shift + P and open User Settings (JSON)
  2. Paste the below settings for Rust-Analyzer:
"rust-analyzer.cargo.noDefaultFeatures": true,
    "rust-analyzer.cargo.features": [
        "default-msvc"
    ]
Clone this wiki locally