-
Notifications
You must be signed in to change notification settings - Fork 331
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
Fix executable bitness for testhost.x86 #4652
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad999af
No binlog from Test.cmd -integrationTest
nohwnd 7aaa654
Fix plat, first part
nohwnd b018dce
Fix plat part 2
nohwnd 586b21a
exclude prefer32bit because of source build
nohwnd 77331b6
Update src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj
nohwnd 9b2fc9c
Ignore sdk1201 error
nohwnd 23e796d
Add x86 dotnet in Build for Acceptance tests
nohwnd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Get-ChildItem S:\p\vstest3\artifacts\packages\Debug\Shipping -Filter vstest.console.exe -Recurse -Force | ForEach-Object { | ||
if ($_.VersionInfo.ProductVersion.Contains("+")) { | ||
throw "Some files contain '+' in the ProductVersion, this breaks DTAAgent in AzDO." | ||
} | ||
else { | ||
"$_ version $($_.VersionInfo.ProductVersion) is ok." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
$exclusions = @{ | ||
"CodeCoverage\CodeCoverage.exe" = "x86" | ||
"Dynamic Code Coverage Tools\CodeCoverage.exe" = "x86" | ||
"amd64\CodeCoverage.exe" = "x64" | ||
|
||
"IntelliTrace.exe" = "x86" | ||
"ProcessSnapshotCleanup.exe" = "x86-64" | ||
"TDEnvCleanup.exe" = "x86" | ||
|
||
"TestPlatform\SettingsMigrator.exe" = "x86" | ||
|
||
"dump\DumpMinitool.exe" = "x86-64" | ||
|
||
"QTAgent32.exe" = "x86" | ||
"QTAgent32_35.exe" = "x86" | ||
"QTAgent32_40.exe" = "x86" | ||
"QTDCAgent32.exe" = "x86" | ||
|
||
"V1\VSTestVideoRecorder.exe" = "x86" | ||
"VideoRecorder\VSTestVideoRecorder.exe" = "x86" | ||
} | ||
|
||
$errs = @() | ||
Get-ChildItem S:\p\vstest3\artifacts\packages\Debug\Shipping -Filter *.exe -Recurse -Force | ForEach-Object { | ||
nohwnd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
$m = & "C:\Program Files\Microsoft Visual Studio\2022\IntPreview\VC\Tools\MSVC\14.38.32919\bin\HostX86\x86\dumpbin.exe" /headers $_.FullName | Select-String "machine \((.*)\)" | ||
nohwnd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (-not $m.Matches.Success) { | ||
$err = "Did not find the platform of the exe $fullName)." | ||
} | ||
|
||
$platform = $m.Matches.Groups[1].Value | ||
$fullName = $_.FullName | ||
$name = $_.Name | ||
|
||
if ("x86" -eq $platform) { | ||
$corFlags = "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\CorFlags.exe" | ||
nohwnd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
$corFlagsOutput = & $corFlags $fullName | ||
# this is an native x86 exe or a .net x86 that requires of prefers 32bit | ||
$platform = if ($corFlagsOutput -like "*does not have a valid managed header*" -or $corFlagsOutput -like "*32BITREQ : 1*" -or $corFlagsOutput -like "*32BITPREF : 1*") { | ||
# this is an native x86 exe or a .net x86 that requires of prefers 32bit | ||
"x86" } else { | ||
# this is a x86 executable that is built as AnyCpu and does not prefer 32-bit so it will run as x64 on 64-bit system. | ||
"x86-64" } | ||
} | ||
|
||
if (($pair = $exclusions.GetEnumerator() | Where-Object { $fullName -like "*$($_.Name)" })) { | ||
if (1 -lt $($pair).Count) { | ||
$err = "Too many paths matched the query, only one match is allowed. Matches: $($pair.Name)" | ||
$errs += $err | ||
Write-Host -ForegroundColor Red Error: $err | ||
} | ||
|
||
if ($platform -ne $pair.Value) { | ||
$err = "$fullName must have architecture $($pair.Value), but it was $platform." | ||
$errs += $err | ||
Write-Host -ForegroundColor Red Error: $err | ||
} | ||
} | ||
elseif ("x86" -eq $platform) { | ||
if ($name -notlike "*x86*") { | ||
$err = "$fullName has architecture $platform, and must contain x86 in the name of the executable." | ||
$errs += $err | ||
Write-Host -ForegroundColor Red Error: $err | ||
} | ||
} | ||
elseif ($platform -in "x64", "x86-64") { | ||
if ($name -like "*x86*" -or $name -like "*arm64*") { | ||
$err = "$fullName has architecture $platform, and must NOT contain x86 or arm64 in the name of the executable." | ||
$errs += $err | ||
Write-Host -ForegroundColor Red Error: $err | ||
} | ||
} | ||
elseif ("arm64" -eq $platform) { | ||
if ($name -notlike "*arm64*") { | ||
$err = "$fullName has architecture $platform, and must contain arm64 in the name of the executable." | ||
$errs += $err | ||
Write-Host -ForegroundColor Red Error: $err | ||
} | ||
} | ||
else { | ||
$err = "$fullName has unknown architecture $platform." | ||
$errs += $err | ||
Write-Host -ForegroundColor Red $err | ||
} | ||
|
||
"Success: $name is $platform - $fullName" | ||
} | ||
|
||
if ($errs) { | ||
throw "Fail!:`n$($errs -join "`n")" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Isn't this path linked to your machine setup?
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.
Yes I am aware of that, answer to all the same questions below is in the PR description. I just did not want to lose that code.