Uh oh!
There was an error while loading. Please reload this page.
vcperf chain command fix - #67
Conversation
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Updates the build-perf-cpp vcperf usage guidance to route invocation through cmd.exe and to prevent /stop from running when /start fails, improving correctness of exit-code handling for CLI agents.
Changes:
- Switches documented
vcperfinvocation from direct PowerShell (& $vcperf) tocmd.exe-mediated execution for more reliable exit codes. - Adds explicit gating so build +
/stoponly execute if/startsucceeds, while still allowing/stopafter build failure when/startsucceeded. - Updates the permission grant + permission probe scripts to follow the new invocation/gating rules.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $buildExit = & { | ||
| & $vcperf /start /noadmin /level3 MySession | Out-Host | ||
| $startOutput = (& $env:ComSpec /d /c "`"$vcperf`" /start /noadmin /level3 MySession" 2>&1 | Out-String).Trim() |
| msbuild Project.sln /m /t:Rebuild /p:Configuration=Release | Out-Host | ||
| $exitCode = $LASTEXITCODE | ||
| & $vcperf /stop /templates MySession out.etl /jsonAnalysis out.json | Out-Host | ||
| & $env:ComSpec /d /c "`"$vcperf`" /stop /templates MySession `"out.etl`" /jsonAnalysis `"out.json`"" | Out-Host |
| ```powershell | ||
| $buildExit = & { | ||
| & $vcperf /start /noadmin /level3 MySession | Out-Host | ||
| $startOutput = (& $env:ComSpec /d /c "`"$vcperf`" /start /noadmin /level3 MySession" 2>&1 | Out-String).Trim() |
| cmake --build build --parallel | Out-Host | ||
| $exitCode = $LASTEXITCODE | ||
| } | ||
| & $env:ComSpec /d /c "`"$vcperf`" /stop /templates MySession `"out.etl`" /jsonAnalysis `"out.json`"" | Out-Host |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Modified vcperf invocation guidance in the build-perf-cpp skill so CLI agents can't chain commands in a way that runs
/stopwhen/startfailed.Changes to
SKILL.mdcmd.exe(& $env:ComSpec /d /c ...) instead of& $vcperfdirectly, so$LASTEXITCODEis reliable (direct PowerShell invocation can surface an internal COMHRESULTinstead of vcperf's true exit code)./start— the build,/stop, and/stopnoanalyzenever run unless/startreturned exit code0. After a successful start,/stopstill runs on build failure to preserve the partial trace.cmd.exewith real exit code), Step 4 (gated permission probe), and the MSBuild/CMake/cmd.exe workflow blocks accordingly.Mirrors the equivalent change in the agency plugin.