Skip to content

Commit

Permalink
[net7.0] Update dependencies from xamarin/xamarin-macios to Xcode 14.3 (
Browse files Browse the repository at this point in the history
#14334) (#14756)

* [net7.0] Update dependencies from xamarin/xamarin-macios to Xcode 14.3

* Use Ventura machines

* Fix build

* Cleanup

* Bump to latest macios builds

* [macios] Bump to latest version

* Fix demands

* Try bump ems

* Bump xharness

* Bump default on cake

* Run in any ventura machine the device tests

* Better fix for ImageSource sizing

* Update xharness

* XCode 14.3 and Ventura OS don't allow to run 12.4 simulators

* Run device tests on x64

* [iOS] Fix NSInternalInconsistencyException on iOS WebViewDelegate with DeviceTests

---------

Co-authored-by: Rui Marinho <[email protected]>
# Conflicts:
#	eng/Version.Details.xml
#	eng/Versions.props

Co-authored-by: Alex Soto <[email protected]>
  • Loading branch information
mattleibow and dalexsoto authored Apr 25, 2023
1 parent 1d8a89b commit 1dd6806
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "1.0.0-prerelease.22524.1",
"version": "1.0.0-prerelease.23212.1",
"commands": [
"xharness"
]
Expand Down
26 changes: 13 additions & 13 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
<Uri>https://github.com/xamarin/xamarin-android</Uri>
<Sha>58a54aef5213e50e3e59008e244a64896fe971b6</Sha>
</Dependency>
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="16.2.2035">
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="16.4.7045">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>5987dd0e47c1202759c3af9e12588eecec943bb1</Sha>
<Sha>86ef29d43cbc82594457c73813515c96c4e637ac</Sha>
</Dependency>
<Dependency Name="Microsoft.macOS.Sdk" Version="13.1.2035">
<Dependency Name="Microsoft.macOS.Sdk" Version="13.3.7045">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>5987dd0e47c1202759c3af9e12588eecec943bb1</Sha>
<Sha>86ef29d43cbc82594457c73813515c96c4e637ac</Sha>
</Dependency>
<Dependency Name="Microsoft.iOS.Sdk" Version="16.2.2035">
<Dependency Name="Microsoft.iOS.Sdk" Version="16.4.7045">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>5987dd0e47c1202759c3af9e12588eecec943bb1</Sha>
<Sha>86ef29d43cbc82594457c73813515c96c4e637ac</Sha>
</Dependency>
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.1.2532">
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.4.7045">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>5987dd0e47c1202759c3af9e12588eecec943bb1</Sha>
<Sha>86ef29d43cbc82594457c73813515c96c4e637ac</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100" Version="7.0.4" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Dependency Name="Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100" Version="7.0.5" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>ba16583f6b055e5a0623d817a48f1f2f15629e6b</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100" Version="7.0.4" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100" Version="7.0.5" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>ba16583f6b055e5a0623d817a48f1f2f15629e6b</Sha>
</Dependency>
Expand Down Expand Up @@ -87,15 +87,15 @@
<Uri>https://github.com/dotnet/templating</Uri>
<Sha>3f4da9ced34942d83054e647f3b1d9d7dde281e8</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22524.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.23212.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>49b581c1ac56352864cb692d3c523b3fc27eddf7</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22524.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.23212.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>49b581c1ac56352864cb692d3c523b3fc27eddf7</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22524.1">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.23212.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>49b581c1ac56352864cb692d3c523b3fc27eddf7</Sha>
</Dependency>
Expand Down
14 changes: 7 additions & 7 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<!-- xamarin/xamarin-android -->
<MicrosoftAndroidSdkWindowsPackageVersion>33.0.46</MicrosoftAndroidSdkWindowsPackageVersion>
<!-- xamarin/xamarin-macios -->
<MicrosoftMacCatalystSdkPackageVersion>16.2.2035</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>13.1.2035</MicrosoftmacOSSdkPackageVersion>
<MicrosoftiOSSdkPackageVersion>16.2.2035</MicrosoftiOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>16.1.2532</MicrosofttvOSSdkPackageVersion>
<MicrosoftMacCatalystSdkPackageVersion>16.4.7045</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>13.3.7045</MicrosoftmacOSSdkPackageVersion>
<MicrosoftiOSSdkPackageVersion>16.4.7045</MicrosoftiOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>16.4.7045</MicrosofttvOSSdkPackageVersion>
<!-- Samsung/Tizen.NET -->
<SamsungTizenSdkPackageVersion>7.0.105</SamsungTizenSdkPackageVersion>
<!-- emsdk -->
Expand Down Expand Up @@ -61,9 +61,9 @@
<_HarfBuzzSharpVersion>2.8.2.2</_HarfBuzzSharpVersion>
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.193b587552cb0ed39372a049d7e6c692db98c267.483</_SkiaSharpNativeAssetsVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.100-preview.5.22226.1</MicrosoftTemplateEngineTasksVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22524.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22524.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22524.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.23212.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.23212.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.23212.1</MicrosoftDotNetXHarnessCLIVersion>
<TizenUIExtensionsVersion>0.9.0</TizenUIExtensionsVersion>
<SvgSkiaPackageVersion>0.5.13</SvgSkiaPackageVersion>
<FizzlerPackageVersion>1.2.0</FizzlerPackageVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/devices/ios.cake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ string TARGET = Argument("target", "Test");

// required
FilePath PROJECT = Argument("project", EnvironmentVariable("IOS_TEST_PROJECT") ?? "");
string TEST_DEVICE = Argument("device", EnvironmentVariable("IOS_TEST_DEVICE") ?? "ios-simulator-64_14.4"); // comma separated in the form <platform>-<device|simulator>[-<32|64>][_<version>] (eg: ios-simulator-64_13.4,[...])
string TEST_DEVICE = Argument("device", EnvironmentVariable("IOS_TEST_DEVICE") ?? "ios-simulator-64_16.4"); // comma separated in the form <platform>-<device|simulator>[-<32|64>][_<version>] (eg: ios-simulator-64_13.4,[...])

// optional
var USE_DOTNET = Argument("dotnet", true);
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/common/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ variables:
- name: DOTNET_VERSION
value: 7.0.100
- name: REQUIRED_XCODE
value: 14.2.0
value: 14.3.0
- name: DEVICETESTS_REQUIRED_XCODE
value: 14.2.0
value: 14.3.0
- name: LocBranchPrefix
value: 'loc-hb'
- name: isMainBranch
Expand Down
14 changes: 7 additions & 7 deletions eng/pipelines/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ parameters:
name: $(androidTestsVmPool)
vmImage: $(androidTestsVmImage)
demands:
- macOS.Name -equals Monterey
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- name: iosPool
type: object
default:
name: $(iosTestsVmPool)
vmImage: $(iosTestsVmImage)
name: $(androidTestsVmPool)
vmImage: $(androidTestsVmImage)
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64

resources:
repositories:
Expand All @@ -88,7 +91,7 @@ stages:
${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}:
androidApiLevels: [ 30, 29, 28, 27, 26, 25, 24, 23 ]
# androidApiLevels: [ 30, 29, 28, 27, 26, 25, 24, 23, 22, 21 ] # fix the issue of getting the test results off
iosVersions: [ 'latest', '15.5', '14.5', '13.7', '12.4' ]
iosVersions: [ 'latest', '15.5', '14.5', '13.7']
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ if not(or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv')))) }}:
androidApiLevels: [ 30, 23 ]
Expand All @@ -110,18 +113,15 @@ stages:
desc: Core
androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
android: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj
iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI
ios: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj
- name: controls
desc: Controls
androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
android: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI
ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
- name: blazorwebview
desc: BlazorWebView
androidApiLevelsExclude: [ 27, 26, 25, 24, 23, 22, 21 ] # BlazorWebView requires a recent version of Chrome
android: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj
iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI
ios: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj

16 changes: 4 additions & 12 deletions eng/pipelines/handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@ stages:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
demands:
- macOS.Name -equals Monterey
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.HasDevices -equals False
- Agent.IsPaired -equals False
steps:
- template: common/provision.yml
parameters:
Expand Down Expand Up @@ -190,10 +188,8 @@ stages:
name: ${{ PackPlatform.poolName }}
vmImage: ${{ PackPlatform.vmImage }}
demands:
- macOS.Name -equals Monterey
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.HasDevices -equals False
- Agent.IsPaired -equals False
steps:
- template: common/pack.yml
parameters:
Expand Down Expand Up @@ -222,10 +218,8 @@ stages:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
demands:
- macOS.Name -equals Monterey
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.HasDevices -equals False
- Agent.IsPaired -equals False
steps:
- template: common/provision.yml
parameters:
Expand Down Expand Up @@ -274,10 +268,8 @@ stages:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
demands:
- macOS.Name -equals Monterey
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.HasDevices -equals False
- Agent.IsPaired -equals False
steps:
- template: common/provision.yml
parameters:
Expand Down
4 changes: 3 additions & 1 deletion src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public static partial class ImageSourceExtensions
var glyph = (NSString)imageSource.Glyph;

var attString = new NSAttributedString(glyph, font, color);
var imagesize = glyph.GetSizeUsingAttributes(attString.GetUIKitAttributes(0, out _));
var attributes = attString.GetUIKitAttributes(0, out _);

var imagesize = attributes == null ? attString.Size : glyph.GetSizeUsingAttributes(attributes);

UIGraphics.BeginImageContextWithOptions(imagesize, false, scale);
var ctx = new NSStringDrawingContext();
Expand Down
4 changes: 2 additions & 2 deletions src/Core/src/Platform/iOS/LabelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ internal static void UpdateTextHtml(this UILabel platformLabel, ILabel label)
StringEncoding = NSStringEncoding.UTF8
};

NSError? nsError = null;
NSError nSError = new NSError();

platformLabel.AttributedText = new NSAttributedString(text, attr, ref nsError);
platformLabel.AttributedText = new NSAttributedString(text, attr, ref nSError);
}

internal static void UpdateTextPlainText(this UILabel platformLabel, IText label)
Expand Down
13 changes: 8 additions & 5 deletions src/Core/src/Platform/iOS/MauiWebViewNavigationDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ public void DidFailProvisionalNavigation(WKWebView webView, WKNavigation navigat
public void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, Action<WKNavigationActionPolicy> decisionHandler)
{
var handler = Handler;
if (handler == null)
if (handler == null || handler?.VirtualView == null)
{
//the only place we saw this happening is on device tests,
//But the decisionHandler should always be called, or else we will get an NSInternalInconsistencyException
decisionHandler(WKNavigationActionPolicy.Cancel);
return;
}


var navEvent = WebNavigationEvent.NewPage;
var navigationType = navigationAction.NavigationType;
Expand Down Expand Up @@ -128,10 +134,7 @@ public void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction,
_lastEvent = navEvent;

var virtualView = handler.VirtualView;

if (virtualView == null)
return;


var request = navigationAction.Request;
var lastUrl = request.Url.ToString();

Expand Down

0 comments on commit 1dd6806

Please sign in to comment.