* [linker] Optimize calls to BlockLiteral.SetupBlock to inject the block signature.
Optimize calls to BlockLiteral.SetupBlock[Unsafe] to calculate the block
signature at build time, and inject it into the call site.
This makes block invocations 10-15x faster (I've added tests that asserts at
least an 8x increase).
It's also required in order to be able to remove the dynamic registrar code in
the future (since calculating the block signature at runtime requires the
dynamic registrar).
* [mtouch/mmp] Add support for reporting errors/warnings that point to the code line causing the error/warning.
Add support for reporting errors/warnings that point to the code line causing
the error/warning by adding ErrorHelper overloads that take the exact
instruction to report (previously we defaulted to the first line/instruction
in a method).
* [tests] Add support for asserting filename/linenumber in warning messages.
* Make all methods that manually create BlockLiterals optimizable.
* [tests] Create a BaseOptimizeGeneratedCodeTest test that's included in both XI's and XM's link all test.
* [tests] Add link all test (for both XI and XM) to test the BlockLiteral.SetupBlock optimization.
* [tests] Add mtouch/mmp tests for the BlockLiteral.SetupBlock optimization.
* [tests][linker] Make the base test class abstract, so tests in the base class aren't executed twice.
* [tests][linker] Don't execute linkall-only tests in linksdk.
The optimization tests only apply when the test assembly is linked, and that
only happens in linkall, so exclude those tests in linksdk.
* [tests][mmptest] Update test according to mmp changes.
Fixes these test failures:
1) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("inline-runtime-arch")
The warning 'MM0132: Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
Message #1 did not match:
actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
Message #2 did not match:
actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
2) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("foo")
The warning 'MM0132: Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
Message #1 did not match:
actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
Message #2 did not match:
actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
* [tests][linker] Fix typo.
Fixes this test failure:
1) SetupBlock_CustomDelegate (Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlock_CustomDelegate)
Counter
Expected: 1
But was: 2
* [registrar] Minor adjustment to error message to match previous (and better) behavior.
Fixes this test failure:
1) Failed : Xamarin.Registrar.GenericType_WithInvalidParameterTypes
The error 'MT4136: The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' was not found in the output:
Message #1 did not match:
actual: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<Foundation.NSObject>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''
expected: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''
* [docs] mmp shows MM errors/warnings.
* [docs] Improve according to reviews.
* [tests] Fix merge failure causing test duplication.
* [generator] Teach generator about WrapAttribute on Getters and Setters
https://bugzilla.xamarin.com/show_bug.cgi?id=57870
`WrapAttribute` can now be used in property getters and setters,
this allows to Wrap virtually anything the way you need, for example
smart enums, consider the following API definition:
```csharp
// Smart enum.
enum PersonRelationship {
[Field (null)]
None,
[Field ("FMFather", "__Internal")]
Father,
[Field ("FMMother", "__Internal")]
Mother
}
```
```csharp
// Property definition.
[Export ("presenceType")]
NSString _PresenceType { get; set; }
PersonRelationship PresenceType {
[Wrap ("PersonRelationshipExtensions.GetValue (_PresenceType)")]
get;
[Wrap ("_PresenceType = value.GetConstant ()")]
set;
}
```
* Fix Feedback
* Fix doc error
* Update error message
Moving to reference sources added a few, new converters so the existing
logic to preserve them was not complete.
This update the list of converters, sorted like the reference sources
(RS) for easier reviews.
It also adds:
* a canary test in "dont link" that will fail it the RS code change
or is replaced;
* more complete unit tests to ensure all cases works
https://github.com/xamarin/xamarin-macios/issues/3372
* [registrar] Register models in the static registrar.
This also means we need to quiet a few types of warnings:.
* Models declares virtual methods of required protocol members. We don't
export virtual methods (only when they're overridden are they exported),
which results in numerous warnings about protocol members not being
implemented:
Xamarin.Mac.registrar.mobile.x86_64.m:37827:17: warning: method 'deviceBrowserView:selectionDidChange:' in protocol 'IKDeviceBrowserViewDelegate' not implemented [-Wprotocol]
@implementation ImageKit_IKDeviceBrowserView__IKDeviceBrowserViewDelegate {
^
/Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework/Headers/IKDeviceBrowserView.h:29:1: note: method 'deviceBrowserView:selectionDidChange:' declared here
- (void)deviceBrowserView: (IKDeviceBrowserView *)deviceBrowserView selectionDidChange: (ICDevice *)device;
* These two are the same as above, just for properties instead of methods.
Xamarin.Mac.registrar.mobile.x86_64.m:31988:17: warning: auto property synthesis will not synthesize property 'boundingMapRect' declared in protocol 'MKOverlay' [-Wobjc-protocol-property-synthesis]
@implementation MKOverlay {
^
/Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/MapKit.framework/Headers/MKOverlay.h:24:43: note: property declared here
@property (nonatomic, readonly) MKMapRect boundingMapRect;
^
Xamarin.Mac.registrar.mobile.x86_64.m:32002:1: note: add a '@synthesize' directive
@end
^
Xamarin.Mac.registrar.mobile.i386.m:28957:17: warning: property 'repeatCount' requires method 'repeatCount' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation [-Wobjc-property-implementation]
@implementation CAMediaTiming {
^
/Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h:58:17: note: property declared here
@property float repeatCount;
^
* [AVFoundation] Special-case AVCaptureDataOutputSynchronizer[Delegate] in the registrar for macOS.
This class and protocol were incorrectly added to our macOS bindings, but
since we can't remove them because it would break backwards compatibility, we
must skip them manually in the registrar, since the registrar would otherwise
produce uncompilable code:
In file included from Xamarin.Mac.registrar.full.x86_64.m:2:
./Xamarin.Mac.registrar.full.x86_64.h:2929:63: error: 'AVCaptureDataOutputSynchronizerDelegate' is unavailable: not available on macOS
@interface AVCaptureDataOutputSynchronizerDelegate : NSObject<AVCaptureDataOutputSynchronizerDelegate> {
^
/Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDataOutputSynchronizer.h:101:11: note: 'AVCaptureDataOutputSynchronizerDelegate' has been explicitly marked unavailable here
@protocol AVCaptureDataOutputSynchronizerDelegate <NSObject>
^
In file included from Xamarin.Mac.registrar.mobile.x86_64.m:2:
./Xamarin.Mac.registrar.mobile.x86_64.h:3370:63: error: 'AVCaptureDataOutputSynchronizerDelegate' is unavailable: not available on macOS
@interface AVCaptureDataOutputSynchronizerDelegate : NSObject<AVCaptureDataOutputSynchronizerDelegate> {
* [AVFoundation] Stub out AVCaptureDataOutputSynchronizer[Delegate] on macOS.
AVCaptureDataOutputSynchronizer[Delegate] were incorrectly added to our macOS
bindings, which makes the static registrar's life difficult. So remove those
bindings, and re-implemented them as normal classes, without any attributes,
which makes the static registrar ignore them (to a certain extent: enough to
not generate uncompilable code at least).
* [registrar] Remove more model exclusion code.
* [xtro] Update ignored entries.
You were the preprocessor we wished C# had natively
Removing PMCS requires these changes:
* Remove XamCore from src/
* Remove XamCore from tools/
* Remove XamCore from runtime/
* nint/nuint enum conversion
* _compat_ enum conversion
* NSAction conversion
* Hand fix single API incorrectly converted by PMCS to unbreak compatibility
- Due to a bug in PMCS, the nuint was incorrectly converted in this API.
- However, as that ship as sailed, we must "fix" it until XAMCORE_4_0
* Update readme
* Bump macios-binaries
* [tests] Move linker tests to match introspection directory layout.
Move linker tests to match introspectio directory layout: tests/linker/ios and
tests/linker/mac instead of tests/linker-ios and tests/linker-mac.
This creates a logical place for shared linker files (tests/linker).
* [tests] Fix path to GuiUnit_NET_4_5.csproj in sln as well.
This is the path used to find referenced projects when building Classic.
Fixes this build problem:
warning: Referenced project 'GuiUnit_NET_4_5' not found in the solution.
/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(11,7) : error CS0246: The type or namespace name `GuiUnit' could not be found. Are you missing an assembly reference?
/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(64,42) : error CS0246: The type or namespace name `IMainLoopIntegration' could not be found. Are you missing an assembly reference?
/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(75,34) : error CS0246: The type or namespace name `InvokerHelper' could not be found. Are you missing an assembly reference?
Converting to and from smart enums and their corresponding native value
requires knowing the conversion function, since each smart enum has its own
conversion function.
The dynamic registrar can do this at runtime, but it's something that can be
computed in the static registrar at build time, so do that. The static
registrar will now embed the metadata token (as a token reference) in the
generated code, which can be used at runtime to find the conversion method,
without requiring anything from dynamic registrar.
This requires some refactoring in the conversion methods to allow passing more
information around (the `context` parameter in the conversion functions, which
the smart enum conversion methods now use for the token reference).
It turns out this is a massive improvement (although the scenarios where this
is relevant are rare): a simple test case [1] is 300x faster (from ~30s to
0.1s).
[1]: https://gist.github.com/rolfbjarne/961af28d1c2727b256fbcdfd6aa65e98
* [tests] Build the native test library for macOS and create a binding project for it.
Also add the new binding project to the xammac and link all XM test projects,
which allows us to stop excluding tests that require the native library and
the corresponding bindings.
* [tests] Include more tests in xammac_tests.
* [tests] Correctly ignore the ObjC exception tests in release mode.
* [tests] Share supporting code between the mtouch and mmp tests.
Create a new class 'BundlerTool', which now contains most of the code in
MTouchTool that's also applicable to mmp (and the new MmpTool class).
This will make it easier to share tests between the mtouch and mmp tests.
Some tweaks are still probably required, but this should get us most of the
way.
* [tests] Fix generator tests after changes in shared test code.
* [tests] Add new file to the MSBuild/XM tests.
This file is included in several projects, some projects use property, some
don't (and report the warning). There's no harm in not setting this property
(it's expected), ignore the warning.
This won't affect device tests on the bots (because those already set LLVM
manually when testing Release), but it becomes less confusing when trying to
reproduce any problems locally, since now the project configuration on disk
matches the tested configuration.
Fixes this:
tests/common/mac/ProjectTestHelpers.cs(154,22): warning CS0436: The type 'StringUtils' in 'tests/mmptest/../../tools/common/StringUtils.cs' conflicts with the imported type 'StringUtils' in 'mmp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/mmptest/../../tools/common/StringUtils.cs'.
tests/common/Configuration.cs(162,53): warning CS0436: The type 'StringUtils' in 'tests/mmptest/../../tools/common/StringUtils.cs' conflicts with the imported type 'StringUtils' in 'mmp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/mmptest/../../tools/common/StringUtils.cs'.
* [Foundation] Simplify NSValue code to use [No*] instead of ifdefs.
Also enable the MKCoordinateSpan and CLLocationCoordinate2D values for NSValue
in macOS, since they're now available (since macOS 10.9).
Type Changed: Foundation.NSValue
Added properties:
public virtual MapKit.MKCoordinateSpan CoordinateSpanValue { get; }
public virtual CoreLocation.CLLocationCoordinate2D CoordinateValue { get; }
* [Foundation] Mark the new NSValue selectors as 64-bit only.
Instead of generating the following:
var converted = IntPtr.Zero;
if (value.HasValue) {
var v = value.Value;
converted = new IntPtr (&v);
}
// now 'converted' points to a local variable that is out of scope
do this:
var converted = IntPtr.Zero;
var v = default (float);
if (value.HasValue) {
v = value.Value;
converted = new IntPtr (&v);
}
// now 'converted' points to a local variable that's still in scope
so that we don't store a pointer to a local variable and use that pointer
after the local variable has gone out of scope.
I'm not entirely sure this really is a problem in C#, but it doesn't hurt to
be on the safe side.
Also add newlines to the generated code to make it look nicer.
Generator diff: https://gist.github.com/rolfbjarne/225d920b7fa28d07fbeab13754cebd2a
* [xharness] Add support for running XI projects with different platform configurations.
* [xharness] Run dont link, link all and link sdk tests in both Debug and Release in the simulator. Fixes#53181.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53181.
* [tests] Fix dont link to always optimize C# code in release mode.
* [tests] No need to weak link GameController anymore in dont link.
This was removed long ago from the Debug configurations, so remove it from the
Release configuration as well.
* [AVFoundation] Mark NSExtensionRequestHandling as 64-bit only.
The correct binding already existed, but for some reason it was
incorrectly duplicated/readded and marked as available in 32-bit here:
https://github.com/xamarin/xamarin-macios/commit/ca028ea15#diff-7ea102419ab3567d665e35d010e90a58R11401
So simplify the bindings by removing the incorrect version.
* [Foundation] Remove superfluous availability attribute.
It looks like this should not have been bound since there's a singleton-like static property to use the type.
Keeping binary compatibility.
- Fixes github issue #3303: AVAudioUnitComponentManager default .ctor can crash on macOS 10.13.3
(https://github.com/xamarin/xamarin-macios/issues/3303)
* [Launcher] Don't set the configuration dir to the bundle
When using system-mono launcher, do not make mono probe for
configuration files in the bundle, but rather rely on the
default behaviour of system mono resolving it to /etc/mono
* Update comments
* [xharness] Ask mono to not attach gdb/ldb when XM tests crash.
Attaching gdb/ldb usually hangs, thus causing the test run to time out instead
of finishing early (due to the crash).
Also bump the timeout for finding crash reports to 60 seconds when the tests
crash, since macOS can be quite slow to create the crash report.
* [xharness] Timestamp mac logs to aid diagnostics.
It seems Apple started shipping CoreNFC headers some time (in a later beta)
after we first implemented (which was Xcode 9 beta 1).
Xcode 9.0, 9.1 and 9.2 all contain the exact same NFC headers (CoreNFC was
introduced with Xcode), so no version checks should be needed when removing
this exclusion.
When overriding this method, the framework can feed us a null screen, e.g. when calling `NSWindow.SetFrame()`
An example stack trace:
```
2018-01-26 10:08:17.580 Rhinoceros[2975:238051] System.ArgumentNullException: Value cannot be null.
Parameter name: screen
at AppKit.NSWindow.ConstrainFrameRect (CoreGraphics.CGRect frameRect, AppKit.NSScreen screen) [0x0000c] in <5dd442fafc4842c391a0a802c0c12c43>:0
at System.Windows.Forms.FormHelper.ConstrainFrameRect (CoreGraphics.CGRect frameRect, AppKit.NSScreen screen) [0x00017] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:85
--- End of stack trace from previous location where exception was thrown ---
at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_CGRect_bool (intptr,intptr,CoreGraphics.CGRect,bool)
at AppKit.NSWindow.SetFrame (CoreGraphics.CGRect frameRect, System.Boolean display) [0x00031] in <5dd442fafc4842c391a0a802c0c12c43>:0
at System.Windows.Forms.Form.UpdateBounds (AppKit.NSView super) [0x00055] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:529
at System.Windows.Forms.Control.SetBoundsInternal (System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height) [0x0001c] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.Cocoa.cs:570
at System.Windows.Forms.Control.SetBounds (System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height, System.Windows.Forms.BoundsSpecified specified) [0x0005a] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:2370
at System.Windows.Forms.Control.set_Location (System.Drawing.Point value) [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:1483
at System.Windows.Forms.Form.set_Location (System.Drawing.Point value) [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cs:3179
at Grasshopper.GUI.GH_DocumentEditor.RestoreDialogPositionData () [0x0006d] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/GUI/GH_DocumentEditor.cs:168
at Grasshopper.GUI.GH_DocumentEditor.DocumentEditorFormLoad (System.Object sender, System.EventArgs e) [0x0002d] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/GUI/GH_DocumentEditor.cs:60
at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x0001f] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cs:2146
at System.Windows.Forms.Form.CallLoad () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:583
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:CallLoad ()
at System.Windows.Forms.FormHelper.CallLoad () [0x0000f] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:134
at System.Windows.Forms.FormHelper.BecomeKeyWindow () [0x00008] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:146
--- End of stack trace from previous location where exception was thrown ---
at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_bool (intptr,intptr,bool)
at AppKit.NSWindow.set_IsVisible (System.Boolean value) [0x00030] in <5dd442fafc4842c391a0a802c0c12c43>:0
at System.Windows.Forms.Form.set_VisibleInternal (System.Boolean value) [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:486
at System.Windows.Forms.Control.set_Visible (System.Boolean value) [0x00012] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.Cocoa.cs:1348
at System.Windows.Forms.Control.InternalShow () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:2377
at System.Windows.Forms.Form.InternalShow () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:367
at System.Windows.Forms.Control.Show () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:2382
at System.Windows.Forms.Form.Show (System.Windows.Forms.IWin32Window parent) [0x000ad] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:416
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:Show (System.Windows.Forms.IWin32Window)
at Grasshopper.Plugin.Commands.ShowGrasshopperEditor (System.Boolean showUponLoad) [0x001ee] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/Plugin/GH_GrasshopperCommands.cs:73
at Grasshopper.Plugin.Commands.Run_Grasshopper () [0x0001f] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/Plugin/GH_GrasshopperCommands.cs:139
at GrasshopperPlugin.GrasshopperCommand.RunCommand (Rhino.RhinoDoc doc, Rhino.Commands.RunMode mode) [0x00010] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/GrasshopperPlugin/GrasshopperCommands.cs:17
at Rhino.Commands.Command.OnRunCommand (System.Int32 commandSerialNumber, System.UInt32 docSerialNumber, System.Int32 mode) [0x00035] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/rhinocommon/dotnet/rhino/rhinosdkcommand.cs:311
```
This class and protocol were incorrectly added to our macOS bindings.
The catch is that we can't remove them because it would break backwards
compatibility, so mark them for removal in XAMCORE_4_0.
* [ObjCRuntime] Add a BindingImplAttribute.
* [linker] Make ProviderToString an extension method on ICustomAttributeProvider to make it more discoverable.
* [generator] Use [BindingImpl] instead of [CompilerGenerated].
The entire diff is big (89MB), so it can't be gisted. However, most of it is
either removal of `using System.Runtime.CompilerServices;` or the change from
`[CompilerGenerated]` to `[BindingImpl (...)]` like this:
https://gist.github.com/rolfbjarne/8bfda3ed37b956d0342a1c1e9b079244
If I remove those parts of the diff, there's nothing significant left:
https://gist.github.com/rolfbjarne/4156164d6bdb1376366200394eb8a091
* [linker] Teach the linker about the new [BindingImpl] attribute.
In addition to the existing logic where the linker would optimize some
[CompilerGenerated] code (sometimes with additional requirements), it will now
also optimize all [BindingImpl (Optimizable)] code (without any additional
requirements).
* [tests] Add tests to make sure [BindingImpl (Optimizable)] works as expected.
* [linker] Check for [BindingImpl] before [CompilerGenerated] and stop checking for [CompilerGenerated] in XAMCORE_4_0.
Check for [BindingImpl] before checking for [CompilerGenerated], since the
former is more common.
Also stop checking for [CompilerGenerated] (at least to mean that code is
optimizable) in our next non-compatible evolutionary leap (XAMCORE_4_0):
* [introspection] Impl a better typo check.
The SharedStatic class is a leftover from when there were two static
registrars: the old one (OldStaticRegistrar) and the new one
(StaticRegistrar).
Since there's only one static registrar left (the old one died some time ago),
all the SharedStatic code can be put into the StaticRegistrar class.
There are no functional changes in this PR, only this refactoring.
Fixes this test failure:
1) Failed : Xamarin.MMP.Tests.MMPTests.UnifiedWithLinking_ShouldHaveFewFrameworkClangLines
Found more framework entries in clang invocation then expected - Foundation AppKit QuartzCore CoreData Quartz CoreFoundation CoreServices Security Carbon CloudKit
xcrun -sdk macosx clang -mmacosx-version-min=10.7 -arch x86_64 -fobjc-runtime=macosx -Wno-unguarded-availability-new -ObjC -framework Foundation -framework AppKit -framework QuartzCore -framework CoreData -framework Quartz -framework CoreFoundation -framework CoreServices -framework Security -framework Carbon -weak_framework CloudKit -u _xamarin_timezone_get_data -u _xamarin_get_block_descriptor /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac.a -o /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/bin/Debug/UnifiedExample.app/Contents/MacOS/UnifiedExample -D_THREAD_SAFE -I/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/pkgconfig/../../include/mono-2.0 /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/pkgconfig/../../lib/libmonosgen-2.0.a -liconv -x objective-c++ -I/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/include /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/obj/Debug/mmp-cache/registrar.m -fno-caret-diagnostics -fno-diagnostics-fixit-info -isysroot /Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/obj/Debug/mmp-cache/main.m
Expected: less than 10
But was: 10
This regressed in 4da8016db4, where new API is
partially unremovable by the linker, and as such causes XM to link with more
frameworks at build time.
This is expected, so change the test to accept more frameworks (11).
Fixes https://github.com/xamarin/maccore/issues/615.
Fixes this test failure on High Sierra:
Xamarin.Mac.Tests.EveryFrameworkSmokeTests.ExpectedLibrariesAreLoaded: CoreSpotlightLibrary (/System/Library/Frameworks/CoreSpotlight.framework/CoreSpotlight) failed to load but this was not expected
Unfortunately models are not abstract, and users can create instances of them.
This means that the type must be registered - and that's exactly what happens
when the app tries to create such an instance: the dynamic registrar will
register it.
However, previously we didn't register the type when registering all the types
in an assembly, the type would only be registered when it was needed. This
prevents the static registrar from registering it, and it always ends up using
the dynamic registrar, which means the dynamic registrar will always be
required.
By not excluding models when registering all types in an assembly these types
are also included in the generated code from the static registrar, and we're
one step closer to being able to remove the dynamic registrar when using the
static registrar.
* [linker] Implement a generic method of storing attributes that may be removed by the linker.
Implement a generic method of storing attributes that may be removed by the
linker, so that those attributes can be accessed after the linker has linked
them away.
* [linker] Store availability attributes using the new generic location.
* [linker] Store the CompilerGenerated attribute using the new generic location.
Make sure to package the linker tests when packaging XM tests (this broke
recently because the dontlink tests were moved).
Fixes this problem when running the packaged tests:
make[2]: linker-mac/dont link/bin/x86/Debug/dont link.app/Contents/MacOS/dont link: No such file or directory
make[2]: *** [exec-mac-classic-dont link] Error 1
make[2]: linker-mac/dont link/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link: No such file or directory
make[2]: *** [exec-mac-unified-dont link] Error 1
make[2]: linker-mac/dont link/bin/x86/Debug-unifiedXM45/dont link.app/Contents/MacOS/dont link: No such file or directory
make[2]: *** [exec-mac-unifiedXM45-dont link] Error 1
make[2]: linker-mac/dont link/bin/x86/Debug-unified-32/dont link.app/Contents/MacOS/dont link: No such file or directory
make[2]: *** [exec-mac-unified32-dont link] Error 1
make[2]: linker-mac/dont link/bin/x86/Debug-unifiedXM45-32/dont link.app/Contents/MacOS/dont link: No such file or directory
make[2]: *** [exec-mac-unifiedXM4532-dont link] Error 1
exec-mac-classic-dont\ link failed
exec-mac-unified-dont\ link failed
exec-mac-unifiedXM45-dont\ link failed
exec-mac-unified32-dont\ link failed
exec-mac-unifiedXM4532-dont\ link failed
make[1]: *** [exec-mac-dontlink] Error 1
* [mtouch/mmp] Give users more control over optimizations, and share more code between mtouch and mmp.
1. Add an --optimize flag to mtouch/mmp that allows users to select which
optimizations to apply (or not). This makes it easier to add future
optimizations, and allow users to disable any optimization that causes
problems without having to disable many other features.
2. Share as much optimization code as possible between mtouch and mmp. This
immediately gives a benefit to mmp, which has three new optimizations only
mtouch had: NSObject.IsDirectBinding inlining, IntPtr.Size inlining and
dead code elimination.
This results in ~6kb of disk space saved for a linked Xamarin.Mac app:
* link sdk: [Debug][1], [Release][2]
* link all: [Debug][3], [Release][4]
Testing also verifies that monotouchtest ([Debug][5], [Release][6]) has not
changed size at all, which means that no default optimizations have changed
inadvertedly.
[1]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--debug
[2]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--release
[3]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--debug
[4]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--release
[5]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonedebug64
[6]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonerelease64
* [tools] Don't enable the IsDirectBinding optimization by default for Xamarin.Mac apps, it's not safe.
* Fix whitespace issues.
* [doc] Document optimizations.
* Officially support optimizations by adding them to the Versions.plist.
* [linker] Improve IntPtr.Size inliner + dead code eliminatior and add tests.
* Properly handle operands for the ldc_i4_s instruction (they're sbyte).
* Fix less-than condition to actually do a less-than comparison.
* Make sure to look up the bitness in the Target, not the Application, since
the Application's value will be incorrect when building fat apps (both
Is32Build and Is64Build will be true).
* Remove unnecessary checks for the IntPtr.Size inliner: this optimization
does not depend on other instructions than the IntPtr.get_Size call, so
remove the checks that verify surrounding instructions. This makes the
IntPtr.Size inliner kick in in more scenarios (such as the new tests).
* Add tests.
* [tests] Add mmp tests for optimizations.
* [tests] Fix XM optimization tests.
* [tests] Fix test build error.