Bug 43197 - Xamarin.Mac extensions should allow linking and dynamic registrar
Summary: Xamarin.Mac extensions should allow linking and dynamic registrar
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: Master
Hardware: PC Mac OS
: High major
Target Milestone: 15.3
Assignee: Bugzilla
URL:
: 56126 ()
Depends on:
Blocks:
 
Reported: 2016-08-09 15:20 UTC by Chris Hamons
Modified: 2017-06-23 11:27 UTC (History)
9 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Vsfm logs (15.67 KB, application/zip)
2017-05-31 10:22 UTC, Neha Kharbade
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Chris Hamons 2016-08-09 15:20:36 UTC
Right now, these features are disabled in extension projects:

- Dynamic registrar
- Linking

This means we have slower builds time and large bundles that we could. 

Linking is disabled here -https://github.com/xamarin/xamarin-macios/pull/575
Static registrar forced here -https://github.com/xamarin/xamarin-macios/blob/master/tools/mmp/driver.cs#L501

We crash on launch if either is enabled.
Comment 1 Chris Hamons 2017-05-09 18:57:05 UTC
This interacts poorly with the QTKit restriction on the Apple Store, making it impossible to ship any extensions on the store.
Comment 2 Ivan Icin 2017-05-09 23:10:54 UTC
*** Bug 56126 has been marked as a duplicate of this bug. ***
Comment 3 Rolf Bjarne Kvinge [MSFT] 2017-05-10 05:14:07 UTC
It's technically possible that Apple implemented extensions in a way that requires the static registrar (if they look for Objective-C classes in the executable before we can run any code).

So ideas:

* Make the linker work somehow.
* Add an AppStore-mode (or the negative, a non-app-store-mode, so that the App Store-mode is the default) to mmp that makes the static registrar generate code that doesn't violate app store rules (such as ignoring any QTKit types, never linking with QTKit.framework, and any other concerns that may come up in the future).
Comment 4 Chris Hamons 2017-05-10 20:47:35 UTC
https://github.com/xamarin/xamarin-macios/pull/2088
Comment 5 Chris Hamons 2017-05-15 18:07:50 UTC
Fixed in https://github.com/xamarin/xamarin-macios/pull/2092
Comment 6 Neha Kharbade 2017-05-24 11:34:42 UTC
Hello @Chris Hamons,
Can you please provide proper steps or description of this bug for verification, with expected result.
Comment 7 Chris Hamons 2017-05-24 13:02:26 UTC
1) Build Xamarin Mac Extension Project
2) Enable Linker and add --registrar:static to your release configuration
3) Run extension and verify it works.
Comment 9 Chris Hamons 2017-05-26 13:01:52 UTC
Project Options -> Build -> Mac Build -> Additional mmp arguments
Comment 10 Gaurav Ganorkar 2017-05-31 07:47:04 UTC
Verified this bug with steps given in comment7# & comment9#

Xamarin.Mac extensions app build & deployed successfully on simulator.

Here is screencast link :
http://www.screencast.com/t/9ZTkoQhyX

tested on both El-capitan & Sierra , I have attached logs for both.

Build Versions:
https://gist.github.com/nehaKh/6a2c8983b90f2d37808f84ba4e2d56a1

Please update me if any other scenarios need to be tested for this bug or kindly confirm that if above steps are enough & we are good to marked it as verified.

Please confirm.
Comment 11 Neha Kharbade 2017-05-31 10:22:05 UTC
Created attachment 22580 [details]
Vsfm logs
Comment 12 Neeraj Deshmukh 2017-06-23 11:27:28 UTC
Verified on Environment:
Visual Studio Enterprise 2017 for Mac (Preview)
Version 7.1 Preview (7.1 build 1246)
Xamarin.iOS
Version: 10.12.0.10 
Xamarin.Android
Version: 7.4.0.11 
Xamarin.Mac
Version: 3.6.0.9