From a1678c16d6da90f9f10065727d486f51adc51bcd Mon Sep 17 00:00:00 2001 From: Max Charlamb Date: Mon, 30 Mar 2026 18:24:06 -0400 Subject: [PATCH] Fix MSBuild encoding and capture archive exit code in Helix commands - Escape \True as %24%3F to avoid MSBuild wildcard expansion in Include attributes (matching helixpublishwitharcade.proj encoding conventions) - Capture archive_exit_code after tar on both platforms - Combine exit codes: test failure takes priority, else archive failure (matching helixpublishwitharcade.proj result_exit_code pattern) - Escape \/\/\ as %24 for consistency with helixpublishwitharcade.proj Follow-up to #126207. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../cdac/tests/DumpTests/cdac-dump-helix.proj | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj index cb0702d762d63d..8b511d859801fc 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj @@ -176,25 +176,44 @@ <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="set test_exit_code=%25ERRORLEVEL%25" /> <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" - Include="test_exit_code=$?" /> + Include="test_exit_code=%24%3F" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="tar -czf %25HELIX_WORKITEM_UPLOAD_ROOT%25\dumps.tar.gz -C %25HELIX_WORKITEM_PAYLOAD%25\dumps ." /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="set archive_exit_code=%25ERRORLEVEL%25" /> <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" Include="tar -czf $HELIX_WORKITEM_UPLOAD_ROOT/dumps.tar.gz -C $HELIX_WORKITEM_PAYLOAD/dumps ." /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="archive_exit_code=%24%3F" /> - + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" - Include="%25ComSpec%25 /C exit %25test_exit_code%25" /> + Include="set result_exit_code=0" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="if %25archive_exit_code%25 NEQ 0 set result_exit_code=%25archive_exit_code%25" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="if %25test_exit_code%25 NEQ 0 set result_exit_code=%25test_exit_code%25" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="%25ComSpec%25 /C exit %25result_exit_code%25" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="result_exit_code=0" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="if [ %24archive_exit_code -ne 0 ]%3B then result_exit_code=%24archive_exit_code%3B fi" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="if [ %24test_exit_code -ne 0 ]%3B then result_exit_code=%24test_exit_code%3B fi" /> <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" Include="set_return() { return $1%3B }" /> <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" - Include="set_return $test_exit_code" /> + Include="set_return %24result_exit_code" />