Merged PR 796663: arm64 macos support

- Tests macos binaries on both amd64 and arm64.
- Updates rocksdb packages to pick up new changes to add arm64 support.
- Disables unit tests that rely on grpc core (these can be re-enabled when we switch to grpc-dotnet)

Related work items: #2195823
This commit is contained in:
Pasindu Gunasekara 🍣 2024-07-29 19:58:56 +00:00
Родитель 7a038008cc
Коммит 5289ffdca1
6 изменённых файлов: 90 добавлений и 63 удалений

Просмотреть файл

@ -0,0 +1,66 @@
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
parameters:
- name: platform
type: string
default: x64
jobs:
- job: runTests_${{ parameters.platform }}
dependsOn: buildTests
displayName: Run Unit Tests with XUnit on MacOS ${{ parameters.platform }}
pool:
${{ if eq(parameters['platform'], 'x64') }}:
vmImage: macos-latest
${{ else }}:
vmImage: macos-14-arm64
steps:
- checkout: self
- task: DownloadBuildArtifacts@1
displayName: Download Test Binaries
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'macos-tests-$(Build.BuildId)'
downloadPath: '$(System.ArtifactsDirectory)/tests'
cleanDestinationFolder: true
- task: Bash@3
displayName: Prepare Intermediate Directories
inputs:
targetType: 'inline'
script: |
mkdir -p $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary
rm -rf $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary/*
workingDirectory: '$(Agent.TempDirectory)'
- task: Bash@3
displayName: Build Debug libBuildXLInterop.dylib
inputs:
filePath: '$(Build.SourcesDirectory)/Private/macOS/xcodebuild.sh'
arguments: '--projectPath $(Build.SourcesDirectory)/Public/Src/Sandbox/MacOs/Interop/Interop.xcodeproj --scheme InteropLibrary --configuration debug --outputDirectory $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary --bundlePath $(Build.SourcesDirectory)/Public/Src/Sandbox/MacOs/BundleInfo.xcconfig'
workingDirectory: '$(Agent.TempDirectory)/BuildXLMacOS'
- task: Bash@3
displayName: Copy libBuildXLInterop.dylib to test directory
inputs:
targetType: 'inline'
script: 'cp $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary/Build/Products/debug/libBuildXLInterop.dylib $(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64/tests/sharedbin/libBuildXLInterop.dylib'
workingDirectory: '$(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary'
- task: Bash@3
displayName: Run Tests
inputs:
filePath: '$(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64/bashrunner.sh'
workingDirectory: '$(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64'
failOnStderr: true
- task: PublishBuildArtifacts@1
displayName: Publish Test Logs on Failure
condition: failed()
inputs:
PathtoPublish: '$(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64/tests/sharedbin/XunitLogs'
ArtifactName: 'macos-tests-xunit-logs-$(Build.BuildId)-${{ parameters.platform }}'
publishLocation: 'Container'

Просмотреть файл

@ -51,57 +51,10 @@ jobs:
ArtifactName: 'macos-tests-xunit-logs-$(Build.BuildId)'
publishLocation: 'Container'
- job: runTests
dependsOn: buildTests
displayName: Run Unit Tests with XUnit on MacOS
pool:
vmImage: 'macos-latest'
steps:
- checkout: self
- task: DownloadBuildArtifacts@1
displayName: Download Test Binaries
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'macos-tests-$(Build.BuildId)'
downloadPath: '$(System.ArtifactsDirectory)/tests'
cleanDestinationFolder: true
- template: /.azdo/pr/macos-build-native-and-run-tests.yml
parameters:
platform: x64
- task: Bash@3
displayName: Prepare Intermediate Directories
inputs:
targetType: 'inline'
script: |
mkdir -p $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary
rm -rf $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary/*
workingDirectory: '$(Agent.TempDirectory)'
- task: Bash@3
displayName: Build Debug libBuildXLInterop.dylib
inputs:
filePath: '$(Build.SourcesDirectory)/Private/macOS/xcodebuild.sh'
arguments: '--projectPath $(Build.SourcesDirectory)/Public/Src/Sandbox/MacOs/Interop/Interop.xcodeproj --scheme InteropLibrary --configuration debug --outputDirectory $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary --bundlePath $(Build.SourcesDirectory)/Public/Src/Sandbox/MacOs/BundleInfo.xcconfig'
workingDirectory: '$(Agent.TempDirectory)/BuildXLMacOS'
- task: Bash@3
displayName: Copy libBuildXLInterop.dylib to test directory
inputs:
targetType: 'inline'
script: 'cp $(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary/Build/Products/debug/libBuildXLInterop.dylib $(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64/tests/sharedbin/libBuildXLInterop.dylib'
workingDirectory: '$(Agent.TempDirectory)/BuildXLMacOS/InteropLibrary'
- task: Bash@3
displayName: Run Tests
inputs:
filePath: '$(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64/bashrunner.sh'
workingDirectory: '$(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64'
failOnStderr: true
- task: PublishBuildArtifacts@1
displayName: Publish Test Logs on Failure
condition: failed()
inputs:
PathtoPublish: '$(System.ArtifactsDirectory)/tests/macos-tests-$(Build.BuildId)/osx-x64/tests/sharedbin/XunitLogs'
ArtifactName: 'macos-tests-xunit-logs-$(Build.BuildId)'
publishLocation: 'Container'
- template: /.azdo/pr/macos-build-native-and-run-tests.yml
parameters:
platform: arm64

Просмотреть файл

@ -14,11 +14,14 @@ namespace Tests.MacOS {
function createAllDefs() : TestDeploymentDefinition[] {
return [
// NOTE: the commented tests below are explicitly disabled because they don't support arm64 on macOS.
// Utilities
createDef(importFrom("BuildXL.Utilities.Instrumentation.UnitTests").Core.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Utilities.UnitTests").Collections.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Utilities.UnitTests").Configuration.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Utilities.UnitTests").Ipc.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
// Depends on Grpc.Core which is not supported on arm64
// Once we move to grpc-dotnet, this can be re-enabled
// createDef(importFrom("BuildXL.Utilities.UnitTests").Ipc.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Utilities.UnitTests").KeyValueStoreTests.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Utilities.UnitTests").Storage.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Utilities.UnitTests").Storage.Untracked.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
@ -27,13 +30,17 @@ namespace Tests.MacOS {
// Cache
createDef(importFrom("BuildXL.Cache.ContentStore").Test.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.ContentStore").GrpcTest.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
// Depends on grpc.Core which is not supported on arm64
// createDef(importFrom("BuildXL.Cache.ContentStore").GrpcTest.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.ContentStore").InterfacesTest.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.ContentStore").DistributedTest.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.MemoizationStore").Test.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
// Depends on grpc.Core which is not supported on arm64
// createDef(importFrom("BuildXL.Cache.ContentStore").DistributedTest.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
// Depends on grpc.Core which is not supported on arm64
// createDef(importFrom("BuildXL.Cache.MemoizationStore").Test.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.MemoizationStore").InterfacesTest.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.DistributedCache.Host").Test.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.Core.UnitTests").Analyzer.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
// The BuildXL dotnet SDK does not properly support arm64 yet, so this test will be disabled.
// createDef(importFrom("BuildXL.Cache.Core.UnitTests").Analyzer.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.Core.UnitTests").BasicFilesystem.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.Core.UnitTests").InputListFilter.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
createDef(importFrom("BuildXL.Cache.Core.UnitTests").Interfaces.withQualifier({ targetFramework: defaultTargetFramework }).dll, true),
@ -42,7 +49,6 @@ namespace Tests.MacOS {
...addIfLazy(BuildXLSdk.Flags.isMicrosoftInternal, () => [
createDef(importFrom("BuildXL.Cache.Logging").Test.withQualifier({ targetFramework: defaultTargetFramework }).dll, true)
]),
createDef(importFrom("BuildXL.Cache.MemoizationStore").Test.withQualifier({ targetFramework: defaultTargetFramework }).dll, true)
];
}

Просмотреть файл

@ -16,6 +16,8 @@ using static Test.BuildXL.Executables.AsyncMutexClient.Program;
namespace Test.BuildXL.Utilities
{
// [pgunasekara]: Temporarily disabled temporarily on macOS due to missing arm64 support on the test executable used for these tests.
[TestClassIfSupported(requiresWindowsOrLinuxOperatingSystem: true)]
public class AsyncMutexTests : TemporaryStorageTestBase
{
private readonly string m_asyncMutexClient;

Просмотреть файл

@ -2652,7 +2652,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "RocksDbNative",
"Version": "8.1.1-20240419.2"
"Version": "8.1.1-20240726.4"
}
}
},
@ -2661,7 +2661,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "RocksDbSharp",
"Version": "8.1.1-20240419.2"
"Version": "8.1.1-20240726.4"
}
}
},

Просмотреть файл

@ -167,8 +167,8 @@ config({
{ id: "Microsoft.Windows.ProjFS", version: "1.2.19351.1" },
// RocksDb
{ id: "RocksDbSharp", version: "8.1.1-20240419.2", alias: "RocksDbSharpSigned" },
{ id: "RocksDbNative", version: "8.1.1-20240419.2" },
{ id: "RocksDbSharp", version: "8.1.1-20240726.4", alias: "RocksDbSharpSigned" },
{ id: "RocksDbNative", version: "8.1.1-20240726.4" },
{ id: "JsonDiffPatch.Net", version: "2.1.0" },