-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add posix dmp copy command #45704
base: release/9.0.2xx
Are you sure you want to change the base?
Add posix dmp copy command #45704
Conversation
This change is made to ensure compatibility with different operating systems, making sure that the hangdump.dmp file can be found and copied to the specified upload directory in various environments. Additionally, I noticed that there doesn't seem to be a command for clearing the NuGet cache in the POSIX Shell environment. Should we consider making some changes here? |
test/UnitTests.proj
Outdated
@@ -121,7 +121,8 @@ | |||
<HelixPreCommands Condition="!$(IsPosixShell)">call %HELIX_CORRELATION_PAYLOAD%\t\RunTestsOnHelix.cmd $(TestFullMSBuild);$(HelixPreCommands)</HelixPreCommands> | |||
<HelixPreCommands Condition="$(IsPosixShell)">. $HELIX_CORRELATION_PAYLOAD/t/RunTestsOnHelix.sh;$(HelixPreCommands)</HelixPreCommands> | |||
<HelixPostCommands Condition="!$(IsPosixShell)">PowerShell -ExecutionPolicy ByPass "dotnet nuget locals all -l | ForEach-Object { $_.Split(' ')[1]} | Where-Object{$_ -like '*cache'} | Get-ChildItem -Recurse -File -Filter '*.dat' | Measure";$(HelixPostCommands)</HelixPostCommands> | |||
<HelixPostCommands>PowerShell -ExecutionPolicy ByPass "Get-ChildItem -Recurse -File -Filter '*hangdump.dmp' | Copy-Item -Destination $env:HELIX_WORKITEM_UPLOAD_ROOT";$(HelixPostCommands)</HelixPostCommands> | |||
<HelixPostCommands Condition="!$(IsPosixShell)">PowerShell -ExecutionPolicy ByPass "Get-ChildItem -Recurse -File -Filter '*hangdump.dmp' | Copy-Item -Destination $env:HELIX_WORKITEM_UPLOAD_ROOT";$(HelixPostCommands)</HelixPostCommands> | |||
<HelixPostCommands Condition="$(IsPosixShell)">find . -name '*hangdump.dmp' -exec cp {} $HELIX_WORKITEM_UPLOAD_ROOT \%3B;$(HelixPostCommands)</HelixPostCommands> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote "$HELIX_WORKITEM_UPLOAD_ROOT" to prevent word splitting in the POSIX shell in case the value contains white space.
(Windows PowerShell doesn't word-split the unquoted $env:HELIX_WORKITEM_UPLOAD_ROOT, so this will be consistent with that.)
Are you referring to the line just above this with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have context as to why we need a different dmp copy command when we didnt before (assume that it was just never utilized on posix machines) or why we want these dmp files. But the overall components of the change look good to me.
Evidence that this seems to work:
This adds a line to a script to move dmps even on posix systems.