Skip to content

Check DOTNET_HOST_* for host (COREHOST_*) tracing environment variables #117894

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 4 commits into from
Jul 24, 2025

Conversation

elinor-fung
Copy link
Member

@am11 had a good suggestion of using the DOTNET_ prefix for COREHOST_ environment variables as a move toward greater consistency for .NET environment variables: #117797 (comment)

This updates the host to also check DOTNET_HOST_* for existing COREHOST_* variables used for tracing.

cc @dotnet/appmodel @AaronRobinsonMSFT @richlander

@elinor-fung elinor-fung added this to the 10.0.0 milestone Jul 21, 2025
@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 18:47
Copy link
Contributor

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

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the host tracing environment variables from the legacy COREHOST_* prefix to the newer DOTNET_HOST_* prefix for better consistency with other .NET environment variables. The changes maintain backward compatibility by checking both prefixes with DOTNET_HOST_* taking precedence.

Key changes:

  • Implements fallback logic to check both DOTNET_HOST_* and COREHOST_* environment variables
  • Updates error messages and documentation to reference the new variable names
  • Updates test constants and adds backward compatibility test coverage

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/native/corehost/hostpolicy/hostpolicy_context.cpp Updates error message to reference DOTNET_HOST_TRACE instead of COREHOST_TRACE
src/native/corehost/hostmisc/trace.cpp Implements fallback logic for environment variable checking and updates comments
src/installer/tests/TestUtils/Constants.cs Updates test constants to use new DOTNET_HOST_* variable names
src/installer/tests/HostActivation.Tests/Tracing.cs Refactors tests to be simpler and adds backward compatibility test

@elinor-fung
Copy link
Member Author

/ba-g timeouts - for the one leg that had host tests, it timed out waiting for the Ubuntu run - the console logs show the tests all passed.

@elinor-fung elinor-fung merged commit 7195086 into dotnet:main Jul 24, 2025
144 of 151 checks passed
@elinor-fung elinor-fung deleted the host-trace-name branch July 24, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants