-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[tasks] Add auto runtime initialization template to LibraryBuilder #83050
Merged
mdh1418
merged 30 commits into
dotnet:main
from
mdh1418:library_builder_runtime_initialization
Mar 17, 2023
Merged
[tasks] Add auto runtime initialization template to LibraryBuilder #83050
mdh1418
merged 30 commits into
dotnet:main
from
mdh1418:library_builder_runtime_initialization
Mar 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned mdh1418
Mar 6, 2023
mdh1418
force-pushed
the
library_builder_runtime_initialization
branch
from
March 8, 2023 22:42
a4a9852
to
fd14133
Compare
mdh1418
force-pushed
the
library_builder_runtime_initialization
branch
from
March 8, 2023 22:45
fd14133
to
bef3de9
Compare
This reverts commit bc86f2b.
steveisok
reviewed
Mar 8, 2023
steveisok
reviewed
Mar 8, 2023
steveisok
reviewed
Mar 8, 2023
steveisok
reviewed
Mar 8, 2023
steveisok
reviewed
Mar 8, 2023
steveisok
reviewed
Mar 8, 2023
9 tasks
steveisok
reviewed
Mar 9, 2023
lateralusX
reviewed
Mar 10, 2023
lateralusX
reviewed
Mar 10, 2023
lateralusX
reviewed
Mar 10, 2023
lateralusX
reviewed
Mar 10, 2023
lateralusX
reviewed
Mar 15, 2023
lateralusX
reviewed
Mar 15, 2023
lateralusX
reviewed
Mar 15, 2023
lateralusX
reviewed
Mar 15, 2023
mdh1418
force-pushed
the
library_builder_runtime_initialization
branch
from
March 15, 2023 17:11
39b9c7a
to
b46fdb3
Compare
lateralusX
reviewed
Mar 16, 2023
lateralusX
reviewed
Mar 16, 2023
lateralusX
reviewed
Mar 16, 2023
lateralusX
reviewed
Mar 16, 2023
lateralusX
reviewed
Mar 16, 2023
lateralusX
reviewed
Mar 16, 2023
lateralusX
reviewed
Mar 16, 2023
lateralusX
reviewed
Mar 16, 2023
mdh1418
force-pushed
the
library_builder_runtime_initialization
branch
from
March 16, 2023 15:39
0944eeb
to
5761f4c
Compare
From the Build Analysis, looks like everything is a known test error. |
lateralusX
approved these changes
Mar 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
All failures are known issues. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributes to #79377
Incorporates mono's lazy runtime init capability #82253 into the library builder task #81919.
In the target use case of having a self-contained library containing the mono runtime with custom managed code, the mono runtime needs to be initialized when the library is loaded into the native application. In order to do so, one can either
A. leverage the default
runtime-init-callback
and upon loading the shared library, rely on the auto initialization logic inautoinit.c
(Introduced by this PR) to setup the callback viamono_set_runtime_init_callback
. The callback is set when first loading the shared library due to the constructor.or
B. pass in a custom
runtime-init-callback=
introduced in #82253 and have one's own runtime initialization startup logic instead ofautoinit.c
.The runtime initialization logic looked at https://github.com/dotnet/runtime/blob/main/src/tasks/AndroidAppBuilder/Templates/monodroid.c for inspiration.
In attempt to have a barebones version, the following is done:
DOTNET_ASSETS_PATH
register bundled modules// TODO when bundling is implementedDOTNET_ASSETS_PATH
or custom defined variableadd a custom assembly preload hook// No longer needed as assembly paths are setallow for debugging//TODO in followupadd install hook for aot data// Not default scenarioExample generated files
CMakeLists
shared_library_log.h
autoinit.c
load_assemblies.c