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

Align env var lookup in clrconfig and jithost #77025

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

am11
Copy link
Member

@am11 am11 commented Oct 13, 2022

ClrConfig checks for DOTNET_ prefix and fallback to COMPlus_ for environment variable lookup. This patch updates the lookup in superpmi to use the same order.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 13, 2022
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 13, 2022
@ghost
Copy link

ghost commented Oct 13, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

ClrConfig checks for DOTNET_ prefix and fallback to COMPlus_ for environment variable lookup. This patch updates the lookup in superpmi to use the same order.

Author: am11
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@am11 am11 force-pushed the feature/superpmi/DOTNET_<env-vars> branch from 36fe408 to 8c649d0 Compare October 13, 2022 20:34
{
static const WCHAR Prefix[] = W("COMPlus_");
static const size_t PrefixLen = (sizeof(Prefix) / sizeof(Prefix[0])) - 1;
#include <clrconfignocache.h>
Copy link
Member

Choose a reason for hiding this comment

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

As a nit, this perhaps should be in runtimedetails.h, but I guess this is ok.

Copy link
Member Author

@am11 am11 Oct 14, 2022

Choose a reason for hiding this comment

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

Yup, it's an existing header, which I have reused (to avoid redefining consts and lengths).

@AaronRobinsonMSFT, ideally we could have a unified API with flag-y options to avoid duplicate functions. The usage of such API in jisthost.cpp would look like:

ClrConfig::Get(key, &returnBuffer, (ClrConfig_USEPREFIX & ~ClrConfig_USECACHE));

Having different classes for cache vs. nochace is somewhat verbose.

Copy link
Member

Choose a reason for hiding this comment

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

@AaronRobinsonMSFT, ideally we could have a unified API with flag-y options to avoid duplicate functions. The usage of such API in jisthost.cpp would look like:

Sure, but that doesn't change the reason that the nocache version exists. Note that the nocache doesn't do any memory management nor does it work with WCHAR, it is entirely for char. This was done due to the various places that can't include or accept the lifetime management nor the requirement of chaining in the PAL. We can move the nocache, but it has broader build constraints about where it is used and done in the way it is to reduce that duplication.

@BruceForstall BruceForstall merged commit d2b6ce6 into dotnet:main Oct 14, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 14, 2022
@am11 am11 deleted the feature/superpmi/DOTNET_<env-vars> branch June 2, 2024 10:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants