1 Answer
- Newest
- Most votes
- Most comments
0
I found that this is caused by a behavior of CodeBuild when running on Windows. The behavior is that Codebuild invokes a brand new process for every line that starts with '-' in the buildspec.
This appears to be an undocumented defect in codebuild that was confirmed by an AWS support engineer.
Your updated buildspec would be:
version: 0.2
env:
shell: powershell.exe
phases:
build:
commands:
- |
Write-Host "env:Path before..."
Write-Host "$env:Path"
Write-Host "Installing required tools..."
Invoke-WebRequest -Uri https://win.rustup.rs/ -OutFile rustup-init.exe
./rustup-init.exe -y
Write-Host "env:Path after"
Write-Host "$env:Path"
cargo -V
answered 18 days ago
Relevant content
- asked 5 years ago
- Accepted Answerasked 2 years ago
- asked 5 months ago
- asked 5 years ago
- AWS OFFICIALUpdated 4 months ago