-
Notifications
You must be signed in to change notification settings - Fork 560
CLR hosting #9572
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
Merged
Merged
CLR hosting #9572
Changes from all commits
Commits
Show all changes
143 commits
Select commit
Hold shift + click to select a range
1cf9e25
Enable static linking with libc++
grendello dae8f4d
Remove C++ ABI compatibility sources
grendello b27665f
Update apkdesc files
grendello baa8378
Playing around with some ideas
grendello b2ac780
More consistent use of std::string_view + remove unused code
grendello 66b192a
Making EmbeddedAssemblies a static type
grendello e8ff385
More move to static, more cleanup
grendello 20ddba5
MonodroidRuntime is static now
grendello 2721778
Buglets fixed
grendello d8814a5
Trying to find out why AppContext.GetData doesn't appear to work
grendello 5d230ee
Cleanup
grendello c822af5
Lengths and offsets...
grendello 01f8460
Cleanup
grendello 2b9bd9c
Start using std::format and std::string_view string literals
grendello b8599c0
A bit less of reinterpret_cast<>
grendello 633f993
Conversion to std::format continues
grendello 55587b6
More std::format
grendello 793eecf
Friendlier, no need to use `std::format` directly in log_* anymore
grendello 3b538c3
Cleanup
grendello e6d3224
Cleanup
grendello 847e385
Update apkdesc files
grendello c63300a
std::format doesn't like null pointers when printing strings
grendello 3b87eb9
Beginnings of CLR hosting
grendello 8ec22aa
Address feedback
grendello 8a08bc1
First packaging steps + Java startup code changes
grendello 1d05f4c
Build deps + application config for CLR
grendello 1147b73
Moving on: logging + timing
grendello 16cf5a1
Beginnings of initialization code
grendello 3227bcb
More environment work
grendello 9456f80
Enable static linking with libc++
grendello c8511c4
Remove C++ ABI compatibility sources
grendello 6adc16a
Update apkdesc files
grendello 0be5634
Playing around with some ideas
grendello 9e0d730
More consistent use of std::string_view + remove unused code
grendello c5f82c8
Making EmbeddedAssemblies a static type
grendello 7db34e4
More move to static, more cleanup
grendello 0bbc9db
MonodroidRuntime is static now
grendello 5678421
Buglets fixed
grendello 44d4e55
Trying to find out why AppContext.GetData doesn't appear to work
grendello 118b664
Cleanup
grendello ecf77d8
Lengths and offsets...
grendello 76cfa0d
Cleanup
grendello f4b9cdb
Start using std::format and std::string_view string literals
grendello 3938562
A bit less of reinterpret_cast<>
grendello 6fe8dfc
Conversion to std::format continues
grendello 8e0aae5
More std::format
grendello bb9fcff
Friendlier, no need to use `std::format` directly in log_* anymore
grendello 25ea6dd
Cleanup
grendello 29e2369
Update apkdesc files
grendello d35774a
std::format doesn't like null pointers when printing strings
grendello 95bfbcb
Address feedback
grendello 96c6564
Add the CoreCLR runtime falvor
grendello 38f0b6d
New src/native layout
grendello 8e62329
Reorg continued
grendello b58563c
Build appears to be working
grendello 8cc8b4f
Properly resolve library stubs from runtime packs
grendello 59810bf
Fix java runtime jar inclusion
grendello ed7e277
Recreate @(ResolvedRuntimePack) item group
grendello 8be8b21
Double-check if a nuget package is indeed our runtime pack
grendello c68c2ea
Don't package runtime stubs
grendello 946febe
Not needed
grendello 07d211f
Update to match `main`
grendello 3d3fe80
Remove unnecessary sources
grendello 1b11015
Import changes from https://github.com/dotnet/android/pull/9686/
grendello fc00b03
Mono -> MonoVM
grendello 73a5437
Fixes
grendello f69d006
Fixes and workarounds to make CoreCLR build happen
grendello 956e24f
Hack to be able to use CoreCLR runtime pack we created
grendello a7f2f3a
Fake CoreCLR runtime pack works. Next step: use correct CoreCLR inste…
grendello 8a2da86
Add support for local version of CoreCLR runtime pack
grendello 915c0db
Support for CoreCLR in xaprepare
grendello d4012bc
Limit CoreCLR builds to android-arm64 for now
grendello ef8257d
Build tweaks to make progress easier
grendello f9478ef
A couple more hacks
grendello 5851e45
Fix JCW generation for CoreCLR
grendello f93a1af
A handful of fixlets
grendello f0b4254
Fix JCW again
grendello ac65631
Revert "Fix JCW again", trying to figure out what's actually broken
grendello 94ebcbb
Add some temporary logging
grendello 6533e58
Runtime config properties now stored in libxamarin-app.so
grendello 552b6c4
[WIP] Unicode strings support
grendello 5fab337
More elegant solution to managing same strings with different encodings
grendello a8fc7df
Add a missing variable
grendello a7d384f
One step closer
grendello cc3e528
More work towards assembly store support in CLR
grendello d373f92
Assembly stores support for CLR done
grendello 9dd56b6
On the road to first managed call
grendello 1d03a76
Hook into some error logging in CLR
grendello ffe325d
Package CoreCLR JIT library
grendello aa8bee7
CoreCLR android runtime packs are available now. Adjust.
grendello 74147ef
Two special assemblies
grendello 701d16d
p/invoke override support
grendello e0fce17
Oops, kind of need this one
grendello 3c34b2b
Notes + logging
grendello 15778ad
Remove a number of hacks, now that runtime packs are available
grendello e9bd6c5
One more hack gone
grendello d1f6999
Sync CoreCLR host with the latest native changes in main
grendello 6b55c39
Create an LlvmIrStringVariable instance when adding a string variable
grendello 4fdd003
Let's try this
grendello 64495ae
"Namespace" LLVM IR strings"
grendello a6af727
Fix string constant options
grendello 9d6836c
Hello world now runs.
grendello ee6195f
WIP for CoreCLR typemaps
grendello 3abcc6d
More CoreCLR typemap work
grendello 5574c31
Share more code between MonoVM and CoreCLR hosts
grendello 93dd85e
Fix package manager registration for CoreCLR
grendello 092b131
Fix pinvoke generator
grendello 39d3759
Update notes
grendello 9a3ad92
Post-merge fixups
grendello eff1edd
Type map implementation for CLR
grendello f45e45a
MAUI hello world works now
grendello d059b3e
Fix Windows build?
jonpryor 5b79113
Add missing parentheses
grendello 235440b
Some cleanup
grendello 947a608
Changes
grendello 23c3d39
Fix after rebase
grendello 6b87268
Typemaps use type token ids again
grendello 9f5d911
Fix after rebase
grendello dece52f
[WIP] Broken, tbc on Monday
grendello 69a6713
Use a local CoreCLR runtime build, if requested and present
grendello cea7432
Forget me not
grendello 5f66199
[WIP] runtime pack library dirs discovery
grendello a61d1ea
Use discovered runtime pack native lib dirs
grendello cc0be44
Fix build on CoreCLR after `main` rebase
grendello 630eeeb
Add some logs and update structure layout
grendello 6e1c6c3
Cleanup
grendello 04d4170
Updates to work with the latest dotnet/runtime changes
grendello b835667
Make build using local CLR work
grendello 8d4e35c
Fix after rebase
grendello 7ea447d
No-compression MAUI hack
grendello ce4e595
Disable native build until up-to-date runtime packs are available
grendello d4cc649
Let's see if this works
grendello 656614a
FastDev needs the parameters too
grendello f19135a
Fix after rebase
grendello 0a11c7f
One more fixup
grendello d5dec28
Revert "Bump to dotnet/sdk/main@d3d96bc671 10.0.100-preview.3.25126.7…
grendello 07edabc
Temporarily disable a CoreCLR test and try to fix NativeAOT builds
grendello 2122ecb
Neither assembly store nor assemblies are used with NativeAOT
grendello 35ae830
Reapply "Bump to dotnet/sdk/main@d3d96bc671 10.0.100-preview.3.25126.…
grendello 73d0588
Let's try this
grendello 8cc1f89
Revert "Let's try this"
grendello 473814d
Take two
grendello e911841
Fix indentation.
jonpryor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Notes | ||
|
||
## Potential optimizations | ||
|
||
* https://github.com/dotnet/runtime/blob/9b24fb60a19f62620ca1fc5e4eb2e3ae0b3b086d/src/coreclr/binder/assemblybindercommon.cpp#L844-L889 | ||
* Managed C++ assemblies aren't available on Unix, no point in looking for them | ||
* `candidates[]` is `WCHAR*`, while `ProbeAppBundle` takes UTF-8 - no point in doing the | ||
conversion here | ||
* Host contract | ||
* It might make sense to pass strings as Unicode to host and back, to avoid conversions. | ||
p/invoke names for instance, can be Unicode. So can be the assembly names. Native library | ||
names should be UTF-8, but we can generate lookup tables for those at application build time | ||
(e.g. indexed by an xxHash of the Unicode version of the name) - no conversion at run time. | ||
* We need declarations of all he possible HRESULT errors (`S_OK` etc) | ||
|
||
## Stuff that should be changed | ||
|
||
### Logging | ||
Currently, most of the messages logged by the runtime end up in `/dev/null` (either because they | ||
are disabled in release build or because they log to stdio which doesn't work on Android). | ||
|
||
Logcat is the only way to get information from remote devices, especially via Google Play Console. | ||
|
||
We should log to logcat: | ||
|
||
+ C++ exception messages | ||
+ abort() messages / fatal errors | ||
+ warnings | ||
+ errors | ||
|
||
A subsystem should be added which will provide a single function that will do actual output, implementation of which | ||
will be specific to the platform. API should allow specification of severity, the actual message, and possibly a flag | ||
to indicate whether the process should be aborted (the decision might also be based on the severity). Severity should | ||
be shared between all targets, which then can (if needed) translate it to the target platform's value(s), if any. | ||
|
||
### Process termination | ||
Runtime currently calls `abort()` in several places. This should probably become part of the host contract instead. | ||
Being part of the contract, the target platform could implement process termination on `abort()` in a uniform way | ||
(includes platform-specific logging, preparation etc) | ||
|
||
## Issues and workarounds | ||
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
The header files in this directory are verbatim copies taken from the | ||
https://github.com/dotnet/runtime/ repository. | ||
|
||
They can be found in the following locations in the repository: | ||
|
||
src/native/corehost/host_runtime_contract.h | ||
src/coreclr/hosts/inc/coreclrhost.h | ||
|
||
and they MUST be in sync with the current version of the runtime being | ||
used. They don't have to come from the same version, but their content | ||
must be ABI and API compatible with it. |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.