-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[NativeAOT] Simplify build integration with external bundlers for Apple platforms #87187
Comments
Tagging subscribers to 'os-ios': @steveisok, @akoeplinger Issue DetailsDescriptionIn order to support targeting Apple platforms NativeAOT build targets need to be integrated with external build systems and bundlers like:
To achieve this, several project properties need to be set in the correct way.
To improve the integration process and maintainability it would be beneficial to simplify the integration process when targeting Apple platforms with a single "opt-in" MSBuild property.
|
I'm not sure I understand the |
These are just currently used workarounds to avoid build issues like:
To summarize, I think I was not precise enough in the description of the issue (I will update it), as we are still collecting all that we would need for easier integration and the goal is to hopefully have this all accessible under a single switch. |
I do not think that the settings are the only one right way to target Apple platforms. They are specific to Xamarin app-model. Other app models (e.g. Avalonia) may want to do the integration differently. We try to avoid hardcoding app-model specific settings in the core runtime .target files. For example, we have the same relationship with ASP.NET app models: ASP.NET SDKs have number of custom overrides of the defaults. I think we should follow the same pattern for all appmodels/SDKs, including Xamarin. It is fine to expose individual features in cleaner way to make the integration easier. |
In particular having to set |
I feel the only fragile part is |
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
While working on the runtime tests, I'm exploring several ideas to address this issue:
It would be good to check out an example of the ASP.NET app models, so we can consider the existing approach. |
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
What targets in Microsoft.NETCore.Native.Publish.targets are problematic? We could condition them on some property that the Xamarin props would set so that they don't interfere with how Xamarin wants to set up the flow of inputs/outputs. The same with LinkNative - I'd suggest looking into why it's even executed when we're not doing a publish. Eventually, we'd want to split LinkNative into two targets - one that constructs the command line arguments we want to pass to the linker (so that the Xamarin targets can pick it up) and another one that actually runs linker (Xamarin would not participate in that). |
Note that we're doing "dotnet publish". The immediate result I get (with the changes in xamarin/xamarin-macios#17374) if I set NativeCompilationDuringPublish=true is this:
Looks like that's because of: runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets Lines 20 to 22 in 5b900dd
where So here's problem 1: we don't want to execute NativeAOT's LinkNative target, because we're using the static library ILC creates, and not the final linked output. Maybe it would make sense to create a property the SDK could set to indicate that we only need the static library, and not the final linked result? |
It is what |
…LC doesn't support executing after ILLink. Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However, we need to execute both, and in order to do that, we force our own logic to execute to determine what ILC does. This might be improved in the future. Ref: dotnet/runtime#87187.
There is more we can do to simplify the integration, so keeping this issue open. |
Description
In order to support targeting Apple platforms NativeAOT build targets need to be integrated with external build systems and bundlers like:
To achieve this, several project properties need to be set in the correct way and we are currently collecting all that is necessary to achieve the integration.
For example: in case of targeting an iOS application with NativeAOT (
PublishAot=true
) and integrating it with an external build pipeline, these are the properties that need to be set:NOTE: Please note that the list above is not complete, it merely lists the current workarounds to enable building an iOS application.
To improve the integration process and maintainability it would be beneficial to simplify the integration process when targeting Apple platforms with a single "opt-in" MSBuild property.
The text was updated successfully, but these errors were encountered: