From 52534c94cc1361070df2198dcf3e980f7d10317d Mon Sep 17 00:00:00 2001 From: Michael Niksa Date: Mon, 30 Sep 2019 10:39:55 -0700 Subject: [PATCH] Combined changes to make the build work again (see inside) (#2945) * Revert "Add source linking information during the build (#2857)" This reverts commit 6b728cd6d027e2f9787e816c47e23ce0b62f7736. * Need reference to renderer base inside UnitTests_TerminalCore * add dependency for TerminalControl to Types project. * Set build to single threaded as parallel build is broken by 16.3 build toolchain. * Disable new rule C26814 as it's breaking builds Wrote a follow up task #2941 to roll it out later. * Add noexcept to dx header. --- .../templates/build-console-steps.yml | 13 +-- build/scripts/Index-Pdbs.ps1 | 85 ------------------- src/StaticAnalysis.ruleset | 2 + src/cascadia/TerminalApp/TerminalApp.vcxproj | 34 ++++---- src/cascadia/TerminalApp/packages.config | 5 +- .../TerminalConnection.vcxproj | 16 +--- .../TerminalConnection.vcxproj.filters | 1 - .../TerminalConnection/packages.config | 5 +- .../TerminalControl/TerminalControl.vcxproj | 20 +---- .../TerminalControl.vcxproj.filters | 3 +- src/cascadia/TerminalControl/packages.config | 5 +- .../TerminalSettings/TerminalSettings.vcxproj | 20 +---- src/cascadia/TerminalSettings/packages.config | 5 +- .../UnitTests_TerminalCore/UnitTests.vcxproj | 5 +- .../WindowsTerminal/WindowsTerminal.vcxproj | 27 +++--- src/cascadia/WindowsTerminal/packages.config | 7 +- src/host/exe/Host.EXE.vcxproj | 20 ----- src/host/exe/Host.EXE.vcxproj.filters | 6 -- src/host/exe/packages.config | 6 -- src/propsheet/packages.config | 6 -- src/propsheet/propsheet.vcxproj | 20 +---- src/propsheet/propsheet.vcxproj.filters | 21 +---- src/renderer/dx/DxRenderer.cpp | 2 +- src/renderer/dx/DxRenderer.hpp | 2 +- src/winconpty/packages.config | 6 -- src/winconpty/winconpty.vcxproj | 22 +---- 26 files changed, 59 insertions(+), 305 deletions(-) delete mode 100644 build/scripts/Index-Pdbs.ps1 delete mode 100644 src/host/exe/packages.config delete mode 100644 src/propsheet/packages.config delete mode 100644 src/winconpty/packages.config diff --git a/build/pipelines/templates/build-console-steps.yml b/build/pipelines/templates/build-console-steps.yml index c25420cfc..b8d292baa 100644 --- a/build/pipelines/templates/build-console-steps.yml +++ b/build/pipelines/templates/build-console-steps.yml @@ -44,7 +44,7 @@ steps: configuration: '$(BuildConfiguration)' msbuildArgs: ${{ parameters.additionalBuildArguments }} clean: true - maximumCpuCount: true + maximumCpuCount: false - task: PowerShell@2 displayName: 'Check MSIX for common regressions' @@ -54,14 +54,6 @@ steps: $Package = Get-ChildItem -Recurse -Filter "CascadiaPackage_*.msix" .\build\scripts\Test-WindowsTerminalPackage.ps1 -Verbose -Path $Package.FullName -- task: powershell@2 - displayName: 'Source Index PDBs' - inputs: - targetType: filePath - filePath: build\scripts\Index-Pdbs.ps1 - arguments: -SearchDir '$(Build.SourcesDirectory)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion) - errorActionPreference: silentlyContinue - - task: VSTest@2 displayName: 'Run Unit Tests' inputs: @@ -89,7 +81,7 @@ steps: platform: '$(BuildPlatform)' configuration: '$(BuildConfiguration)' condition: and(succeeded(), eq(variables['BuildPlatform'], 'x64')) - + - task: CopyFiles@2 displayName: 'Copy *.appx/*.msix to Artifacts (Non-PR builds only)' inputs: @@ -109,4 +101,3 @@ steps: PathtoPublish: '$(Build.ArtifactStagingDirectory)/appx' ArtifactName: 'appx-$(BuildConfiguration)' condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - diff --git a/build/scripts/Index-Pdbs.ps1 b/build/scripts/Index-Pdbs.ps1 deleted file mode 100644 index c0227b1fe..000000000 --- a/build/scripts/Index-Pdbs.ps1 +++ /dev/null @@ -1,85 +0,0 @@ -[CmdLetBinding()] -Param( - [Parameter(Mandatory=$true, Position=0)][string]$SearchDir, - [Parameter(Mandatory=$true, Position=1)][string]$SourceRoot, - [Parameter(Mandatory=$true, Position=2)][string]$CommitId, - [string]$Organization = "microsoft", - [string]$Repo = "terminal", - [switch]$recursive -) - -$debuggerPath = (Get-ItemProperty -path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots" -name WindowsDebuggersRoot10).WindowsDebuggersRoot10 -$srcsrvPath = Join-Path $debuggerPath "x64\srcsrv" -$srctoolExe = Join-Path $srcsrvPath "srctool.exe" -$pdbstrExe = Join-Path $srcsrvPath "pdbstr.exe" - -$fileTable = @{} -foreach ($gitFile in & git ls-files) -{ - $fileTable[$gitFile] = $gitFile -} - -$mappedFiles = New-Object System.Collections.ArrayList - -foreach ($file in (Get-ChildItem -r:$recursive "$SearchDir\*.pdb")) -{ - Write-Verbose "Found $file" - - $ErrorActionPreference = "Continue" # Azure Pipelines defaults to "Stop", continue past errors in this script. - - $allFiles = & $srctoolExe -r "$file" - - # If the pdb didn't have enough files then skip it (the srctool output has a blank line even when there's no info - # so check for less than 2 lines) - if ($allFiles.Length -lt 2) - { - continue - } - - for ($i = 0; $i -lt $allFiles.Length; $i++) - { - if ($allFiles[$i].StartsWith($SourceRoot, [StringComparison]::OrdinalIgnoreCase)) - { - $relative = $allFiles[$i].Substring($SourceRoot.Length).TrimStart("\") - $relative = $relative.Replace("\", "/") - - # Git urls are case-sensitive but the PDB might contain a lowercased version of the file path. - # Look up the relative url in the output of "ls-files". If it's not there then it's not something - # in git, so don't index it. - $relative = $fileTable[$relative] - if ($relative) - { - $mapping = $allFiles[$i] + "*$relative" - $mappedFiles.Add($mapping) - - Write-Verbose "Mapped path $($i): $mapping" - } - } - } - - $pdbstrFile = Join-Path "$env:TEMP" "pdbstr.txt" - - Write-Verbose "pdbstr.txt = $pdbstrFile" - - @" -SRCSRV: ini ------------------------------------------------ -VERSION=2 -VERCTRL=http -SRCSRV: variables ------------------------------------------ -ORGANIZATION=$Organization -REPO=$Repo -COMMITID=$CommitId -HTTP_ALIAS=https://raw.githubusercontent.com/%ORGANIZATION%/%REPO%/%COMMITID%/ -HTTP_EXTRACT_TARGET=%HTTP_ALIAS%%var2% -SRCSRVTRG=%HTTP_EXTRACT_TARGET% -SRC_INDEX=public -SRCSRV: source files --------------------------------------- -$($mappedFiles -join "`r`n") -SRCSRV: end ------------------------------------------------ -"@ | Set-Content $pdbstrFile - - & $pdbstrExe -p:"$file" -w -s:srcsrv -i:$pdbstrFile -} - -# Return with exit 0 to override any weird error code from other tools -Exit 0 \ No newline at end of file diff --git a/src/StaticAnalysis.ruleset b/src/StaticAnalysis.ruleset index 114c0cc5c..776c72bf8 100644 --- a/src/StaticAnalysis.ruleset +++ b/src/StaticAnalysis.ruleset @@ -9,6 +9,8 @@ + + diff --git a/src/cascadia/TerminalApp/TerminalApp.vcxproj b/src/cascadia/TerminalApp/TerminalApp.vcxproj index e4811c043..207c89236 100644 --- a/src/cascadia/TerminalApp/TerminalApp.vcxproj +++ b/src/cascadia/TerminalApp/TerminalApp.vcxproj @@ -1,9 +1,8 @@ - - - + + @@ -22,6 +21,7 @@ + + - + + true true + + <_BinRoot Condition="'$(Platform)' != 'Win32'">$(OpenConsoleDir)$(Platform)\$(Configuration)\ <_BinRoot Condition="'$(Platform)' == 'Win32'">$(OpenConsoleDir)$(Configuration)\ + /INCLUDE:_DllMain@12 /INCLUDE:DllMain + + - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - \ No newline at end of file + + diff --git a/src/cascadia/TerminalApp/packages.config b/src/cascadia/TerminalApp/packages.config index b07ee5571..efa276920 100644 --- a/src/cascadia/TerminalApp/packages.config +++ b/src/cascadia/TerminalApp/packages.config @@ -1,9 +1,6 @@  - - - - \ No newline at end of file + diff --git a/src/cascadia/TerminalConnection/TerminalConnection.vcxproj b/src/cascadia/TerminalConnection/TerminalConnection.vcxproj index fe1b62623..cf277ae64 100644 --- a/src/cascadia/TerminalConnection/TerminalConnection.vcxproj +++ b/src/cascadia/TerminalConnection/TerminalConnection.vcxproj @@ -1,8 +1,5 @@ - - - DynamicLibrary @@ -38,7 +35,7 @@ - + @@ -93,14 +90,5 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - \ No newline at end of file + diff --git a/src/cascadia/TerminalConnection/TerminalConnection.vcxproj.filters b/src/cascadia/TerminalConnection/TerminalConnection.vcxproj.filters index 1381e4c78..ef69f54ec 100644 --- a/src/cascadia/TerminalConnection/TerminalConnection.vcxproj.filters +++ b/src/cascadia/TerminalConnection/TerminalConnection.vcxproj.filters @@ -15,7 +15,6 @@ - diff --git a/src/cascadia/TerminalConnection/packages.config b/src/cascadia/TerminalConnection/packages.config index 76c9bfc93..9bc27a32e 100644 --- a/src/cascadia/TerminalConnection/packages.config +++ b/src/cascadia/TerminalConnection/packages.config @@ -1,8 +1,5 @@  - - - - \ No newline at end of file + diff --git a/src/cascadia/TerminalControl/TerminalControl.vcxproj b/src/cascadia/TerminalControl/TerminalControl.vcxproj index 5e1b8c325..171a1025c 100644 --- a/src/cascadia/TerminalControl/TerminalControl.vcxproj +++ b/src/cascadia/TerminalControl/TerminalControl.vcxproj @@ -1,8 +1,5 @@ - - - @@ -56,6 +53,7 @@ + @@ -89,18 +87,4 @@ - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - \ No newline at end of file + diff --git a/src/cascadia/TerminalControl/TerminalControl.vcxproj.filters b/src/cascadia/TerminalControl/TerminalControl.vcxproj.filters index 82e70b258..888488b3f 100644 --- a/src/cascadia/TerminalControl/TerminalControl.vcxproj.filters +++ b/src/cascadia/TerminalControl/TerminalControl.vcxproj.filters @@ -17,7 +17,6 @@ - @@ -38,4 +37,4 @@ - \ No newline at end of file + diff --git a/src/cascadia/TerminalControl/packages.config b/src/cascadia/TerminalControl/packages.config index f5ce647a9..e345a6ccd 100644 --- a/src/cascadia/TerminalControl/packages.config +++ b/src/cascadia/TerminalControl/packages.config @@ -1,7 +1,4 @@  - - - - \ No newline at end of file + diff --git a/src/cascadia/TerminalSettings/TerminalSettings.vcxproj b/src/cascadia/TerminalSettings/TerminalSettings.vcxproj index 359d64d30..b40d1d8ae 100644 --- a/src/cascadia/TerminalSettings/TerminalSettings.vcxproj +++ b/src/cascadia/TerminalSettings/TerminalSettings.vcxproj @@ -1,8 +1,5 @@ - - - @@ -50,6 +47,7 @@ + + so that the AppX Manifest contains their activatable classes. --> + + + true + @@ -110,18 +113,15 @@ - - - - - - + + + - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - \ No newline at end of file diff --git a/src/host/exe/Host.EXE.vcxproj.filters b/src/host/exe/Host.EXE.vcxproj.filters index 78effa069..09a26cd60 100644 --- a/src/host/exe/Host.EXE.vcxproj.filters +++ b/src/host/exe/Host.EXE.vcxproj.filters @@ -38,10 +38,4 @@ - - - - - - \ No newline at end of file diff --git a/src/host/exe/packages.config b/src/host/exe/packages.config deleted file mode 100644 index 1e6e04656..000000000 --- a/src/host/exe/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/propsheet/packages.config b/src/propsheet/packages.config deleted file mode 100644 index 1e6e04656..000000000 --- a/src/propsheet/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/propsheet/propsheet.vcxproj b/src/propsheet/propsheet.vcxproj index 52c9e5f93..583eff62b 100644 --- a/src/propsheet/propsheet.vcxproj +++ b/src/propsheet/propsheet.vcxproj @@ -1,8 +1,5 @@ - - - @@ -51,7 +48,6 @@ - DynamicLibrary @@ -87,18 +83,4 @@ - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - \ No newline at end of file + diff --git a/src/propsheet/propsheet.vcxproj.filters b/src/propsheet/propsheet.vcxproj.filters index a5d081e34..32c98268a 100644 --- a/src/propsheet/propsheet.vcxproj.filters +++ b/src/propsheet/propsheet.vcxproj.filters @@ -45,6 +45,9 @@ Source Files + + Source Files + Source Files @@ -60,12 +63,6 @@ Source Files - - Source Files - - - Source Files - @@ -98,12 +95,6 @@ Header Files - - Header Files - - - Header Files - @@ -119,9 +110,5 @@ Source Files - - - - - \ No newline at end of file + diff --git a/src/renderer/dx/DxRenderer.cpp b/src/renderer/dx/DxRenderer.cpp index 3d52a4b68..b27ed99b9 100644 --- a/src/renderer/dx/DxRenderer.cpp +++ b/src/renderer/dx/DxRenderer.cpp @@ -1360,7 +1360,7 @@ float DxEngine::GetScaling() const noexcept // - // Return Value: // - Rectangle describing dirty area in characters. -[[nodiscard]] SMALL_RECT DxEngine::GetDirtyRectInChars() +[[nodiscard]] SMALL_RECT DxEngine::GetDirtyRectInChars() noexcept { SMALL_RECT r; r.Top = gsl::narrow(floor(_invalidRect.top / _glyphCell.cy)); diff --git a/src/renderer/dx/DxRenderer.hpp b/src/renderer/dx/DxRenderer.hpp index f09601203..ebe6846cf 100644 --- a/src/renderer/dx/DxRenderer.hpp +++ b/src/renderer/dx/DxRenderer.hpp @@ -88,7 +88,7 @@ namespace Microsoft::Console::Render [[nodiscard]] HRESULT GetProposedFont(const FontInfoDesired& fiFontInfoDesired, FontInfo& fiFontInfo, int const iDpi) noexcept override; - [[nodiscard]] SMALL_RECT GetDirtyRectInChars() override; + [[nodiscard]] SMALL_RECT GetDirtyRectInChars() noexcept override; [[nodiscard]] HRESULT GetFontSize(_Out_ COORD* const pFontSize) noexcept override; [[nodiscard]] HRESULT IsGlyphWideByFont(const std::wstring_view glyph, _Out_ bool* const pResult) noexcept override; diff --git a/src/winconpty/packages.config b/src/winconpty/packages.config deleted file mode 100644 index 1e6e04656..000000000 --- a/src/winconpty/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/winconpty/winconpty.vcxproj b/src/winconpty/winconpty.vcxproj index 6ee6e7ebd..6ffd09468 100644 --- a/src/winconpty/winconpty.vcxproj +++ b/src/winconpty/winconpty.vcxproj @@ -1,8 +1,5 @@ - - - @@ -11,7 +8,6 @@ - @@ -29,25 +25,13 @@ + winconpty.def + onecoreuap_apiset.lib;%(AdditionalDependencies) - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - \ No newline at end of file +