From ad999afac9e973598a4e971460b7350e87803114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 10 Aug 2023 17:24:52 +0200 Subject: [PATCH 1/7] No binlog from Test.cmd -integrationTest --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index adfbd55221..2950efc899 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -156,9 +156,11 @@ stages: displayName: Build # -ci is allowing to import some environment variables and some required configurations + # -nobl avoid overwriting binlog of the main Build - script: Test.cmd -configuration $(_BuildConfig) -ci + -nobl -integrationTest -performanceTest name: Test From 7aaa65463ce7eb5cccf98102c6c91d578f258237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Fri, 11 Aug 2023 16:05:25 +0200 Subject: [PATCH 2/7] Fix plat, first part --- azure-pipelines.yml | 3 +++ src/testhost.x86/testhost.x86.csproj | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2950efc899..4b4f0ab6d5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -91,6 +91,8 @@ variables: - name: VisualStudioDropName value: Products/$(System.TeamProject)/$(Build.DefinitionName)/$(Build.SourceBranchName)/$(Build.BuildNumber) - name: _InternalBuildArgs + # IncludeSourceRevisionInInformationalVersion prevents ProductVersion (on file), and AssemblyInformationalVersion + # from appending +, which breaks DTAAgent. value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) /p:DotNetFinalVersionKind=$(_ReleaseVersionKind) @@ -100,6 +102,7 @@ variables: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) /p:VisualStudioDropName=$(VisualStudioDropName) /p:GenerateSbom=true + /p:IncludeSourceRevisionInInformationalVersion=false stages: diff --git a/src/testhost.x86/testhost.x86.csproj b/src/testhost.x86/testhost.x86.csproj index e4be8c838c..80aed5f538 100644 --- a/src/testhost.x86/testhost.x86.csproj +++ b/src/testhost.x86/testhost.x86.csproj @@ -12,13 +12,13 @@ testhost.x86 net7.0;$(NetCoreAppMinimum);$(NetFrameworkMinimum);net47;net471;net472;net48 AnyCPU - true + win7-x86 + true Exe false app.manifest - win7-x86 false $(AssemblyName.Replace('.x86', '')).$(TargetFramework).x86 From b018dced9dcdfa5aad738ae8994f0def94dc0fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Fri, 11 Aug 2023 17:03:24 +0200 Subject: [PATCH 3/7] Fix plat part 2 --- eng/verify-nupkgs-exe.ps1 | 90 +++++++++++++++++++ .../DumpMinitool.arm64.csproj | 4 +- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 eng/verify-nupkgs-exe.ps1 diff --git a/eng/verify-nupkgs-exe.ps1 b/eng/verify-nupkgs-exe.ps1 new file mode 100644 index 0000000000..459a4dcb43 --- /dev/null +++ b/eng/verify-nupkgs-exe.ps1 @@ -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 { + $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 \((.*)\)" + 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" + $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")" +} \ No newline at end of file diff --git a/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj b/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj index 772550f6a5..c43ea0e9be 100644 --- a/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj +++ b/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj @@ -3,11 +3,13 @@ net7.0;net6.0;$(NetFrameworkMinimum) - AnyCPU false Exe false win10-arm64 + + AnyCPU false true AnyCPU false From 9b2fc9cdc44154e785921c8f7528bc6dabb91d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Mon, 14 Aug 2023 11:03:30 +0200 Subject: [PATCH 6/7] Ignore sdk1201 error --- src/testhost.x86/testhost.x86.csproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/testhost.x86/testhost.x86.csproj b/src/testhost.x86/testhost.x86.csproj index ba2c9ff957..841fee658a 100644 --- a/src/testhost.x86/testhost.x86.csproj +++ b/src/testhost.x86/testhost.x86.csproj @@ -17,6 +17,13 @@ Exe false app.manifest + + NETSDK1201 + $(NoWarn);NETSDK1201 false From 23e796dfd9406b825131a93016ffac1751c70570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Mon, 14 Aug 2023 12:53:08 +0200 Subject: [PATCH 7/7] Add x86 dotnet in Build for Acceptance tests --- test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Build.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Build.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Build.cs index b751ccfc29..2f22dffdba 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Build.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Build.cs @@ -42,6 +42,7 @@ private static void SetDotnetEnvironment() #pragma warning disable RS0030 // Do not used banned APIs Environment.SetEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0"); Environment.SetEnvironmentVariable("DOTNET_ROOT", DotnetDir); + Environment.SetEnvironmentVariable("DOTNET_ROOT(x86)", Path.Combine(DotnetDir, "dotnet-sdk-x86")); Environment.SetEnvironmentVariable("PATH", $"{DotnetDir};{Environment.GetEnvironmentVariable("PATH")}"); #pragma warning restore RS0030 // Do not used banned APIs }