diff --git a/tests/xammac_tests/xammac_tests.csproj b/tests/xammac_tests/xammac_tests.csproj
index 73a17e215e43..542158c0d3b5 100644
--- a/tests/xammac_tests/xammac_tests.csproj
+++ b/tests/xammac_tests/xammac_tests.csproj
@@ -15,6 +15,7 @@
PackageReference
..
$(RootTestsDirectory)\..\src\rsp\macos-defines.rsp
+ $(MonoBundlingExtraArgs) --marshal-objectivec-exceptions:throwmanagedexception
true
diff --git a/tools/devops/automation/build-pipeline.yml b/tools/devops/automation/build-pipeline.yml
index 1f6535087d2f..da5fd04e0c27 100644
--- a/tools/devops/automation/build-pipeline.yml
+++ b/tools/devops/automation/build-pipeline.yml
@@ -12,6 +12,11 @@ parameters:
type: string
default: 'latest'
+- name: macOSName # comes from the build agent demand named macOS.Name
+ displayName: Name of the version of macOS to use
+ type: string
+ default: 'Ventura'
+
- name: pool
type: string
displayName: Bot pool to use
@@ -204,6 +209,7 @@ stages:
- template: templates/main-stage.yml
parameters:
xcodeChannel: Stable
+ macOSName: ${{ parameters.macOSName }}
isPR: false
provisionatorChannel: ${{ parameters.provisionatorChannel }}
pool: ${{ parameters.pool }}
diff --git a/tools/devops/automation/build-pull-request.yml b/tools/devops/automation/build-pull-request.yml
index 256e8bf8649e..92effdedce54 100644
--- a/tools/devops/automation/build-pull-request.yml
+++ b/tools/devops/automation/build-pull-request.yml
@@ -12,6 +12,11 @@ parameters:
type: string
default: 'latest'
+- name: macOSName # comes from the build agent demand named macOS.Name
+ displayName: Name of the version of macOS to use
+ type: string
+ default: 'Ventura'
+
- name: pool
type: string
displayName: Bot pool to use
@@ -187,6 +192,7 @@ stages:
- template: templates/main-stage.yml
parameters:
xcodeChannel: Stable
+ macOSName: ${{ parameters.macOSName }}
isPR: true
provisionatorChannel: ${{ parameters.provisionatorChannel }}
pool: ${{ parameters.pool }}
diff --git a/tools/devops/automation/templates/build/api-diff-stage.yml b/tools/devops/automation/templates/build/api-diff-stage.yml
index 638ddb670261..c2563330643f 100644
--- a/tools/devops/automation/templates/build/api-diff-stage.yml
+++ b/tools/devops/automation/templates/build/api-diff-stage.yml
@@ -35,6 +35,9 @@ parameters:
- name: xcodeChannel
type: string
+- name: macOSName
+ type: string
+
jobs:
- job: configure
displayName: 'Configure build'
@@ -91,7 +94,7 @@ jobs:
name: $(AgentPoolComputed)
demands:
- Agent.OS -equals Darwin
- - macios_image -equals v2.1 # Big Sur image with Xcode 12.4 and 12.5 installed
+ - macOS.Name -equals ${{ parameters.macOSName }}
- XcodeChannel -equals ${{ parameters.xcodeChannel }}
workspace:
clean: all
diff --git a/tools/devops/automation/templates/build/build-stage.yml b/tools/devops/automation/templates/build/build-stage.yml
index 0862d3ac2233..35e49788712c 100644
--- a/tools/devops/automation/templates/build/build-stage.yml
+++ b/tools/devops/automation/templates/build/build-stage.yml
@@ -47,6 +47,9 @@ parameters:
- name: xcodeChannel
type: string
+- name: macOSName
+ type: string
+
jobs:
- job: configure
displayName: 'Configure build'
@@ -133,7 +136,7 @@ jobs:
name: $(AgentPoolComputed)
demands:
- Agent.OS -equals Darwin
- - macios_image -equals v2.1 # Big Sur image with Xcode 12.4 and 12.5 installed
+ - macOS.Name -equals ${{ parameters.macOSName }}
- XcodeChannel -equals ${{ parameters.xcodeChannel }}
workspace:
clean: all
diff --git a/tools/devops/automation/templates/main-stage.yml b/tools/devops/automation/templates/main-stage.yml
index 723d2fcebcf3..7f8e582801f4 100644
--- a/tools/devops/automation/templates/main-stage.yml
+++ b/tools/devops/automation/templates/main-stage.yml
@@ -74,6 +74,9 @@ parameters:
- name: xcodeChannel
type: string
+- name: macOSName
+ type: string
+
- name: simTestsConfigurations
type: object
default: [
@@ -234,6 +237,7 @@ stages:
- template: ./build/build-stage.yml
parameters:
xcodeChannel: ${{ parameters.xcodeChannel }}
+ macOSName: ${{ parameters.macOSName }}
isPR: ${{ parameters.isPR }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
@@ -321,6 +325,7 @@ stages:
- template: ./build/api-diff-stage.yml
parameters:
xcodeChannel: ${{ parameters.xcodeChannel }}
+ macOSName: ${{ parameters.macOSName }}
isPR: ${{ parameters.isPR }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
@@ -337,6 +342,7 @@ stages:
- template: ./tests/stage.yml
parameters:
xcodeChannel: ${{ parameters.xcodeChannel }}
+ macOSName: ${{ parameters.macOSName }}
isPR: ${{ parameters.isPR }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
diff --git a/tools/devops/automation/templates/tests/stage.yml b/tools/devops/automation/templates/tests/stage.yml
index 477e06ce69f5..72ae86b3c590 100644
--- a/tools/devops/automation/templates/tests/stage.yml
+++ b/tools/devops/automation/templates/tests/stage.yml
@@ -87,6 +87,9 @@ parameters:
- name: XcodeChannel
type: string
+- name: macOSName
+ type: string
+
stages:
- stage: ${{ parameters.stageName }}
displayName: ${{ parameters.displayName }}
@@ -139,7 +142,7 @@ stages:
name: $(AgentPoolComputed)
demands:
- Agent.OS -equals Darwin
- - macios_image -equals v2.1 # Big Sur image with Xcode 12.4 and 12.5 installed
+ - macOS.Name -equals ${{ parameters.macOSName }}
- XcodeChannel -equals ${{ parameters.XcodeChannel }}
- ${{ each demand in parameters.extraBotDemands }}:
- demand
diff --git a/tools/siminstaller/Program.cs b/tools/siminstaller/Program.cs
index a80a2a6281c7..91e5ce4f0ece 100644
--- a/tools/siminstaller/Program.cs
+++ b/tools/siminstaller/Program.cs
@@ -427,10 +427,16 @@ static bool Install (string source, long fileSize, string installPrefix)
Directory.Delete (expanded_path, true);
}
} finally {
- TryExecuteAndCapture ("hdiutil", $"detach '{mount_point}' -quiet", out _);
+ if (!TryExecuteAndCapture ("hdiutil", $"detach '{mount_point}' -quiet -force", out _))
+ Console.WriteLine ($"Failed to detach {mount_point}");
}
} finally {
- Directory.Delete (mount_point, true);
+ try {
+ Directory.Delete (mount_point, true);
+ } catch (IOException ioex) {
+ Console.WriteLine ($"Unable to remove: {mount_point}");
+ Console.WriteLine ($" with error: {ioex}");
+ }
}
File.Delete (download_path);