Skip to content

Commit

Permalink
Fix the code to move the dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingosse committed Nov 30, 2023
1 parent 9a1947c commit c838d83
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tracer/build/_build/Build.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2712,23 +2712,27 @@ private void CopyDumpsToBuildData()

private void CopyDumpsTo(AbsolutePath root)
{
var dumpFolder = root / "dumps";

if (Directory.Exists(TempDirectory))
{
foreach (var dump in GlobFiles(TempDirectory, "coredump*", "*.dmp"))
{
Logger.Information("Moving file '{Dump}' to '{Root}'", dump, root / "dumps");
Logger.Information("Moving file '{Dump}' to '{Root}'", dump, dumpFolder);

MoveFileToDirectory(dump, root / "dumps", FileExistsPolicy.Overwrite);
MoveFileToDirectory(dump, dumpFolder, FileExistsPolicy.Overwrite);
}
}
else
{
Logger.Warning("TempDirectory '{TempDirectory}' does not exist, skipping dump copy", TempDirectory);
}

foreach (var file in Directory.EnumerateFiles(TracerDirectory, "*.dmp", SearchOption.AllDirectories))
{
CopyFileToDirectory(file, root, FileExistsPolicy.OverwriteIfNewer);
if (Path.GetDirectoryName(file) == dumpFolder)
{
// The dump is already in the right location
continue;
}

CopyFileToDirectory(file, dumpFolder, FileExistsPolicy.OverwriteIfNewer);
}
}

Expand Down

0 comments on commit c838d83

Please sign in to comment.