Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace manually maintained code about frameworks with generated code. #10218

Merged
merged 10 commits into from
Dec 15, 2020

Conversation

rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Dec 4, 2020

  • [src] Generate the string constants for each framework from our list of
    frameworks.

    This makes it less error prone to add new frameworks (one less place to add
    them), and easier to add new platforms (only one place to make sure the
    list of frameworks is correct).

    This also revelead a few issues in our list of frameworks (missing
    frameworks, frameworks that have been moved, etc.), which have been fixed.

  • [mmp] Generate the library path -> namespace map for the linker to optimize away dlopen statements.

…of frameworks.

This makes it less error prone to add new frameworks (one less place to add
them), and easier to add new platforms (only one place to make sure the list
of frameworks is correct).

This also revelead a few issues in our list of frameworks (missing frameworks,
frameworks that have been moved, etc.), which have been fixed.
@rolfbjarne rolfbjarne requested a review from spouliot as a code owner December 4, 2020 17:34
@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label Dec 4, 2020
@rolfbjarne rolfbjarne marked this pull request as draft December 4, 2020 17:34
@monojenkins

This comment has been minimized.

Copy link
Contributor

@spouliot spouliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ it

maybe src/generate-frameworks-constants should be under tools ? that's where I would look for it instinctively

</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.11.3" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not see Cecil used

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@rolfbjarne
Copy link
Member Author

❤️ it

maybe src/generate-frameworks-constants should be under tools ? that's where I would look for it instinctively

The problem is that tools/ is built after src/:

https://github.com/xamarin/xamarin-macios/blob/14ad1a122bd1bacae402dc4a2337eed438cd2a71/Makefile#L2

So yes, I could move it to tools/, but I would still have to build it from src/ (something like make -C $(TOP)/tools/generate-frameworks-constants), and that's somewhat ugly too, so I decided to just put this in src/ (but either way would work fine for me).

@monojenkins

This comment has been minimized.

@monojenkins

This comment has been minimized.

@rolfbjarne rolfbjarne marked this pull request as ready for review December 14, 2020 08:34
@monojenkins

This comment has been minimized.

@rolfbjarne
Copy link
Member Author

The breaking API changes are expected:

  • public const string CFNetworkLibrary = "/System/Library/Frameworks/CoreServices.framework/Frameworks/CFNetwork.framework/CFNetwork" "/System/Library/Frameworks/CFNetwork.framework/CFNetwork";

Unsure if this was a mistake or if CFNetwork was a part of CoreServices at some point, but in any case CFNetwork is not a subframework of CoreServices anymore (in 10.15).

  • public const string CallKitLibrary = "/System/Library/Frameworks/CallKitLibrary.framework/CallKitLibrary" "/System/Library/Frameworks/CallKit.framework/CallKit";

The previous value was just wrong.

  • public const string CoreBluetoothLibrary = "/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework/CoreBluetooth" "/System/Library/Frameworks/CoreBluetooth.framework/CoreBluetooth";

Moved from inside an umbrella framework (IOBluetooth) into its own framework in 10.10

  • public const string CoreImageLibrary = "/System/Library/Frameworks/QuartzCore.framework/Versions/A/Frameworks/CoreImage.framework/CoreImage" "/System/Library/Frameworks/CoreImage.framework/CoreImage";

Moved from inside an umbrella framework (QuartzCore) into its own framework in 10.11

  • public const string CoreTextLibrary = "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/CoreText" "/System/Library/Frameworks/CoreText.framework/CoreText";

It's own framework since at least 10.9

  • public const string ImageIOLibrary = "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/ImageIO" "/System/Library/Frameworks/ImageIO.framework/ImageIO";

It's own framework since at least 10.9

  • public const string ImageKitLibrary = "/System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework/ImageKit" "/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/ImageKit";

The same path, because of symlinks (now follows the same pattern as other paths).

  • public const string PdfKitLibrary = "/System/Library/Frameworks/Quartz.framework/Frameworks/PDFKit.framework/PDFKit" "/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/PDFKit.framework/PDFKit";

The same path, because of symlinks (now follows the same pattern as other paths).

  • public const string QuartzComposerLibrary = "/System/Library/Frameworks/Quartz.framework/Frameworks/QuartzComposer.framework/QuartzComposer" "/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuartzComposer.framework/QuartzComposer";

The same path, because of symlinks (now follows the same pattern as other paths).

  • public const string QuickLookUILibrary = "/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework/QuickLookUI" "/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuickLookUI.framework/QuickLookUI";

The same path, because of symlinks (now follows the same pattern as other paths).

  • public const string SearchKitLibrary = "/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/SearchKit" "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/SearchKit";

The same path, because of symlinks (now follows the same pattern as other paths).

@monojenkins

This comment has been minimized.

@rolfbjarne
Copy link
Member Author

build

@monojenkins
Copy link
Collaborator

Build success
Provisioning succeeded
Build succeeded
API Diff (from stable)
⚠️ API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️ Generator Diff (please review changes)
Test run succeeded

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@rolfbjarne rolfbjarne merged commit bf84732 into dotnet:main Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants