How we create the app manifest (Info.plist) has to be modified so that we can add
support for getting all the values from MSBuild properties (i.e. no Info.plist in
the project), as well as having multiple partial app manifests as well, that gets
merged into the final app manifest.
Here's the new process:
1. The user can specify values in multiple ways:
* An Info.plist in their project file (by using a `None` item with
filename "Info.plist" or with a `Link` metadata with filename
"Info.plist"). We figure this out in the DetectAppManifest target.
* A partial plist in their project (using the `PartialAppManifest` item group)
* Some MSBuild properties can also add values.
The precedence is: MSBuild properties can be overridden by the Info.plist,
which can be overridden by a partial plist.
2. In the `CompileAppManifest` target we get all the inputs from above, and compute
a temporary app manifest, which is written to a temporary output file.
3. In the `ReadAppManifest` target, we read the temporary output file and outputs
numerous MSBuild properties (most of then private)
4. We run other targets that may add more entries to the final app manifest (these
tasks might depend on the values from `ReadAppManifest`). These entries are written
to partial plists, and added to the _PostCompilePartialAppManifest item group.
The targets in question are:
* _CompileImageAssets * _CompileCoreMLModels
5. In the new `WriteAppManifest` target, we read the temporary output file from `ReadAppManifest`
+ any `_PartialAppManfiest` items and merge them all together to get the final Info.plist.
This also required moving the computation of CFBundleIdentifier from the DetectSigningIdentity
task to the CompileAppManifest task. This also meant reordering these two tasks,
so that the DetectSigningIdentity task is executed after the CompileAppManifest task
(technically after the ReadAppManifest task), because the DetectSigningIdentity task
needs to know the bundle identifier.
This way we can handle multiple scenarios easily (most of this is not covered by
these changes, and will be implemented separately):
* No Info.plist at all, all non-default values come from MSBuild properties.
* A single Info.plist, where everything is specified.
* An Info.plist with multiple partial app manifests as well.
Improve Cache.CreateTemporaryDirectory to move the deletion of the previous
root temporary directory to a background thread. In some cases this directory
can have a lot of files and directories, and deleting it synchronously can
cause a significant startup delay when running tests locally.
At startup, we load old test results that may exist on disk. However, this may
take a while, especially since the disk is usually quite busy already with
everything else we do at startup, so don't wait for this to finish before
displaying the UI.
* [xharness] Add LLVM test case for Mac Catalyst.
* [tests] Add make target to build monotouch-test using LLVM on Mac Catalyst.
* [tools] Pass the right arguments to the AOT compiler for Mac Catalyst. Fixes#12484.
Mac Catalyst is just special.
Fixes https://github.com/xamarin/xamarin-macios/issues/12484.
Both the CompileProductDefinition and the CreateInstaller tasks must take the
final app manifest as input, because there may now be multiple input manifests
(or one day none at all), and the final app manifest is the only version that
is guaranteed to exist and contain everything.
Augment the Native attribute for enums to support custom conversion functions between
native values and managed values for enums. This makes it possible to have different
values in managed code for an enum compared to native code.
This is necessary to support different native enum values based on the architecture,
because in a few cases Apple has different enum values between x86_64 and ARM64.
Enum values are constants in managed code, and without this support it would be impossible
to translate these correctly to native code.
The updated Native attribute supports two new fields: ConvertToNative and ConvertToManaged,
which are managed functions of a specific signature that the generator will emit
calls to whenever needed to do the appropriate conversion.
Fixes https://github.com/xamarin/xamarin-macios/issues/12111.
* Read CFBundleDisplayName and CFBundleVersion and use them in the
_CompileITunesMetadata task.
* Read numerous other app manifest values and pass them to the ACTool and
IBTool tasks.
This makes it possible to not parse the Info.plist in these tasks, which will
become more complicated in the future, when we might either not have an
Info.plist, or have many partial ones.
Also enable nullability.
* [dotnet] Make CoreCLR the default for macOS.
* [dotnet] Show an error if trying to use MonoVM on macOS.
Fixes https://github.com/xamarin/xamarin-macios/issues/12477.
* [xharness] Remove CoreCLR variations for macOS tests.
The default is using CoreCLR for macOS, so having a specific variation for it
doesn't make sense.
* [tests] Adjust linker tests to work on CoreCLR as well.
Instead of generating one native P/Invoke signature with an int parameter and
another with a long parameter for methods that take [Native] enums, generate a
single nint parameter (and the same for the unsigned version).
This simplifies both the generator code and the generated code. The generator
diff contains *a lot* of changes like this:
- if (IntPtr.Size == 8) {
- ret = (ARAppClipCodeUrlDecodingState) global::ObjCRuntime.Messaging.Int64_objc_msgSend (this.Handle, Selector.GetHandle ("urlDecodingState"));
- } else {
- ret = (ARAppClipCodeUrlDecodingState) global::ObjCRuntime.Messaging.int_objc_msgSend (this.Handle, Selector.GetHandle ("urlDecodingState"));
- }
+ ret = (ARKit.ARAppClipCodeUrlDecodingState) (long) global::ObjCRuntime.Messaging.nint_objc_msgSend (this.Handle, Selector.GetHandle ("urlDecodingState"));
An unlinked Xamarin.iOS.dll is ~300kb smaller (once linked the difference
should be minimal though).
I also made the min/max detection logic (check for int32.MinValue/MaxValue and
convert to int64.MinValue/MaxValue) specific to ARCH_32, since we don't need
it in 64-bit code.
Context: https://github.com/dotnet/sdk/pull/19596
Context: https://github.com/xamarin/xamarin-android/pull/6184
If we use the version number string of `**FromWorkload**`, then our
runtime packages don't need to be resolved from a NuGet feed. They can
be resolved from the `dotnet/packs` directory.
This completely eliminates the need for a `NuGet.config` file when
building a .NET 6 app with a local build of xamarin-macios.
You will no longer need a feed such as:
<add key="local-dotnet-feed" value="~/src/xamarin-macios/_build/nuget-feed" />
To further clean things up, I removed the need for:
* Any NuGet feed named `local-dotnet-feed`
* `$(DOTNET_FEED_DIR)`
* Generation of `dotnet/Workloads/NuGet.config`
Fixes these errors:
xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs(1140,41): error CS0246: The type or namespace name 'NSApplication' could not be found (are you missing a using directive or an assembly reference?)
xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs(1156,4): error CS0103: The name 'NSApplication' does not exist in the current context
xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs(1157,4): error CS0103: The name 'NSApplication' does not exist in the current context
* Add 'ImplicitUsings=true' to all the templates.
* Make the implicit global namespaces C#-only.
* Add the implicit global namespaces to the 'Using' itemgroup instead of the
'Import' itemgroup.
* Make sure the global namespaces are set from AutoImport.props, so that the
user may remove any global namespace they don't want in their project file
(by doing something like: `<Using Remove="Foundation" />`)
Ref: https://github.com/dotnet/sdk/issues/19521
Ref: https://github.com/dotnet/sdk/issues/19793
Fixes https://github.com/xamarin/xamarin-macios/issues/12457.
* Update dependencies from https://github.com/dotnet/installer build 20210805.1
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21405.1
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21404.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210806.3
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21406.3
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21405.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210807.3
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21407.3
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21405.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210807.8
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21407.8
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21405.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210808.2
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21408.2
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21405.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210809.11
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21409.11
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21409.3 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210811.2
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21411.2
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21410.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210811.31
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21411.31
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21411.3 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210812.16
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21412.16
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21412.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210814.1
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21414.1
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21413.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210814.5
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21414.5
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21413.1 (parent: Microsoft.Dotnet.Sdk.Internal
* [dotnet-linker] Bump to net6.0.
It doesn't build with net5.0 anymore:
[...]xamarin-macios/tools/dotnet-linker/dotnet-linker.csproj : error NU1202: Package Microsoft.NET.ILLink 6.0.100-preview.6.21413.1 is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Package Microsoft.NET.ILLink 6.0.100-preview.6.21413.1 supports: net6.0 (.NETCoreApp,Version=v6.0)
make[2]: *** [Makefile:23: bin/Debug/net5.0/dotnet-linker.dll] Error 1
make[2]: Leaving directory '[...]xamarin-macios/tools/dotnet-linker'
make[1]: *** [../mk/subdirs.mk:18: all-recurse] Error 1
make[1]: Leaving directory '[...]xamarin-macios/tools'
* Update dependencies from https://github.com/dotnet/installer build 20210815.2
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21415.2
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21413.1 (parent: Microsoft.Dotnet.Sdk.Internal
* [dotnet] Disable the template tests.
There were breaking changes upstream, but the path forward hasn't been defined
yet, so disable these tests.
Ref: https://github.com/xamarin/xamarin-macios/issues/12457
* Update dependencies from https://github.com/dotnet/installer build 20210816.45
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21416.45
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21413.1 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/dotnet/installer build 20210817.3
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.1.21403.66 -> To Version 6.0.100-rc.1.21417.3
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21416.1 (parent: Microsoft.Dotnet.Sdk.Internal
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
This also required changing some linker code to not have platform-specific conditional compilation,
because dotnet-linker is built only once for .NET (same binary for all platforms).
* Add an '_AppBundleManifest' property that specifies the final path to the
Info.plist in the app bundle.
* Remove the '_AppBundleManifestPath' property, it's not used anywhere.
* Adjust the CompileAppManifest task to take the final path to the Info.plist,
instead of computing it and returning it. This way the CompileAppManifest
task does not output anything back into MSBuild (which is important, because
the CompileAppManifest task won't execute if the output file is up-to-date,
and if it's not executed, any output properties won't be set either).
* Have a single implementation of AutoActivateCustomFonts.
* Share the GetTargetDevices implementations between ACTool and IBTool, after removing
a condition for Xcode 6.0 (which we don't support anymore, so that check could
be removed) the implementations were identical.
* Share the logic for .NET between all platforms.
* This means adding a macOS variation of introspection for .NET.
* A few fixes to make sure the macOS variation passes:
* Make NSTabViewController.SegmentedControl fully unavailable (it's never
been in any stable version of Xcode).
* Treat API with an Obsolete attribute as API with an Obsoleted attribute
with regards to availability.
* Ignore OSPlatform attributes we don't understand.
* Ignore the ApiAvailabilityTest.LegacyAttributes test on macOS as well.
* Add support for 'dotnet publish'.
* Add support for a 'PkgPackagePath' for macOS and Mac Catalyst, an MSBuild
property to specify the resulting .pkg path, to reflect the existing
'IpaPackagePath' (for iOS and tvOS).
* Fix MSBuild logic that uses 'IpaPackagePath'. Looks like nobody has ever
used this...
* Add tests.
Fixes https://github.com/xamarin/xamarin-macios/issues/11807.
We extract frameworks from third-party libraries when running the linker, and
we need to store this information on disk and the reload it after the linker
has executed, and add it to the existing MSBuild variables that keep track of
the user frameworks and dynamic libraries that have to be copied to the app
bundle.
Fixes the framework-test tests.
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release
Reverts c56b893b68
Fix https://github.com/xamarin/xamarin-macios/issues/9573
Notes
* Even if possible (in metadata) there is no point in setting `final` on
a method if we remove `virtual`. This match ILLink version of the sealer
and makes the same test pass on both.
* Don't apply optimization on non-AOT builds, e.g. simulators, since some
features (like XML serialization) checks for
`RuntimeFeature.IsDynamicCodeSupported` and that requires some types
to be subclassed thru SRE
This is what happens:
1. Mono will write crash dumps in the current directory:
57bfe47451/src/mono/mono/utils/mono-state.c (L302-L322)
2. The current directory is by default the root of the app bundle.
3. If there are any files in the root of the app bundle for macOS or Mac
Catalyst, 'codesign' will fail ("unsealed contents present in the bundle
root").
This leads to the following sequence of events:
1. App developer builds & runs a Mac Catalyst app.
2. The app crashes for some reason.
3. Mono creates a crash dump (in the root directory of the app bundle).
4. The app developer changes something in the project and tries again.
5. The build fails, because 'codesign' fails.
Avoid this by deleting any crash dump files from the root of the app bundle
before signing the app.
This test adds entries to the global reading list in Safari, and there's no
API for the test to clean up after itself, so the reading list becomes an
endless list of entries after a whlie.
Beside the fact that this is somewhat annoying for people who actually use
their reading lists, it can also can end up consuming a significant amount of
space on the hard drive, because Safari will download each site to be
available offline.
* [dotnet] Remove workaround for private symbols for AOT.
* [tools] Make Application.AotArguments a list of string.
This is just a simple refactoring to make Application.AotArguments a list of
strings instead of a comma-separated list of values.
* [tools] Only use direct-icalls when linking mono statically.
Ref: https://github.com/dotnet/runtime/issues/55000
* [mtouch] Fix aot arguments comparison.
* [tests] Adjust mtouch test according to mtouch changes.
* [tests] Add minimum OS version to the Mac Catalyst variation of the MySimpleApp test case.
It's a `Phase` vs `PHASE` lookup that make the tests checking for
fields fail.
```
FieldExists: 3 errors found in 6603 fields validated: PHASESpatialCategoryDirectPathTransmission, PHASESpatialCategoryEarlyReflections, PHASESpatialCategoryLateReverb
```
There's no need in having availability attributes for versions earlier
than the current minimum.
Re-enable the `Introduced` test for _legacy_ Catalyst as it's fine since
it use the older attributes. It's still not possible to enable it for
`NET` until all manual bindings are updated.
This requires a small change to the generator since `Selector.FromHandle`
can return `null` but it does not means the invoked API can (and we are
interested in the later).
Fixed up existing API returning potentially `null` `Selector`, IOW adding
the missing `[NullAllowed]` on them and updating xtro.
On CI we'll collect all the binlogs in the repository and make them available
for post-build analysis if need be, so this will make it easier to diagnose
build problems.
* [introspection] Ignore the ApiAvailabilityTest.LegacyAttribute test on Mac Catalyst as well.
* [introspection] #10883 only applies to Mac Catalyst for legacy Xamarin.
* [xharness] introspection is now green on .NET/Mac Catalyst
* [xharness] Gracefully handle any exceptions that may occur when parsing build logs.
Fixes a harness exception:
Harness exception for 'monotouch-test': System.ArgumentException: '', hexadecimal value 0x1D, is an invalid character.
at System.Xml.XmlEncodedRawTextWriter.InvalidXmlChar (System.Int32 ch, System.Char* pDst, System.Boolean entitize) [0x00026] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:1420
at System.Xml.XmlEncodedRawTextWriter.WriteCDataSection (System.String text) [0x00251] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:1370
at System.Xml.XmlEncodedRawTextWriter.WriteCData (System.String text) [0x0012a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:470
at System.Xml.XmlEncodedRawTextWriterIndent.WriteCData (System.String text) [0x00007] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:1750
at System.Xml.XmlWellFormedWriter.WriteCData (System.String text) [0x00029] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs:771
at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.TestReportGenerator.WriteFailure (System.Xml.XmlWriter writer, System.String message, System.IO.TextReader stderr) [0x00031] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/TestReportGenerator.cs:41
at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.NUnitV3TestReportGenerator.GenerateFailure (System.Xml.XmlWriter writer, System.String title, System.String message, System.IO.TextReader stderr) [0x0030e] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/NUnitV3TestReportGenerator.cs:122
at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.XmlResultParser.GenerateFailureXml (System.String destination, System.String title, System.String message, System.IO.TextReader stderrReader, Microsoft.DotNet.XHarness.Common.XmlResultJargon jargon) [0x00033] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/XmlResultParser.cs:226
at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.XmlResultParser.GenerateFailure (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILogs logs, System.String source, System.String appName, System.String variation, System.String title, System.String message, System.IO.TextReader stderrReader, Microsoft.DotNet.XHarness.Common.XmlResultJargon jargon) [0x000a4] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/XmlResultParser.cs:248
at Xharness.Jenkins.TestTasks.RunTest.BuildAsync () [0x00274] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/RunTest.cs:74
at Xharness.Jenkins.TestTasks.RunTest.ExecuteAsync () [0x000d8] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/RunTest.cs:99
at Xharness.Jenkins.TestTasks.TestTasks.RunInternalAsync () [0x00226] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/TestTask.cs:283
* Fix missing parenthesis in message.
Fixes this test failure on device:
[FAIL] CurrentDirectory : Current directory at launch
Expected string length 97 but was 89. Strings differ at index 1.
Expected: "/private/var/containers/Bundle/Application/4824129A-8668-4CD9..."
But was: "/var/containers/Bundle/Application/4824129A-8668-4CD9-9280-7F..."
Fixes these test failures:
MonoTouchFixtures.HealthKit.CategoryTypeIdentifier
[FAIL] EnumValues_22351 : AppleWalkingSteadinessEvent could not be created: System.ArgumentNullException: Value cannot be null.
Parameter name: hkCategoryTypeIdentifier
at ObjCRuntime.NativeObjectExtensions.GetNonNullHandle (ObjCRuntime.INativeObject self, System.String argumentName) [0x00003] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/INativeObject.cs:27
at HealthKit.HKObjectType.GetCategoryType (Foundation.NSString hkCategoryTypeIdentifier) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/HealthKit/HKObjectType.g.cs:111
at HealthKit.HKCategoryType.Create (HealthKit.HKCategoryTypeIdentifier kind) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/HealthKit/HKObjectType.cs:26
at MonoTouchFixtures.HealthKit.CategoryTypeIdentifier.EnumValues_22351 () [0x001fd] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/CategoryTypeIdentifierTest.cs:115
at MonoTouchFixtures.HealthKit.CategoryTypeIdentifier.EnumValues_22351 () [0x0024f] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/CategoryTypeIdentifierTest.cs:120
MonoTouchFixtures.HealthKit.QuantityTypeIdentifier
[FAIL] EnumValues_22351 : AppleWalkingSteadiness could not be created: System.ArgumentNullException: Value cannot be null.
Parameter name: hkTypeIdentifier
at ObjCRuntime.NativeObjectExtensions.GetNonNullHandle (ObjCRuntime.INativeObject self, System.String argumentName) [0x00003] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/INativeObject.cs:27
at HealthKit.HKObjectType.GetQuantityType (Foundation.NSString hkTypeIdentifier) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/HealthKit/HKObjectType.g.cs:162
at HealthKit.HKQuantityType.Create (HealthKit.HKQuantityTypeIdentifier kind) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/HealthKit/HKObjectType.cs:19
at MonoTouchFixtures.HealthKit.QuantityTypeIdentifier.EnumValues_22351 () [0x0017a] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/QuantityTypeIdentifierTest.cs:87
at MonoTouchFixtures.HealthKit.QuantityTypeIdentifier.EnumValues_22351 () [0x001cc] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/QuantityTypeIdentifierTest.cs:92
Also make these tests show all failing enum values at once, instead of having
to run the test after adding each new case.
* A lot of availability attribute updates.
* Some conditional "#if !__MACCATALYST__" in manual binding files.
* xtro updates.
* Misc other minor tweaks.
* Rearrange some MSBuild logic so that the packaging/archiving code for macOS
can also be used for Mac Catalyst.
* Make the .NET build logic package/archive when requested to do so.
* Add tests.
Partial fix for https://github.com/xamarin/xamarin-macios/issues/10413.
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.
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.
* 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>
* [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.
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.
* 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.
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
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
* 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.
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.
Make the NSWritingDirection enum from Foundation the main version, and
deprecate the others (AppKit.NSWritingDirection,
UIKit.UITextWritingDirection).
This makes things a bit easier with Mac Catalyst, which ships both AppKit and UIKit.
Ref: https://github.com/xamarin/xamarin-macios/issues/6573
* [gamekit] Remove `isPresentingFriendRequestViewController` from Catalyst
The selector is not annotated by itself (wrt Catalyst) but it maps to
`presentFriendRequestCreatorFromViewController` which is not available
on Catalyst. That part is clear in the headers
```diff
+#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
+/**
+ * presentFriendRequestCreatorFromViewController:
...
+#elif TARGET_OS_OSX
+/**
+ * presentFriendRequestCreatorFromWindow:
```
* [dotnet] Add support for implicit namespace imports. Fixes#12084.
Also update our templates to remove any using statements for implicitly imported
namespaces.
Fixes https://github.com/xamarin/xamarin-macios/issues/12084.
* [monotouch-test] Fix compilation error due to implicit namespace causing type conflict.
Fixes these errors:
xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
* [monotouch-test] Check a few more permissions that sometimes make the app crash due to a TCC violation on Mac Catalyst.
* [monotouch-test] Adjust CaptureDeviceTest to only verify camera permission for Audio+Video, any other value is not supported by the OS.
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
This pull request updates the following dependencies
## From https://github.com/dotnet/installer
- **Subscription**: df3e6147-3e41-4928-6775-08d8f479343c
- **Build**: 20210720.12
- **Date Produced**: 7/21/2021 6:57 AM
- **Commit**: d7279fc09fcfb108c5fb97fa290dbbb11c4c441b
- **Branch**: refs/heads/main
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 6.0.100-preview.7.21330.1 to 6.0.100-rc.1.21370.12][1]
- **Microsoft.NET.ILLink.Tasks**: [from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1][2]
[1]: 823ff33...d7279fc
[2]: f549b4e...6eae019
## Coherency Updates
The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1 (parent: Microsoft.Dotnet.Sdk.Internal)
* Add proper .NET project files for dont link, link sdk and link all. This
includes a Mac Catalyst variant, and adding helpful Makefile targets for
simple execution.
* Adjust various tests to work with Mac Catalyst.
* Add the new Mac Catalyst variants to xharness.
This is a partial fix for #10833.
* [AppKit/UIKit] Merge the definitions of NSTextLayoutOrientationProvider.
It looks like this might be a breaking change for macOS, but the macOS
definition had only a [Model] attribute, which won't make the generator
generate any public API.
* [AppKit/UIKit] Merge the definitions of NSTextContainer.
* [AppKit/UIKit] Merge the definitions of NSExtendedStringDrawing.
* [src] Share the NSTextStorage[Delegate] implementations between AppKit and UIKit.
* [AppKit/UIKit] Merge the definitions of NSCollectionLayoutAnchor.
* [AppKit/UIKit] Merge the definitions of the NSCollectionLayout* classes.
* [AppKit/UIKit] Merge the definitions of NSDataAsset.
* [AppKit/UIKit] Merge the definitions of NSShadow.
* [AppKit/UIKit] Merge the definitions of NSTextTab.
* Update xtro.
It would create a file in the current directory, which is the root directory of the app bundle.
This would work in the simulator (because the directory is read-write), fail
on device (because the directory is read-only), and cause rebuilds to fail
with Mac Catalyst (because the directory is read-write the test would succeed,
but it would write files in the root directory of the app bundle, which is not
allowed for macOS apps, and thus codesign would fail when rebuilding the app).
So change the test to create any files in a temporary directory, and adjust it
to always expect the file to be created.
And just in case also delete the file at the end of the test.
This fixes a problem where the html report wouldn't be re-generated if there
was a problem loading a device (which for instance could happen if xharness
was unable to create a required simulator).
* Make `CFArray` public so it can be used for bindings, including 3rd party bindings
* Subclass `NativeObject` to remove some boilerplate code
* Most members are `internal` until needed
* Add nullability annotations
The next step is to make the same kind of optimization done on `NSString`
vs `CFString` by preferring faster p/invokes over calling selectors while
keeping generated code identical.
Also
* Make more methods internal so we can potentially rename them (when the NSArray variants becomes obsolete)
* Add CFArray to the attachment tests
* [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).
* [src] Share [I]NSCollectionLayoutVisibleItem implementation between AppKit and UIKit.
* [src] Share several NSLayout* implementations between AppKit and UIKit.