Skip to content

Fix test target deployment directories#8552

Open
bschnurr wants to merge 1 commit into
microsoft:mainfrom
bschnurr:fix-deploy-test-targets-python-tools
Open

Fix test target deployment directories#8552
bschnurr wants to merge 1 commit into
microsoft:mainfrom
bschnurr:fix-deploy-test-targets-python-tools

Conversation

@bschnurr

Copy link
Copy Markdown
Member

Summary

  • create missing MSBuild Python Tools target directory before copying test targets
  • fix delayed expansion in the VC Debug Launcher copy block so it uses the VC target path
  • report copy/directory failures and return non-zero on deployment failure

Validation

  • Ran Python\Prerequisites\deploy_test_targets.cmd against a temporary fake VS install with v18.0; copied 4 Python targets and 3 Win32/3 X64 VC launcher files.

Ensure deploy_test_targets.cmd creates the Python Tools target directory before copying targets and reports failures instead of continuing after missing paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bschnurr bschnurr requested a review from a team as a code owner June 16, 2026 17:35
@sonarqubecloud

Copy link
Copy Markdown

@bschnurr

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@rchiodo rchiodo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

if errorlevel 1 set "_DEPLOY_FAILED=1"
)

pause

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pause runs before if defined _DEPLOY_FAILED exit /B 1, so any non-interactive/CI caller hangs forever waiting for a keystroke — making the PR's new non-zero exit codes unreachable in exactly the automation context they're meant for. Consider gating it behind interactivity (e.g. if /I not "%CI%"=="1" pause). Pre-existing, but it directly undermines this PR's goal.

echo to !TARGET!
robocopy /E /XO Win32 "!TARGET!\Win32" *.* >nul
if errorlevel 8 (
echo [ERROR] Failed to copy Win32 VC Debug Launcher targets to !TARGET!\Win32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty source Win32/x64 directory makes robocopy /E /XO return 0, which passes the if errorlevel 8 gate; the script then emits [WARN] ... missing with Win32=0 but still exit /B 0. Given the PR's "report failures" intent, a zero-file deploy reported as success is indistinguishable from a real one. Consider tying _VC_W32_COUNT==0 / _VC_X64_COUNT==0 to a non-zero result, unless some toolsets legitimately have no launcher files.

@rchiodo

rchiodo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Solid hardening of the deploy script (directory creation, delayed-expansion fix, failure reporting). Two non-blocking warnings worth a look around the pause/exit ordering and the empty-source robocopy success case.

@rchiodo rchiodo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@rchiodo rchiodo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants