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

Add mechanism for runtime to query host for information #78798

Merged
merged 5 commits into from
Dec 6, 2022

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Nov 24, 2022

Pass a struct from the host to the runtime as a new property HOST_RUNTIME_CONTRACT. The runtime can use this to query for information from the host.

  • get_runtime_property: get the value of a property from the host. The host's current implementation just handles the same properties given to the runtime on initialization. It can be updated to handle/compute additional information on-demand as the need arises.
  • bundle_probe: existing function used for single-file
  • pinvoke_override: existing function used for single-file

The struct can be extended in the future to handle more specific/structured information in a nicer way than property strings (for example separate function to get or enumerate the TPA / probing paths).

Resolves #77458

@ghost
Copy link

ghost commented Nov 24, 2022

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: elinor-fung
Assignees: -
Labels:

area-Host

Milestone: -

@elinor-fung elinor-fung marked this pull request as draft November 24, 2022 05:11
src/native/corehost/host_runtime_contract.h Outdated Show resolved Hide resolved
src/native/corehost/host_runtime_contract.h Show resolved Hide resolved
src/native/corehost/host_runtime_contract.h Outdated Show resolved Hide resolved
src/coreclr/dlls/mscoree/exports.cpp Outdated Show resolved Hide resolved
@elinor-fung elinor-fung marked this pull request as ready for review December 1, 2022 23:08
@elinor-fung
Copy link
Member Author

Manually verified that we will be able to use this properly for getting diagnostics information during suspension as in #56808 - thanks @davmason for the pointers.

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

I like this 😄

Just the minor comment about priority of the properties, otherwise looks great.

@vitek-karas
Copy link
Member

Would be good to add a short description of this into the docs in the repo - along with "why are we doing this" and "how we see it being used in the future"... and finally "this is the future way of passing more properties to the runtime". Basically document the decisions and design - doesn't have to be long, it's pretty simple at the end.

@elinor-fung
Copy link
Member Author

Failures are known: #79255, #79279

I will do a separate PR for the doc, since that doesn't need all the CI build/test.

@elinor-fung elinor-fung merged commit 45f5e85 into dotnet:main Dec 6, 2022
@elinor-fung elinor-fung deleted the get-property-callback branch December 6, 2022 23:23
@ghost ghost locked as resolved and limited conversation to collaborators Jan 6, 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.

Pass callback from host to runtime for getting properties from the host
2 participants