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

11414 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 3d822de007
[runtime] List all assemblies in TRUSTED_PLATFORM_ASSEMBLIES as pass it to MonoVM/CoreCLR. Fixes #12265. (#12272)
List all the assemblies in the app bundle and pass them to MonoVM/CoreCLR's in
the TRUSTED_PLATFORM_ASSEMBLIES initialization property.

This way CoreCLR knows where to find System.Private.CoreLib.dll for fat apps
(it's in the runtimeidentifier-specific subdirectory, and by default CoreCLR
will only look next to libcoreclr.dylib).

Fixes https://github.com/xamarin/xamarin-macios/issues/12265.
2021-07-29 07:45:24 +02:00
Manuel de la Pena 38140f2cce
[Xcode13] Bump for Xcode 13 beta4. (#12273) 2021-07-28 16:58:00 -04:00
Manuel de la Pena f7c6e8ab6b
[xtro] Append the lines and then sort them to get everything grouped better. (#12274) 2021-07-28 16:18:00 -04:00
Peter Collins 2120c8faf2
[CI] Run post build job after prepare release (#12252)
Commit 2af23dbd introduced a new "Prepare Release" stage that will
sign .NET 6 NuGet packages, and push them to the xamarin-impl feed.
The post build pipeline that pushes build metadata to Maestro for
downstream dependency updating should run after this stage.  There is
no reason to push build information to Maestro without also pushing
packages to a feed for external consumption.
2021-07-28 16:00:33 -04:00
Rolf Bjarne Kvinge aebc0117dc [msbuild] Disable the CreateIpa target on macOS and Mac Catalyst. 2021-07-28 18:27:35 +02:00
Manuel de la Pena 3336910dd8
[Xtro] If the sanitizer removed all selectors, remove the file. (#12256)
A new check was added to ensure that empty .todo files are not added,
yet when the sanitizer removes all lines we get an error per empty file.

Since we are auto-sanitizing, we want to remove those empty files.
2021-07-28 11:21:56 -04:00
Rolf Bjarne Kvinge 9dcc4d07b4
[runtime] Fix the arguments to the managed main function when using CoreCLR. Fixes #12219. (#12239)
Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/12219.
2021-07-28 17:12:29 +02:00
VS MobileTools Engineering Service 2 c5e60a1462
[Localization] Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 5018259 (#12220) 2021-07-28 09:57:35 -05:00
Rolf Bjarne Kvinge d24b2203af
[monotouch-test] No need to ignore NSTimeZoneTest.All_28300 anymore. (#12241) 2021-07-28 15:01:28 +02:00
Rolf Bjarne Kvinge 8c1d05a6e1
[ObjCRuntime] Implement Runtime.UseAutoreleasePoolInThreadPool for .NET. (#12248)
The getter just returns the runtime appcontext value, while the setter throws
a PlatformNotSupportedException pointing at our documentation about how to
change the value at build time.
2021-07-28 14:30:35 +02:00
dotnet-maestro[bot] 68476989f4
[main] Update dependencies from dotnet/installer (#12245)
* Update dependencies from https://github.com/dotnet/installer build 20210727.4

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21376.3 -> To Version 6.0.100-rc.1.21377.4

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21370.1 -> To Version 6.0.100-preview.6.21376.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Bump Mono.Cecil from 0.11.3 to 0.11.4.

* [dotnet-linker] Reference Mono.Cecil 0.11.4 directly.

Works around https://github.com/mono/linker/issues/2173.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-28 09:46:36 +02:00
Rolf Bjarne Kvinge 2ca8970122
[tests] Add a .NET version of introspection for Mac Catalyst. (#12039)
* [tests] Add a .NET version of introspection for Mac Catalyst.

It shows a lot of failures (so it's disabled by default), but this way we can
at least start to fix the failures.

* [xharness] Always ignore the new test.

* [xharness] Ignored projects should be ignored.
2021-07-28 09:39:29 +02:00
Rolf Bjarne Kvinge c202ba4a93
[generator] Skip protocols that aren't available on the current platform. (#12208)
That way we can do this in api definitions:

    [BaseType (typeof (NSObject))]
    interface MyType : MyProtocol { }

    [Protocol]
    [NoMacCatalyst]
    interface MyProtocol {}

instead of this:

    [BaseType (typeof (NSObject))]
    interface MyType
    #if __MACOS__
        : MyProtocol
    #endif
    {
    }

    [Protocol]
    [NoMacCatalyst]
    interface MyProtocol {}

for a type that implements a protocol on macOS, but not on Mac Catalyst.
2021-07-28 09:35:41 +02:00
Rolf Bjarne Kvinge 0bd4d1b101
[dotnet] Make it clearer that the linker is off by default for Mac Catalyst (like it already is for macOS). (#12242)
There's no real change here, the code did exactly this in before, but it was a
side effect of '_SdkIsSimulator' being 'true' for Mac Catalyst, which isn't
obvious. Now the logic is explicit for all platforms.
2021-07-28 09:28:13 +02:00
Rolf Bjarne Kvinge 6a40d45337
[AppKit/Foundation] Numerous API adjustments. (#12243)
* Merged a MonoMac-only version of NSMutableCharacterSet + a non-MonoMac version
  of NSMutableCharacterSet into a single definition.
* Add a few [NullAllowed] where new API triggered xtro warnings (I either had to
  add more ignores to xtro, or fix the issues - I decided to fix the issues).
* Remove numerous "#if MONOMAC" blocks and switched to availability attributes.
* Merged a MonoMac-only list of NSWindow fields and a non-MonoMac list of NSWindow
  fields into a single definition (which was quite useless because NSWindow is only
  present on macOS, so the non-MonoMac list was just dead code). 
* Misc other availability attribute additions/fixes.
2021-07-28 09:18:48 +02:00
Rolf Bjarne Kvinge 25f19ae78a Merge remote-tracking branch 'origin/main' into dotnet-archive 2021-07-28 09:18:19 +02:00
Rolf Bjarne Kvinge 65b7daf620 [msbuild] We're using 'EnableSGenConc' internally now, 'MtouchEnableSGenConc' might not be set. 2021-07-28 09:17:53 +02:00
Rolf Bjarne Kvinge 7986b2f2af
[dotnet] Globalization works for Mac Catalyst now. Fixes #11392. (#12247)
Fixes https://github.com/xamarin/xamarin-macios/issues/11392.
2021-07-28 09:12:22 +02:00
Rolf Bjarne Kvinge 600ce3290b
[monotouch-test] Adjust CalendarTest.DateComponentsTest to use a specific time zone. (#12249)
Hopefully avoids random test failures like https://github.com/xamarin/maccore/issues/2471#issuecomment-887517838.
2021-07-28 09:08:52 +02:00
Rolf Bjarne Kvinge 7260f267d9
[tests] Remove workaround for #dotnet/runtime@47120, it's been fixed. (#12253) 2021-07-28 09:08:13 +02:00
Rolf Bjarne Kvinge 08dba89c98
[tests] Add dummy variable to put System.Runtime.CompilerServices.Unsafe.dll next to the test assembly. (#12251)
Otherwise this happens when running tests from within the IDE:

error BI0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
  at System.ReadOnlySpan`1[T].op_Implicit (T[] array) [0x00000] in <16786cfd571c4686983021cfcee42fb4>:0
  at System.Reflection.TypeLoading.CoreTypes..ctor (System.Reflection.MetadataLoadContext loader, System.String coreAssemblyName) [0x0003d] in <49552709e6e14610b2a2f34b9d5f4c52>:0
  at System.Reflection.MetadataLoadContext..ctor (System.Reflection.MetadataAssemblyResolver resolver, System.String coreAssemblyName) [0x00046] in <49552709e6e14610b2a2f34b9d5f4c52>:0
  at BindingTouch.Main3 (System.String[] args) [0x00e91] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:454
  at BindingTouch.Main2 (System.String[] args) [0x00007] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:199
  at BindingTouch.Main (System.String[] args) [0x00002] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:91
  at System.Environment.get_StackTrace () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/Environment.cs:316
  at ErrorHelper.ShowInternal (System.Exception e) [0x0010f] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/error.cs:175
  at ErrorHelper.Show (System.Exception e, System.Boolean rethrow_errors) [0x00089] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/error.cs:125
  at BindingTouch.Main (System.String[] args) [0x0000d] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:93
  at Xamarin.Tests.BGenTool.Execute () [0x000a1] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTool.cs:228
  at Xamarin.Tests.BGenTool.AssertExecute (System.String message) [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTool.cs:207
  at GeneratorTests.BGenTests.BuildFile (Xamarin.Tests.Profile profile, System.Boolean nowarnings, System.Boolean processEnums, System.Collections.Generic.IEnumerable`1[T] references, System.String[] filenames) [0x000ab] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:764
  at GeneratorTests.BGenTests.BuildFile (Xamarin.Tests.Profile profile, System.Boolean nowarnings, System.Boolean processEnums, System.String[] filenames) [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:750
  at GeneratorTests.BGenTests.BuildFile (Xamarin.Tests.Profile profile, System.String[] filenames) [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:740
  at GeneratorTests.BGenTests.IgnoreUnavailableProtocol () [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:636
  at System.Reflection.RuntimeMethodInfo.InternalInvoke (System.Reflection.RuntimeMethodInfo , System.Object , System.Object[] , System.Exception& ) [0x00000] in <08f46039e5064c628bf7795f9b970b7b>:0
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Reflection/MethodBase.cs:53
  at NUnit.Framework.Internal.Reflect.InvokeMethod (System.Reflection.MethodInfo method, System.Object fixture, System.Object[] args) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.MethodWrapper.Invoke (System.Object fixture, System.Object[] args) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Commands.TestMethodCommand.InvokeTestMethod (NUnit.Framework.Internal.TestExecutionContext context) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod (NUnit.Framework.Internal.TestExecutionContext context) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute (NUnit.Framework.Internal.TestExecutionContext context) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.WorkItem.Execute () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/thread.cs:74
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:899
  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/thread.cs:111
2021-07-28 09:00:29 +02:00
Manuel de la Pena f611cd8cae
[CI] Do not even try to do net6 publishing on not main builds. (#12250) 2021-07-27 15:03:03 -04:00
Peter Collins d886ae6d7a
[CI] Use NuGet to MSI conversion v2 (#12205) 2021-07-27 13:04:42 -04:00
Manuel de la Pena 3b0d79df6a
[CI] Run tests on M1 machines with BS. (#12230) 2021-07-27 11:10:08 -04:00
github-actions[bot] 9598c9bd7f
[Localization] Pulling New Localization Translations 1061159247 (#12214)
Co-authored-by: CSIGS <csigs@outlook.com>
2021-07-27 11:01:05 -04:00
Rolf Bjarne Kvinge 2900ccb173
[xharness] Bump timeout for the .NET unit tests. (#12240)
Adding more and more tests make the tests take longer and longer...
2021-07-27 15:46:03 +02:00
Sebastien Pouliot 1fa43189b5
[generator] Do not generate `BindingImplOptions.Optimizable` when code snippets are provided (#12165)
unless the snippet-based attribute also set the `Optimizable` property.

IOW this is now required to _opt-in_ (to optimize) instead of default,
with no ~easy~ way to turn it off.

Re-enabled each of the `[Dispose]` cases after protecting the required
extra calls they make.

Fix https://github.com/xamarin/xamarin-macios/issues/12150

* Add test for [Dispose] and SnippetAttribute subclasses

* Opt-in all [*Snippet] to be optimizable

This is exactly what we have been shipping for years (no changes).

Unlike [Dispose] there is no change in the generated code or the
optimizations.

Future snippets should come with tests - which is _normal_ for any
manual code (which they are) added to the SDK
2021-07-27 09:36:22 -04:00
Rolf Bjarne Kvinge d1e74874dc [msbuild] Move the CreateIpa target to shared code.
There was a main version of this target for Xamarin.iOS, and then numerous dummy targets for two scenarios:

* Building app extensions.
* Building macOS apps.

The first one is handled by the '_CanArchive' property (will be false when
building app extensions), and for the second case I've added it to the
condition on the CreateIpa target.

This way we don't have to have logic elsewhere about when it's valid to call
CreateIpa.
2021-07-27 14:42:58 +02:00
Rolf Bjarne Kvinge 0c9fff29ff [msbuild] Move a few more properties to the shared files so that they're before they participate in conditions. 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 9158dcc6ff [msbuild] Make code signing required when archiving a macOS or Mac Catalyst app.
We fail later with an uninformative error ('The "Archive" task was not given a
value for the required parameter "SigningKey"') otherwise, and this way the
user doesn't have to manually enable signing to avoid the this error.
2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 1aaf9404ac [msbuild] Don't execute the CollectITunesSourceFiles target on desktop platforms. 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge d22cf7da8c [dotnet] Add unit tests for archiving, package creation and ipa creation. 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 46128ac62e [msbuild] Add dummy CreateIpa target for Mac. 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge d7599050a7 [msbuild] Slightly rework the logic to determine if code signing is required to take Mac Catalyst into account 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 1db432a1bd [msbuild] Share the logic to determine whether a provisioning profile is required 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 38acfafd38 [msbuild] Move/document a few properties related to signing and packaging. 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge a6b10696aa [msbuild] Accept both 'CodeSigningKey' and 'CodesignKey' as synonyms.
This makes it easier to use the same csproj for multiple platforms for customers.
2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge b62b6213e2 [msbuild] Move the EnablePackageSigning variable to shared code.
So that it's set for both macOS and Mac Catalyst.
2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge ea61948502 [msbuild] Merge the EnableSGenConc properties.
We use two different properties for the same thing: MtouchEnableSGenConc and
EnableSGenConc. Going forward, we're sticking with just EnableSGenConc, but
we'll keep accepting MtouchEnableSGenConc if it's set.
2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge a2a2221c5e [msbuild] Unify the IsAppExtension property 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 1e8698ae9b [msbuild] Unify the ArchiveOnBuild property 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 3accf61ffd [msbuild] Unify the _CanOutputAppBundle property. 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 12f49a327e [dotnet] Add the CreateIpa, _CreateInstaller and Archive targets to the things we need to do at build time
* CreateIpa: only executed if 'BuildIpa' is set.
* _CreateInstaller: only executed if 'CreatePackage' is set.
* Archive: only executed if 'ArchiveOnBuild' is set.

We don't do this for inner builds of multi-rid builds, only single-rid builds or
outer builds of multi-rid builds.
2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 7e52c08a52 [msbuild/dotnet] Mac Catalyst entitlements must be embedded in the app signature, not the executable.
Just like they are for macOS apps.
2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 1e496ba458 [msbuild] Move the logic to create .pkg files from Mac-specific target files to shared target files.
Because we need it for Mac Catalyst as well.
2021-07-27 13:52:46 +02:00
dotnet-maestro[bot] edc088ad7b
[main] Update dependencies from dotnet/installer (#12195)
* Update dependencies from https://github.com/dotnet/installer build 20210722.14

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21372.2 -> To Version 6.0.100-rc.1.21372.14

* Update dependencies from https://github.com/dotnet/installer build 20210723.26

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21372.2 -> To Version 6.0.100-rc.1.21373.26

* Update dependencies from https://github.com/dotnet/installer build 20210724.6

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21372.2 -> To Version 6.0.100-rc.1.21374.6

* Update dependencies from https://github.com/dotnet/installer build 20210726.3

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21372.2 -> To Version 6.0.100-rc.1.21376.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-07-27 07:53:27 +02:00
Rolf Bjarne Kvinge 1f8c7130f4
[xtro] Improve the auto-sanitizer. (#12226)
Now with support for auto-sanitizing todo files.
2021-07-27 07:46:04 +02:00
Rolf Bjarne Kvinge abcd04d049
[Foundation] Add EnumDesktop.cs to the API sources to handle it with the generator. (#12223)
This also meant merging the definitions for NSDocumentType.
2021-07-27 07:44:52 +02:00
Rolf Bjarne Kvinge 0549af9736
[dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12211)
* Add support for the interpreter everywhere.
* Add support for the AOT compiler everywhere we didn't support it before,
  because the interpreter needs it (at least System.Private.CoreLib.dll must
  be AOT-compiled when using the interpreter).
* Do FullAOT compilation on Mac Catalyst/ARM64 if we're not using the
  interpreter, since we can't use the JIT.
* Fix monotouch-test to be green on Mac Catalyst/ARM64.

Fixes https://github.com/xamarin/xamarin-macios/issues/11724.
Fixes https://github.com/xamarin/xamarin-macios/issues/11421.
2021-07-27 07:39:43 +02:00
Rolf Bjarne Kvinge 52ad560f3b
[monotouch-test] Make CalendarTest.TestOrdinality location-agnostic. Fixes #xamarin/maccore@2471. (#12192)
Modifying the test to use UTC datetimes instead of local datetimes + specify
the timezone for the NSCalendar to make the results predictable everywhere and
at all times.

Fixes https://github.com/xamarin/maccore/issues/2471.
2021-07-27 07:37:15 +02:00