Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xcode16.3] [system-dependencies] Update how we get old simulators. #22286

Merged
merged 6 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ DOTNET_MIN_MACCATALYST_SDK_VERSION=15.0
DOTNET_MIN_MACOS_SDK_VERSION=12.0

# The min simulator version available in the Xcode we're using
MIN_IOS_SIMULATOR_VERSION=15.0
MIN_TVOS_SIMULATOR_VERSION=15.0
MIN_IOS_SIMULATOR_VERSION=16.0
MIN_TVOS_SIMULATOR_VERSION=16.0
# These are the simulator package ids for the versions above
EXTRA_SIMULATORS=com.apple.pkg.iPhoneSimulatorSDK15_0 com.apple.pkg.AppleTVSimulatorSDK15_0
EXTRA_SIMULATORS=iOS:MIN_IOS_SIMULATOR_VERSION tvOS:MIN_TVOS_SIMULATOR_VERSION

INCLUDE_IOS=1
INCLUDE_MAC=1
Expand Down
2 changes: 1 addition & 1 deletion src/StoreKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public enum SKOverlayPosition : long {
Raised = 1,
}

[NoMac, iOS (16, 0), MacCatalyst (16, 0), NoTV]
[NoMac, iOS (16, 1), MacCatalyst (16, 1), NoTV]
public enum SKAdNetworkCoarseConversionValue {
[Field ("SKAdNetworkCoarseConversionValueHigh")]
High,
Expand Down
4 changes: 2 additions & 2 deletions src/storekit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ interface SKStoreProductParameterKey {
[Field ("SKStoreProductParameterAdNetworkCampaignIdentifier")]
NSString AdNetworkCampaignIdentifier { get; }

[NoMac, iOS (16, 0), MacCatalyst (16, 0), TV (17, 0)]
[NoMac, iOS (16, 1), MacCatalyst (16, 1), TV (16, 1)]
[Field ("SKStoreProductParameterAdNetworkSourceIdentifier")]
NSString AdNetworkSourceIdentifier { get; }

Expand Down Expand Up @@ -1488,7 +1488,7 @@ interface SKAdImpression {
[Export ("adCampaignIdentifier", ArgumentSemantic.Strong)]
NSNumber AdCampaignIdentifier { get; set; }

[NoMac, iOS (16, 0), MacCatalyst (16, 0), NoTV]
[NoMac, iOS (16, 1), MacCatalyst (16, 1), NoTV]
[Export ("sourceIdentifier", ArgumentSemantic.Strong)]
NSNumber SourceIdentifier { get; set; }

Expand Down
73 changes: 38 additions & 35 deletions system-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ while ! test -z $1; do
IGNORE_SIMULATORS=1
shift
;;
--ignore-old-simulators)
IGNORE_OLD_SIMULATORS=1
shift
;;
--enforce-simulators)
unset IGNORE_SIMULATORS
unset OPTIONAL_SIMULATORS
Expand Down Expand Up @@ -901,53 +905,52 @@ function check_old_simulators ()

local EXTRA_SIMULATORS
local XCODE
local XCODE_DEVELOPER_ROOT

EXTRA_SIMULATORS=$(grep ^EXTRA_SIMULATORS= Make.config | sed 's/.*=//')
XCODE=$(dirname "$(dirname "$(grep ^XCODE_DEVELOPER_ROOT= Make.config | sed 's/.*=//')")")
XCODE_DEVELOPER_ROOT=$(grep XCODE$1_DEVELOPER_ROOT= Make.config | sed 's/.*=//')

if ! make -C tools/siminstaller >/dev/null; then
warn "Can't check if simulators are available, because siminstaller failed to build."
return
fi
IFS=' ' read -r -a EXTRA_SIMULATORS <<< "$(grep ^EXTRA_SIMULATORS= Make.config | sed 's/.*=//')"
XCODE=$(dirname "$(dirname "$XCODE_DEVELOPER_ROOT")")

if ! test -d "$XCODE"; then
# can't test unless Xcode is present
warn "Can't check if simulators are available unless Xcode is already installed."
return
fi

IFS=', ' read -r -a SIMS <<< "$EXTRA_SIMULATORS"
arraylength=${#SIMS[@]}
INSTALL_SIMULATORS=
for (( i=1; i<arraylength+1; i++ )); do
INSTALL_SIMULATORS="$INSTALL_SIMULATORS --install=${SIMS[$i-1]}"
done
SD_TMP_DIR=$(mktemp -d /tmp/system-dependencies.XXXXXX)
trap 'rm -rf -- "$SD_TMP_DIR"' EXIT
TMP_FILE=$SD_TMP_DIR/simulator-runtimes.json
xcrun simctl list runtimes --json --json-output "$TMP_FILE"

if ! FAILED_SIMULATORS=$(make -C tools/siminstaller only-check INSTALL_SIMULATORS="$INSTALL_SIMULATORS" 2>/dev/null); then
local action=warn
if test -z $OPTIONAL_OLD_SIMULATORS; then
action=fail
fi
if [[ "$FAILED_SIMULATORS" =~ "Unknown simulators:" ]]; then
$action "${FAILED_SIMULATORS}"
$action " If you just updated the Xcode version, it's possible Apple stopped shipping these simulators with the new version of Xcode."
$action " If that's the case, you can list the available simulators with ${COLOR_MAGENTA}make -C tools/siminstaller print-simulators --xcode $XCODE${COLOR_RESET},"
$action " and then update the ${COLOR_MAGENTA}MIN_<OS>_SIMULATOR_VERSION${COLOR_RESET} and ${COLOR_MAGENTA}EXTRA_SIMULATORS${COLOR_RESET} variables in Make.config to the earliest available simulators."
$action " Another possibility is that Apple is not shipping any simulators (yet?) for the new version of Xcode (if the previous list shows no simulators)."
local action=warn
if test -z $OPTIONAL_OLD_SIMULATORS; then
action=fail
fi

local os
local versionName
local version

for spec in "${EXTRA_SIMULATORS[@]}"; do
os=${spec/:*/}
versionName=${spec/*:/}
version=$(grep "^${versionName}=" Make.config | sed 's/.*=//')

OS_TMP_FILE=$SD_TMP_DIR/$os-$version.json
jq ".runtimes[] | select(.platform == \"$os\" and .version == \"$version\" and .isAvailable == true and .isInternal == false) | [ { \"version\":.version, \"name\":.name, \"identifier\":.identifier } ]" < "$TMP_FILE" > "$OS_TMP_FILE"
#echo $OS_TMP_FILE
LENGTH=$(jq length < "$OS_TMP_FILE")
if [[ "$LENGTH" != "" && "$LENGTH" -gt 0 ]]; then
ok "Found the $os $version simulator."
elif test -z "$PROVISION_OLD_SIMULATORS"; then
$action "The $os $version simulator is not installed. Execute ${COLOR_MAGENTA}xcodebuild -downloadPlatform $os -buildVersion $version${COLOR_RESET} to install."
else
if ! test -z $PROVISION_OLD_SIMULATORS; then
if ! make -C tools/siminstaller install-simulators INSTALL_SIMULATORS="$INSTALL_SIMULATORS"; then
$action "Failed to install extra simulators."
else
ok "Extra simulators installed successfully: '${FAILED_SIMULATORS//$'\n'/', '}'"
fi
else
$action "The simulators '${FAILED_SIMULATORS//$'\n'/', '}' are not installed or need to be upgraded."
fi
warn "The $os $version simulator is not installed. Now executing ${COLOR_BLUE}"$XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild" -downloadPlatform $os -buildVersion $version${COLOR_RESET} to install..."
"$XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild" -downloadPlatform "$os" -buildVersion "$version"
warn "Successfully executed ${COLOR_BLUE}"$XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild" -downloadPlatform $os -buildVersion $version${COLOR_RESET}."
fi
else
ok "Found all extra simulators: ${EXTRA_SIMULATORS// /, }"
fi
done
}

echo "Checking system..."
Expand Down
22 changes: 22 additions & 0 deletions tests/introspection/ApiCtorInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,28 @@ protected virtual bool Skip (Type type)
return true;
case "ASAccountAuthenticationModificationController":
return true; // started failing in Xcode 16.3 beta 1 for unknown reasons (it works in an Xcode project).
#if __TVOS__
case "MTLAccelerationStructureDescriptor":
case "MTLAccelerationStructureGeometryDescriptor":
case "MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor":
case "MTLAccelerationStructureMotionTriangleGeometryDescriptor":
case "MTLAccelerationStructurePassDescriptor":
case "MTLAccelerationStructurePassSampleBufferAttachmentDescriptor":
case "MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray":
case "MTLAccelerationStructureTriangleGeometryDescriptor":
case "MTLMeshRenderPipelineDescriptor":
case "MTLMotionKeyframeData":
case "MTLRasterizationRateLayerArray":
case "MTLRasterizationRateMapDescriptor":
case "MTLRasterizationRateSampleArray":
case "MTLRenderPipelineFunctionsDescriptor":
case "MTLResourceStatePassSampleBufferAttachmentDescriptor":
case "MTLResourceStatePassSampleBufferAttachmentDescriptorArray":
// The initial tvOS 16.0 simulator doesn't have these classes, but the tvOS 16.1 simulator doess
if (TestRuntime.IsSimulator && !TestRuntime.CheckXcodeVersion (14, 1))
return true;
break;
#endif
}

switch (type.Namespace) {
Expand Down
8 changes: 8 additions & 0 deletions tests/introspection/ApiFieldTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ protected virtual bool Skip (PropertyInfo property)
default:
return false;
}
case "CMSampleAttachmentKey": // kCMSampleAttachmentKey_HDR10PlusPerFrameData":
switch (property.Name) {
case "Hdr10PlusPerFrameDataKey":
if (TestRuntime.IsSimulator)
return !TestRuntime.CheckXcodeVersion (14, 1); // not available in the iOS 16.0 simulator, but it is in the iOS 16.1 simulator
break;
}
break;
}
return SkipDueToAttribute (property);
}
Expand Down
34 changes: 34 additions & 0 deletions tests/introspection/ApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ protected virtual bool Skip (Type type)
if (TestRuntime.IsSimulatorOrDesktop)
return true;
break;
case "SafetyKit":
if (TestRuntime.IsSimulator)
return !TestRuntime.CheckXcodeVersion (15, 0); // doesn't seem to be available in the iOS simulator until iOS 17+
break;
}

switch (type.Name) {
Expand Down Expand Up @@ -73,6 +77,36 @@ protected virtual bool Skip (Type type)
case "GKHybridStrategist":
// We removed the bindings for this type.
return true;
#endif
#if __TVOS__
case "MTLAccelerationStructureBoundingBoxGeometryDescriptor":
case "MTLAccelerationStructureDescriptor":
case "MTLAccelerationStructureGeometryDescriptor":
case "MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor":
case "MTLAccelerationStructureMotionTriangleGeometryDescriptor":
case "MTLAccelerationStructurePassDescriptor":
case "MTLAccelerationStructurePassSampleBufferAttachmentDescriptor":
case "MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray":
case "MTLAccelerationStructureTriangleGeometryDescriptor":
case "MTLInstanceAccelerationStructureDescriptor":
case "MTLIntersectionFunctionDescriptor":
case "MTLIntersectionFunctionTableDescriptor":
case "MTLMeshRenderPipelineDescriptor":
case "MTLMotionKeyframeData":
case "MTLPrimitiveAccelerationStructureDescriptor":
case "MTLRasterizationRateLayerArray":
case "MTLRasterizationRateLayerDescriptor":
case "MTLRasterizationRateMapDescriptor":
case "MTLRasterizationRateSampleArray":
case "MTLRenderPipelineFunctionsDescriptor":
case "MTLResourceStatePassDescriptor":
case "MTLResourceStatePassSampleBufferAttachmentDescriptor":
case "MTLResourceStatePassSampleBufferAttachmentDescriptorArray":
case "MTLVisibleFunctionTableDescriptor":
// The initial tvOS 16.0 simulator doesn't have these classes, but the tvOS 16.1 simulator doess
if (TestRuntime.IsSimulator && !TestRuntime.CheckXcodeVersion (14, 1))
return true;
goto default;
#endif
default:
return SkipDueToAttribute (type);
Expand Down
57 changes: 57 additions & 0 deletions tests/introspection/ApiSelectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ protected virtual bool Skip (Type type)
return true;
}

switch (type.Namespace) {
case "SafetyKit":
if (TestRuntime.IsSimulator)
return !TestRuntime.CheckXcodeVersion (15, 0); // doesn't seem to be available in the iOS simulator until iOS 17+
break;
}

switch (type.FullName) {
case "MetalPerformanceShaders.MPSCommandBuffer":
// The reflectable type metadata contains no selectors.
Expand Down Expand Up @@ -663,12 +670,20 @@ protected virtual bool Skip (Type type, string selectorName)
case "functionCount":
case "setFunctionCount:":
return true;
#if __TVOS__
case "intersectionFunctionTableDescriptor":
return !TestRuntime.CheckXcodeVersion (14, 1);
#endif
}
break;
case "MTLResourceStatePassDescriptor":
switch (selectorName) {
case "sampleBufferAttachments":
return true;
#if __TVOS__
case "resourceStatePassDescriptor":
return !TestRuntime.CheckXcodeVersion (14, 1);
#endif
}
break;
case "MTLResourceStatePassSampleBufferAttachmentDescriptor":
Expand All @@ -687,8 +702,44 @@ protected virtual bool Skip (Type type, string selectorName)
case "functionCount":
case "setFunctionCount:":
return true;
#if __TVOS__
case "visibleFunctionTableDescriptor":
return !TestRuntime.CheckXcodeVersion (14, 1);
#endif
}
break;
#if __TVOS__
case "MTLRenderPipelineReflection":
switch (selectorName) {
case "meshBindings":
case "objectBindings":
return !TestRuntime.CheckXcodeVersion (14, 1);
}
break;
case "MTLAccelerationStructureBoundingBoxGeometryDescriptor":
case "MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor":
case "MTLAccelerationStructureMotionTriangleGeometryDescriptor":
case "MTLAccelerationStructureTriangleGeometryDescriptor":
case "MTLInstanceAccelerationStructureDescriptor":
case "MTLPrimitiveAccelerationStructureDescriptor":
switch (selectorName) {
case "descriptor":
return !TestRuntime.CheckXcodeVersion (14, 1);
}
break;
case "MTLAccelerationStructurePassDescriptor":
switch (selectorName) {
case "accelerationStructurePassDescriptor":
return !TestRuntime.CheckXcodeVersion (14, 1);
}
break;
case "MTLMotionKeyframeData":
switch (selectorName) {
case "data":
return !TestRuntime.CheckXcodeVersion (14, 1);
}
break;
#endif
case "AVPlayerLooper": // This API got introduced in Xcode 8.0 binding but is not currently present nor in Xcode 8.3 or Xcode 9.0 needs research
switch (selectorName) {
case "isLoopingEnabled":
Expand Down Expand Up @@ -1068,6 +1119,12 @@ protected virtual bool Skip (Type type, string selectorName)
}
break;
#endif
case "CMWaterSubmersionManager":
switch (selectorName) {
case "maximumDepth":
return !TestRuntime.CheckXcodeVersion (15, 0); // it's not in iOS 16, but maybe iOS 17?
}
break;
}

// old binding mistake
Expand Down
4 changes: 4 additions & 0 deletions tests/introspection/iOSApiFieldTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ protected override bool Skip (string constantName, string libraryName)
// Xcode 12.2 Beta 1 does not ship this but it is available in Xcode 12.0...
case "HKMetadataKeyBarometricPressure":
return true;
case "kCMSampleAttachmentKey_HDR10PlusPerFrameData":
if (TestRuntime.IsSimulator)
return !TestRuntime.CheckXcodeVersion (14, 1); // not available in the iOS 16.0 simulator, but it is in the iOS 16.1 simulator
goto default;
default:
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -ex

cd "$(dirname "$0")"
./system-dependencies.sh --provision-mono --ignore-xamarin-studio --ignore-xcode --ignore-osx --ignore-dotnet --ignore-shellcheck --ignore-yamllint
./system-dependencies.sh --provision-mono --ignore-xamarin-studio --ignore-xcode --ignore-osx --ignore-dotnet --ignore-shellcheck --ignore-yamllint --ignore-old-simulators
2 changes: 1 addition & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ ifdef INCLUDE_MTOUCH
SUBDIRS += mtouch
endif

SUBDIRS+=mlaunch siminstaller
SUBDIRS+=mlaunch

SUBDIRS += dotnet-linker
1 change: 0 additions & 1 deletion tools/autoformat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ dotnet format whitespace "$SRC_DIR/tools/dotnet-linker/dotnet-linker.csproj"
dotnet format whitespace "$SRC_DIR/tools/mmp/mmp.csproj"
dotnet format whitespace "$SRC_DIR/tools/mtouch/mtouch.csproj"
dotnet format whitespace "$SRC_DIR/tests/xharness/xharness.sln"
dotnet format whitespace "$SRC_DIR/tools/siminstaller/siminstaller.csproj"
dotnet format whitespace "$SRC_DIR/tests/introspection/dotnet/iOS/introspection.csproj"
dotnet format whitespace "$SRC_DIR/tests/introspection/dotnet/MacCatalyst/introspection.csproj"
dotnet format whitespace "$SRC_DIR/tests/introspection/dotnet/macOS/introspection.csproj"
Expand Down
4 changes: 2 additions & 2 deletions tools/common/SdkVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ static class SdkVersions {
public const string DotNetMinTVOS = "12.2";
public const string DotNetMinMacCatalyst = "15.0";

public const string MiniOSSimulator = "15.0";
public const string MinTVOSSimulator = "15.0";
public const string MiniOSSimulator = "16.0";
public const string MinTVOSSimulator = "16.0";

public const string MaxiOSSimulator = "18.4";
public const string MaxTVOSSimulator = "18.4";
Expand Down
22 changes: 0 additions & 22 deletions tools/siminstaller/Makefile

This file was deleted.

Loading
Loading