Skip to content

Single-file host tracing should include version and/or commit hash #80961

@elinor-fung

Description

@elinor-fung

We intentionally do not set file version information for apphost and singlefilehost, since they represent the user's application. With apphost, we can still see the version and commit hashes in traces - for example:

--- Invoked apphost [version: 7.0.0, commit hash: d099f075e45d2aa6007a22b71b45a08758559f80] main = {
--- Invoked hostfxr_main_startupinfo [commit hash: d037e070ebe5c83838443f869d5800752b0fcb13]
--- Invoked hostpolicy [commit hash: d037e070ebe5c83838443f869d5800752b0fcb13] [runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy,7.0.2,runtimes/win-x64/native][x64] corehost_main = {

For singlefilehost, we explicitly set this information to static:

if(CLR_SINGLE_FILE_HOST_ONLY)
# CLR partition builds only the single file host where hosting components are all statically linked.
# the versioning information is irrelevant and may only come up in tracing.
# so we will use "static"
add_definitions(-DHOST_POLICY_PKG_VER="static")
add_definitions(-DHOST_FXR_PKG_VER="static")
add_definitions(-DHOST_PKG_VER="static")
add_definitions(-DCOMMON_HOST_PKG_VER="static")
add_definitions(-DHOST_POLICY_PKG_NAME="static")
add_definitions(-DHOST_POLICY_PKG_REL_DIR="static")
add_definitions(-DREPO_COMMIT_HASH="static")

So all we have is:

--- Invoked apphost [version: static, commit hash: static] main = {
--- Invoked hostfxr_main_bundle_startupinfo [commit hash: static]
--- Invoked hostpolicy [commit hash: static] [static,static,static][x64] corehost_main = {

There doesn't seem to be any reasonable way to get at the version of the host is running. It is probably worth having a real value for at least either the version or commit so we can better understand what is being used when customers hit issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions