diff --git a/native/windows/build.cake b/native/windows/build.cake index afe61fb8d3..db7dfc7ff7 100644 --- a/native/windows/build.cake +++ b/native/windows/build.cake @@ -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"); @@ -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); diff --git a/scripts/azure-templates-stages.yml b/scripts/azure-templates-stages.yml index 1fe8102085..ff53526a17 100644 --- a/scripts/azure-templates-stages.yml +++ b/scripts/azure-templates-stages.yml @@ -128,6 +128,39 @@ stages: target: externals-windows additionalArgs: --buildarch=arm64 artifactName: native + - template: azure-templates-bootstrapper.yml # 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.VM_IMAGE_WINDOWS_NATIVE }} + target: externals-windows + additionalArgs: --buildarch=x86 --llvm="msvc" + artifactName: native_msvc + installLlvm: false + - template: azure-templates-bootstrapper.yml # 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.VM_IMAGE_WINDOWS_NATIVE }} + target: externals-windows + additionalArgs: --buildarch=x64 --llvm="msvc" + artifactName: native_msvc + installLlvm: false + - template: azure-templates-bootstrapper.yml # 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.VM_IMAGE_WINDOWS_NATIVE }} + target: externals-windows + additionalArgs: --buildarch=arm64 --llvm="msvc" + artifactName: native_msvc + installLlvm: false - template: azure-templates-bootstrapper.yml # Build Native WinUI|x86 (Win) parameters: name: native_winui_x86_windows @@ -886,6 +919,7 @@ stages: scanArtifacts: - nuget - nuget_symbols + - native_msvc antiMalwareEnabled: true binSkimEnabled: false policheckExclusionFile: $(Build.SourcesDirectory)\scripts\guardian\PoliCheckExclusions.xml @@ -900,7 +934,18 @@ 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) { diff --git a/scripts/guardian/APIScanSurrogates.in.xml b/scripts/guardian/APIScanSurrogates.in.xml new file mode 100644 index 0000000000..f08a175c43 --- /dev/null +++ b/scripts/guardian/APIScanSurrogates.in.xml @@ -0,0 +1,63 @@ + + + + + + + + + {SOFTWARE_FOLDER} + SRV*https://symweb + + + + + + + + + + + + + {SOFTWARE_FOLDER} + SRV*https://symweb + + + + + + + + + + + + + + {SOFTWARE_FOLDER} + SRV*https://symweb + + + + + + + + + + + + + {SOFTWARE_FOLDER} + SRV*https://symweb + + + + + + + + + + \ No newline at end of file