Граф коммитов

11270 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge e968a93282
[monotouch-test] Create a shared.csproj for all the .NET monotouch-test project files. (#12128)
* [monotouch-test] Create a shared.csproj for all the .NET monotouch-test project files.

Also complete the logic to build metal files, so that it works on Mac Catalyst as well.

* [monotouch-test] Add helper makefiles.

* [monotouch-test] Fix the RootTestsDirectory in the csproj.

* [monotouch-test] Add empty ItemGroup for xharness to put stuff in.

* [monotouch-test] Set DYNAMIC_REGISTRAR in each csproj, because xharness needs to be able to unset it.

* [monotouch-test] Exclude tests that don't work with AOT from Mac Catalyst/ARM64.

* [monotouch-test] Use 'ComputedPlatform' instead of 'Platform' to determine whether we're building for a device or not.

'Platform' can be anything, while we know the value of 'ComputedPlatform'. And
since 'ComputedPlatform' is computed after the csproj is read, we need to
delay the computation until later (thus in a separate target).
2021-07-19 16:43:22 +02:00
Manuel de la Pena 7ea2524ce6
[Xcode13] Bump xcode 13 to beta 3. (#12137) 2021-07-19 09:03:20 -04:00
Manuel de la Pena a96421fde0
[CoreWLan] Add XCode13 beta 1 support. (#12103)
Added support for MacCatalyst and cleaned the backlog.


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-19 09:02:47 -04:00
dotnet-maestro[bot] 01a7a14472 Update dependencies from https://github.com/dotnet/installer build 20210719.3
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-rc.1.21369.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21366.2 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-19 12:15:46 +00:00
dotnet-maestro[bot] cec5682ed1 Update dependencies from https://github.com/dotnet/installer build 20210718.3
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-rc.1.21368.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21366.2 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-19 07:36:52 +00:00
dotnet-maestro[bot] 2bb26962be Update dependencies from https://github.com/dotnet/installer build 20210717.1
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-rc.1.21367.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21363.1 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-18 12:16:45 +00:00
dotnet-maestro[bot] dc00991f26 Update dependencies from https://github.com/dotnet/installer build 20210716.58
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-rc.1.21366.58

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21363.1 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-17 12:24:48 +00:00
Rolf Bjarne Kvinge dba3bf30b1
[AppKit/UIKit] Share the implementation of some classes between AppKit and UIKit. (#12131)
* [src] Share [I]NSCollectionLayoutVisibleItem implementation between AppKit and UIKit.

* [src] Share several NSLayout* implementations between AppKit and UIKit.
2021-07-16 18:24:50 +02:00
Rolf Bjarne Kvinge 7514250d4d [msbuild] Remove unused CompileNativeCodeTaskBase.ObjectFiles property. 2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge 2014bf68c3 [tools] Compute the llvm output file and pass it to the AOT compiler / native linker 2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge 476d35909a [msbuild/dotnet] Use properties on the _AssembliesToAOT item group to specify output paths.
This deduplicates a little bit code to compute the output path.
2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge ce15ba272e [dotnet] Remove unused AOTCompileTaskBase.AOTData property. 2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge 2116ba59de [tools] Pass the AOTCompiler property to the ComputeAOTArguments linker steps.
So that the ComputeAOTArguments can compute the llvm-path value to pass to the AOT
compiler (the llvm-path value states where the opt and llc command-line tools are,
and they're next to the AOT compiler).
2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge f292635e48 [tests] Add helper makefiles for building monotouch-test and MySimpleApp in .NET from the command line. 2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge ca607b3e86
[tests] Fix warning about unused variable. (#12117) 2021-07-16 16:27:26 +02:00
Rolf Bjarne Kvinge 8fc2f8872e
[generator] Fix nullability warning. (#12116)
Enable nullability in btouch.cs, and fix the resulting warnings.

Fixes these warnings (because there were already nullability annotations in
btouch.cs):

    src/btouch.cs(640,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
    src/btouch.cs(642,9): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
2021-07-16 16:27:10 +02:00
Rolf Bjarne Kvinge d307a844ad
[dotnet] Enable nullability in template projects. (#12118)
And fix any warnings that came up.
2021-07-16 16:17:14 +02:00
Rolf Bjarne Kvinge ef0a179610
[Foundation] Sprinkle [NullAllowed]. (#12119) 2021-07-16 16:16:00 +02:00
Rolf Bjarne Kvinge 8b3d572ff3
[xtro] Rebuild xtro-sharpie when any of the sources change (#12120) 2021-07-16 16:15:45 +02:00
Rolf Bjarne Kvinge d775794fd2
[dotnet] Create and parse runtimeconfig.bin when using CoreCLR. (#12122)
We need to process the runtimeconfig.json file somehow when using CoreCLR, and
the embedding API we use (coreclr_initialize) won't parse it for us. So re-use
the logic we already have to process runtimeconfig.json for MonoVM (which
involves converting it to a binary format at build time, which we then process
at runtime).
2021-07-16 16:15:17 +02:00
Rolf Bjarne Kvinge 4048b83fdd [dotnet] Parse MtouchUseLlvm. 2021-07-16 14:50:55 +02:00
Rolf Bjarne Kvinge 7c30f55359 [xharness] Add test case for running monotouch-test with LLVM on .NET on device. 2021-07-16 14:50:55 +02:00
dotnet-maestro[bot] 0c04462461 Update dependencies from https://github.com/dotnet/installer build 20210715.23
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-preview.7.21365.23

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21363.1 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-16 12:24:26 +00:00
Rolf Bjarne Kvinge 9d7efe6de0
[devops] Fix detection of breaking changes in the api comparison. (#12123)
Surrounding a glob with quotes will make bash interpret the glob as a literal
filename, and not expand it, so move the quotes to not include the glob.
2021-07-16 09:34:11 +02:00
Rolf Bjarne Kvinge 6eae590024
[ObjCRuntime] Fix Runtime.GetIsARM64CallingConvention to be correct on M1. (#12124)
Fix Runtime.GetIsARM64CallingConvention to be the same on all platforms, and
also we can't use simulator/device to determine anything, since the simulator
can do ARM64 on an M1 now.
2021-07-16 09:33:22 +02:00
Rolf Bjarne Kvinge 6485ff2332
[runtime] Fix Runtime.Arch to be consistent on Mac Catalyst and work properly on ARM-based simulators. (#12125)
* Use the Apple-provided TARGET_OS_SIMULATOR define to determine if we're
  running in a simulator, instead of checking the current architecture. This
  way we properly detect ARM64-based simulators (and it'll work correctly in
  the future).

* Always set Runtime.Arch = SIMULATOR for Mac Catalyst. The final value for
  Runtime.Arch for Mac Catalyst is tracked in #10312, but this is a stop-gap
  measure to make sure we have the same value between X64 and ARM64 on Mac
  Catalyst, and until now we've had Runtime.Arch = SIMULATOR for X64, so just
  go with that for now.
2021-07-16 09:33:11 +02:00
Rolf Bjarne Kvinge c17f905540
[Foundation] Improve error reporting when we fail to instantiate a type. Fixes #12112. (#12126)
Fixes https://github.com/xamarin/xamarin-macios/issues/12112.
2021-07-16 09:31:08 +02:00
Rolf Bjarne Kvinge 2995dd1afc
Bump maccore. (#12127)
New commits in xamarin/maccore:

* xamarin/maccore@99ad0341f4 [Xamarin.Hosting] Improve error reporting when dlopen fails (#2466)
* xamarin/maccore@8dd9c68035 [Xamarin.Hosting] Xcode 13 b3 doesn't have IBFoundation anymore, but it does have AssetCatalogFoundation, which we must load. (#2467)
* xamarin/maccore@da6da4af29 [Xamarin.Hosting] Only warn if we try to load a framework that doesn't exist. (#2465)
* xamarin/maccore@5cec54f305 [Xamarin.Hosting] Add some helpful lldb commands when trying to figure out what Xcode does. (#2456)

Diff: c7809739bd..99ad0341f4
2021-07-16 09:30:01 +02:00
Rolf Bjarne Kvinge da7c714506
[AppKit/UIKit] Share the implementation of some classes between AppKit and UIKit. (#12129)
* [xkit] Merge uikit's and appkit's definition of NSCollectionLayoutGroup into xkit.cs

* [xkit] Merge uikit's and appkit's definition of NSCollectionLayoutSection into xkit.cs

* [src] Share NSCollectionLayoutGroupCustomItem implementation between AppKit and UIKit.

* [src] Share [I]NSCollectionLayoutContainer implementation between AppKit and UIKit.

* [src] Share [I]NSCollectionLayoutEnvironment implementation between AppKit and UIKit.
2021-07-16 09:29:01 +02:00
dotnet-maestro[bot] cde7a007d5 Update dependencies from https://github.com/dotnet/installer build 20210714.30
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-preview.7.21364.30

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21363.1 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-15 12:25:18 +00:00
Rolf Bjarne Kvinge dacf374139
[src] Specialize the tvOS version of ILLink.LinkAttributes.xml. (#12108)
Specialize the tvOS version of ILLink.LinkAttributes.xml, where we don't
include the "ObjCRuntime.AvailabilityAttribute" type (because it doesn't exist
in tvOS).

Fixes this linker warning:

    resource ILLink.LinkAttributes.xml in Xamarin.TVOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065(37,6): warning IL2008: Could not resolve type 'ObjCRuntime.AvailabilityAttribute'
2021-07-14 18:07:38 +02:00
Rolf Bjarne Kvinge 7ac3417ee9
[dotnet/templates/tests] Update template code. (#12109)
* Move the templates to a common subdirectory.
* Add .NET unit test to verify that all the templates build and that they have
  no warnings.
* Modify the template code to:
   * Use the UIApplication.Main overload that takes a Type.
   * Use top-level statements for the Main method to simplify code.
   * Remove a few unnecessary usings.

Partial fix for #12085.
2021-07-14 17:58:31 +02:00
Rolf Bjarne Kvinge e0e0a716c9
[src] Create a compiler error in a way that doesn't trip up text editors (#12107) 2021-07-14 17:53:21 +02:00
Rolf Bjarne Kvinge d9664843e2
[runtime] Add logging when a P/Invoke can't be resolved in xamarin_pinvoke_override. (#12106)
Return early when we're not going to try resolving anything, which means that
if we didn't find something by the end, we know that it's because we failed
(and not because we weren't supposed to try), and we log that.

This makes it easier to diagnose a few failure conditions.
2021-07-14 17:52:40 +02:00
Rolf Bjarne Kvinge fc8fb4818c
[runtime] Set the current directory to the root directory of the app bundle for all platforms in .NET. (#12104)
To have consistent behavior in .NET, set the current directory to the root of
the app bundle for all platforms.

This is a breaking change for legacy Xamarin.Mac, which used to set the
current directory to the Contents/Resources subdirectory, but there's a simple
workaround for customers that depend on the old behavior (change it in Main
themselves), and I believe the consistent experience across platforms warrants
this change.

Note that we already had a breaking change here for macOS/.NET: we were
(unintentionally) setting the current directory to the Contents/MonoBundle
directory, which neither matched mobile platforms, nor the legacy Xamarin.Mac
behavior.

This solves the problem of what to do for Mac Catalyst apps, because there's
no need to choose between the macOS or the mobile behavior, since they're the
same.

This required changing the launch of macOS apps using CoreCLR to pass the full
path to the entry assembly, since the entry assembly isn't in the current
directory anymore.
2021-07-14 17:42:49 +02:00
dotnet-maestro[bot] 76ab64311c Update dependencies from https://github.com/dotnet/installer build 20210714.4
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-preview.7.21364.4

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21363.1 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-14 12:25:55 +00:00
TJ Lambert a202354c71
[IOSurface] Updates for Xcode13 Beta 1 (#12096) 2021-07-13 12:57:57 -05:00
TJ Lambert ecd8dccccf
[GameKit] Updates for Xcode13 Beta 1-2 (#12091) 2021-07-13 12:44:35 -05:00
Rolf Bjarne Kvinge 78e2251671
[xharness] Don't fail when trying to set a RuntimeIdentifier if there isn't already a RuntimeIdentifier in the csproj. (#12105) 2021-07-13 18:51:03 +02:00
Rolf Bjarne Kvinge 423bd571ec Merge remote-tracking branch 'origin/main' into darc-main-2c3dc6cd-c245-4d20-9461-75a98d067b3b 2021-07-13 14:30:18 +02:00
Rolf Bjarne Kvinge f67a47f8a6 [dotnet] Import Microsoft.NET.Runtime.MonoTargets.Sdk instead of Microsoft.NET.Runtime.RuntimeConfigParser.Task
Microsoft.NET.Runtime.RuntimeConfigParser.Task doesn't exist anymore.
2021-07-13 14:30:13 +02:00
dotnet-maestro[bot] 3f16637f7c Update dependencies from https://github.com/dotnet/installer build 20210712.12
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.7.21330.1 -> To Version 6.0.100-preview.7.21362.12

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21329.2 -> To Version 6.0.100-preview.6.21362.2 (parent: Microsoft.Dotnet.Sdk.Internal
2021-07-13 12:24:34 +00:00
Jonathan Peppers 33f8143b97
[dotnet] no default $(RuntimeIdentifier) for class libraries (#12093)
Context: https://github.com/dotnet/maui/pull/1578

In the latest xamarin-macios bump, the dotnent/maui build started
failing because the `$(OutputPath)` of all the projects changed from:

    bin/Debug/net6.0-ios/
    bin/Debug/net6.0-maccatalyst/

To:

    bin/Debug/net6.0-ios/iossimulator-x64/
    bin/Debug/net6.0-maccatalyst/maccatalyst-x64/

Class library projects appear to have `$(RuntimeIdentifier)` set by
default. I don't think this is needed, because class libraries do not
need to be compiled as `--self-contained` apps.

On the Android side, we only set a default `$(RuntimeIdentifiers)` for
application projects:

7c5fab1332/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets (L49-L61)

I think the correct change here is to check:

    '$(OutputType)' == 'Exe' Or '$(IsAppExtension)' == 'true'

So Apple platforms only put a default `$(RuntimeIdentifier)` for
applications or extensions.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-13 13:14:08 +02:00
Rolf Bjarne Kvinge 236626f3a5 Merge remote-tracking branch 'origin/main' into darc-main-2c3dc6cd-c245-4d20-9461-75a98d067b3b 2021-07-13 00:36:45 +02:00
Rolf Bjarne Kvinge ba3f7bf1ca [monotouch-test] Expand the ignored tests when we don't have culture data.
Fixes this test failure:

    [FAIL] Embedded : System.Globalization.CultureNotFoundException : Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
        en is an invalid culture identifier.
        at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) in System.Private.CoreLib.dll:token 0x60027b4+0x2f
        at System.Globalization.CultureInfo..ctor(String name) in System.Private.CoreLib.dll:token 0x60027b3+0x0
        at EmbeddedResources.ResourcesTest.Embedded() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/EmbeddedResources/ResourcesTest.cs:line 44
        at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004f05+0x6a
2021-07-13 00:01:45 +02:00
Rolf Bjarne Kvinge cfcedfbe53 [monotouch-test] Use CultureInfo.InvariantCulture instead of 'en-US' to parse invariant numbers.
Fixes this test failure:

	[FAIL] FloatingPointStretTrampolineTest : System.Globalization.CultureNotFoundException : Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
        en-US is an invalid culture identifier.
           at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) in System.Private.CoreLib.dll:token 0x60027b4+0x2f
           at System.Globalization.CultureInfo..ctor(String name) in System.Private.CoreLib.dll:token 0x60027b3+0x0
           at MonoTouchFixtures.ObjCRuntime.FloatingPointStretTrampolines.ParseString(String str) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 640
           at MonoTouchFixtures.ObjCRuntime.FloatingPointStretTrampolines.Test_CGRect_IntPtr(NSString str) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 664
        --- End of stack trace from previous location ---
           at MonoTouchFixtures.ObjCRuntime.TrampolineTest.FloatingPointStretTrampolineTest() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 242
           at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004f05+0x6a
2021-07-12 23:59:50 +02:00
Rolf Bjarne Kvinge 235a0f4942 [dotnet] Partially remove workaround for problems when setting the default RuntimeIdentifier. 2021-07-12 23:39:20 +02:00
Rolf Bjarne Kvinge 9207b5940e
[tests] Fix the Native*ReferencesApp tests to have an Info.plist with a minimum OS version. (#12099)
* We need to specify a minimum OS version, because otherwise we'll pick the
  latest OS version we support, and at least for macOS, we might very well try
  to execute on earlier OS versions, leading to confusing failures like this:

    Xamarin.Tests.DotNetProjectTest.BuildAndExecuteNativeReferencesTestApp("NativeDynamicLibraryReferencesApp",MacOSX,"osx-x64"): Contains magic word
        Expected: String containing "dc8bd019-bea2-4c86-92dc-dda22e2e6b88"
        But was: "dyld: Library not loaded: /System/Library/Frameworks/CHIP.framework/Versions/A/CHIP
        Referenced from: /Users/builder/azdo/_work/1/s/xamarin-macios/tests/dotnet/NativeDynamicLibraryReferencesApp/macOS/bin/Debug/net6.0-macos/osx-x64/NativeDynamicLibraryReferencesApp.app/Contents/MacOS/NativeDynamicLibraryReferencesApp
        Reason: image not found

* We only need a minimum OS version (for now at least) in the Info.plist, so
  remove everything else.
2021-07-12 23:05:35 +02:00
TJ Lambert 26a8abe76e
using swift names (#12095)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-07-12 11:18:02 -05:00
Rolf Bjarne Kvinge 6074ed5c04
[dotnet] Copy fewer runtime libraries to the publish directory. (#12059)
* Don't copy runtime dylibs to the publish directory if we're linking statically.
* Don't copy static libraries to the publish directory, they're never needed at
  runtime.
2021-07-12 17:09:45 +02:00