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

[android][ios] Add SDK and workload to support library mode #83487

Merged
merged 10 commits into from
Mar 18, 2023

Conversation

steveisok
Copy link
Member

Introduces the experimental workload mobile-librarybuilder-experimental that supports building self-contained shared or static native libraries on iOS and Android.

Once installed, the workload can be activated when the runtime identifier is android, ios, tvos, or maccatalyst based and the project contains the property <NativeLib>true</NativeLib>. NativeLib is a property NativeAOT uses to activate library mode and we will use that for consistency.

The Microsoft.NET.Runtime.LibraryBuilder.Sdk is a new nuget package will contain all of the necessary msbuild props and targets that drive the whole library builder process.

Steve Pfister added 4 commits March 7, 2023 21:08
Introduces an experimental workload that supports building self-contained shared or static native libraries on iOS and Android.
@steveisok
Copy link
Member Author

/azp run runtime-android

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@steveisok
Copy link
Member Author

/azp run runtime-android

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

_AndroidResolveReferences;
_AndroidPrepareProfiledAot;
_AndroidAotCompileApp;
_AndroidAotCompile;
_BuildNativeLibrary;
Copy link
Member

Choose a reason for hiding this comment

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

I think we should make this into a property and set the one that should be used depending if its app build or library build before importing AndroidBuild.props. In library builder SDK we could always set the property to _BuildNativeLibrary.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer doing this in a follow up.

@@ -1,28 +1,43 @@
<Project>
Copy link
Member

Choose a reason for hiding this comment

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

I think we should move the app specific properties and targets into a separate file that we import in the case we build and app instead of a library, or for in-tree where we currently only build apps, we can always import in the in-tree targets file.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer doing this in a follow up

_AppleAotCompileApp;
$(_NativeLibraryTarget)
_AppleAotCompile;
_BuildNativeLibrary;
_AppleGenerateAppBundle;
Copy link
Member

Choose a reason for hiding this comment

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

I think we should make this into a property and set the one that should be used depending if its app build or library build before importing AppleBuild.props. In library builder SDK we could always set the property to _BuildNativeLibrary.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer doing this in a follow up

@@ -1,24 +1,28 @@
<Project>
Copy link
Member

Choose a reason for hiding this comment

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

I think we should move the app specific properties and targets into a separate file that we import in the case we build and app instead of a library, or for in-tree, local builds where we currently only build apps, we can always import in the in-tree and/or local build targets file.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer doing this in a follow up.

@steveisok
Copy link
Member Author

/azp run runtime-android

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines 41 to 44
add_definitions(-g)
add_definitions(-fPIC)
add_definitions(-fvisibility=hidden)
set(USE_GCC_ATOMIC_OPS 1)
Copy link
Member

Choose a reason for hiding this comment

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

Right now this only applies to Android, didn't we want this applied to all?

Copy link
Member Author

Choose a reason for hiding this comment

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

Unless I'm mistaken, we only apply these to android.

Copy link
Member

@mdh1418 mdh1418 left a comment

Choose a reason for hiding this comment

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

Is there a way to preview the workload generated??

@steveisok
Copy link
Member Author

Is there a way to preview the workload generated??

Not yet. Wasm has been way ahead of us in that they can test workloads on CI. To get mobile going that way, it's a big collection of artifacts and most likely can't run per PR.

Copy link
Member

@mdh1418 mdh1418 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@steveisok steveisok merged commit 87b73f0 into dotnet:main Mar 18, 2023
@steveisok steveisok deleted the lib-builder-sdk branch March 18, 2023 03:39
@ghost ghost locked as resolved and limited conversation to collaborators Apr 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants