Skip to content
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

Print unique set of PDBs to a text file #4332

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

kythant
Copy link
Contributor

@kythant kythant commented Apr 11, 2024

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@kythant
Copy link
Contributor Author

kythant commented Apr 11, 2024

/azp run

Copy link

Azure Pipelines failed to run 1 pipeline(s).

@kythant
Copy link
Contributor Author

kythant commented Apr 11, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

{
Write-Host $value
}
New-Item "$(ob_outputDirectory)\pdbs.txt" -Force
Copy link
Member

Choose a reason for hiding this comment

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

What is 'ob'?

Copy link
Member

@DrusTheAxe DrusTheAxe left a comment

Choose a reason for hiding this comment

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

Some minor suggestions

$pdbSet = @{}
$inputPath = "$(Build.ArtifactStagingDirectory)\symbols"
Get-ChildItem *.pdb -Path $inputPath -Recurse | foreach-object {
$pdbSet[$_.Name] = $true
Copy link
Member

Choose a reason for hiding this comment

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

You're using hashset as a dynamically growable collection? Since you don't care about the value $null would be slightly prefereable to $true

Write-Host $value
}
New-Item "$(ob_outputDirectory)\pdbs.txt" -Force
$pdbSet.Keys | Out-File "$(ob_outputDirectory)\pdbs.txt"
Copy link
Member

Choose a reason for hiding this comment

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

You can replace lines 164-165 with the simpler

$pdbSet.Keys | Set-Content -Path "$(ob_outputDirectory)\pdbs.txt" -Force

You can also control encoding if need be (see other Set-Content uses across the repo for examples)

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

Successfully merging this pull request may close these issues.

4 participants