Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dev/1es
Browse files Browse the repository at this point in the history
# Conflicts:
#	scripts/azure-templates-stages.yml
  • Loading branch information
mattleibow committed Feb 27, 2024
2 parents fac6a8b + ac52490 commit 115f968
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 2 deletions.
5 changes: 3 additions & 2 deletions native/windows/build.cake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
DirectoryPath ROOT_PATH = MakeAbsolute(Directory("../.."));
DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native"));

DirectoryPath LLVM_HOME = Argument("llvm", EnvironmentVariable("LLVM_HOME") ?? "C:/Program Files/LLVM");
var llvmHomeArg = Argument("llvm", EnvironmentVariable("LLVM_HOME") ?? "C:/Program Files/LLVM");
DirectoryPath LLVM_HOME = string.IsNullOrEmpty(llvmHomeArg) || llvmHomeArg.ToLower() == "msvc" ? "" : llvmHomeArg;
string VC_TOOLSET_VERSION = Argument("vcToolsetVersion", "14.2");

string SUPPORT_VULKAN_VAR = Argument ("supportVulkan", EnvironmentVariable ("SUPPORT_VULKAN") ?? "true");
Expand All @@ -13,7 +14,7 @@ bool SUPPORT_VULKAN = SUPPORT_VULKAN_VAR == "1" || SUPPORT_VULKAN_VAR.ToLower ()
string VARIANT = BUILD_VARIANT ?? "windows";

Information("Native Arguments:");
Information($" {"LLVM_HOME".PadRight(30)} {{0}}", LLVM_HOME);
Information($" {"LLVM_HOME".PadRight(30)} {{0}}", string.IsNullOrEmpty(LLVM_HOME.FullPath) ? "(Using MSVC)" : LLVM_HOME);
Information($" {"SUPPORT_VULKAN".PadRight(30)} {{0}}", SUPPORT_VULKAN);
Information($" {"VARIANT".PadRight(30)} {{0}}", VARIANT);
Information($" {"CONFIGURATION".PadRight(30)} {{0}}", CONFIGURATION);
Expand Down
42 changes: 42 additions & 0 deletions scripts/azure-templates-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,36 @@ stages:
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=arm64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x86 (Win + MSVC)
parameters:
name: native_win32_x86_msvc_windows
displayName: Win32 x86 [MSVC]
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
vmImage: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x86 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x64 (Win + MSVC)
parameters:
name: native_win32_x64_msvc_windows
displayName: Win32 x64 [MSVC]
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
vmImage: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x64 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|arm64 (Win + MSVC)
parameters:
name: native_win32_arm64_msvc_windows
displayName: Win32 arm64 [MSVC]
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
vmImage: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=arm64 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native WinUI|x86 (Win)
parameters:
name: native_winui_x86_windows
Expand Down Expand Up @@ -872,6 +902,7 @@ stages:
# scanArtifacts:
# - nuget
# - nuget_symbols
# - native_msvc
# antiMalwareEnabled: true
# binSkimEnabled: false
# policheckExclusionFile: $(Build.SourcesDirectory)\scripts\guardian\PoliCheckExclusions.xml
Expand All @@ -886,8 +917,19 @@ stages:
# apiScanSoftwareName: 'SkiaSharp'
# apiScanSoftwareVersionNum: $(SKIASHARP_MAJOR_VERSION)
# apiScanPreserveLogsFolder: true
# apiScanSurrogateConfigurationFolder: $(Build.ArtifactStagingDirectory)\APIScanSurrogates
# preScanSteps:
# - pwsh: |
# $softwareFolder = "$(Build.ArtifactStagingDirectory)\binaries-to-scan"
# $surrogateFile = "$(Build.SourcesDirectory)\scripts\guardian\APIScanSurrogates.in.xml"
# $destFolder = "$(Build.ArtifactStagingDirectory)\APIScanSurrogates"
# $destFile = "$destFolder\APIScanSurrogates.xml"
# New-Item -ItemType Directory -Force -Path $destFolder | Out-Null
# $surrogateContents = (Get-Content $surrogateFile)
# $surrogateContents = $surrogateContents.Replace("{SOFTWARE_FOLDER}", $softwareFolder)
# $surrogateContents | Set-Content $destFile
# displayName: Generate the surrogate files
# - pwsh: |
# $nupkgs = (Get-ChildItem "$(Build.ArtifactStagingDirectory)\binaries-to-scan\*\*.*nupkg")
# foreach ($nupkg in $nupkgs) {
# $filename = $nupkg.Name.TrimEnd('.nupkg')
Expand Down
63 changes: 63 additions & 0 deletions scripts/guardian/APIScanSurrogates.in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<APIScanSurrogates>
<Mappings>
<!-- Win32 Clang to MSVC -->
<Mapping>
<SurrogateSet>
<BinarySet>
<SymbolLocations>
<SymbolLocation>{SOFTWARE_FOLDER}</SymbolLocation>
<SymbolLocation>SRV*https://symweb</SymbolLocation>
</SymbolLocations>
<Binary path="{SOFTWARE_FOLDER}\native_msvc\native\windows\x86\libskiasharp.dll" />
</BinarySet>
</SurrogateSet>
<Targets>
<Binary path=".*\\nuget_symbols-extracted\\skiasharp\.nativeassets\.win32.*\\runtimes\\win-x86\\native\\libskiasharp\.dll" pathType="Regex" />
</Targets>
</Mapping>
<Mapping>
<SurrogateSet>
<BinarySet>
<SymbolLocations>
<SymbolLocation>{SOFTWARE_FOLDER}</SymbolLocation>
<SymbolLocation>SRV*https://symweb</SymbolLocation>
</SymbolLocations>
<Binary path="{SOFTWARE_FOLDER}\native_msvc\native\windows\x64\libskiasharp.dll" />
</BinarySet>
</SurrogateSet>
<Targets>
<Binary path=".*\\nuget_symbols-extracted\\skiasharp\.nativeassets\.win32.*\\runtimes\\win-x64\\native\\libskiasharp\.dll" pathType="Regex" />
</Targets>
</Mapping>
<!-- NanoServer Clang to MSVC -->
<Mapping>
<SurrogateSet>
<BinarySet>
<SymbolLocations>
<SymbolLocation>{SOFTWARE_FOLDER}</SymbolLocation>
<SymbolLocation>SRV*https://symweb</SymbolLocation>
</SymbolLocations>
<Binary path="{SOFTWARE_FOLDER}\native_msvc\native\windows\x86\libskiasharp.dll" />
</BinarySet>
</SurrogateSet>
<Targets>
<Binary path=".*\\nuget_symbols-extracted\\skiasharp\.nativeassets\.nanoserver.*\\runtimes\\win-x86\\native\\libskiasharp\.dll" pathType="Regex" />
</Targets>
</Mapping>
<Mapping>
<SurrogateSet>
<BinarySet>
<SymbolLocations>
<SymbolLocation>{SOFTWARE_FOLDER}</SymbolLocation>
<SymbolLocation>SRV*https://symweb</SymbolLocation>
</SymbolLocations>
<Binary path="{SOFTWARE_FOLDER}\native_msvc\native\windows\x64\libskiasharp.dll" />
</BinarySet>
</SurrogateSet>
<Targets>
<Binary path=".*\\nuget_symbols-extracted\\skiasharp\.nativeassets\.nanoserver.*\\runtimes\\win-x64\\native\\libskiasharp\.dll" pathType="Regex" />
</Targets>
</Mapping>
</Mappings>
</APIScanSurrogates>

0 comments on commit 115f968

Please sign in to comment.