Skip to content

Conversation

@am11
Copy link
Member

@am11 am11 commented Sep 24, 2021

Currently, we can specify multiple conditions with [SkipOnCoreClr] that get checked with AND semantics. To achieve OR semantics, we need to specify it multiple times (just like [ActiveIssue]), which is currently not possible. For context, see dotnet/runtime#59564 (comment).

In second commit, I have added DOTNET_ variables for each COMPlus_ one. This is because CoreCLR (despite still supports COMPlus_) now considers COMPlus_ as legacy convention and prefers DOTNET_. See https://github.com/dotnet/runtime/blob/b0159122f3570decd8ced6228681a210e2711de6/src/coreclr/inc/clrconfignocache.h#L77

@am11
Copy link
Member Author

am11 commented Sep 24, 2021

cc @safern, @AaronRobinsonMSFT, please take a look. I have not removed COMPlus_, we can clean it up at some later point, when CI scripts etc. are updated (which will take some time to happen).

private static readonly Lazy<bool> s_isGCStress3 = new Lazy<bool>(() => CompareGCStressModeAsLower(GetEnvironmentVariableValue("COMPlus_GCStress"), "0x3", "3") ||
CompareGCStressModeAsLower(GetEnvironmentVariableValue("DOTNET_GCStress"), "0x3", "3"));
private static readonly Lazy<bool> s_isGCStressC = new Lazy<bool>(() => CompareGCStressModeAsLower(GetEnvironmentVariableValue("COMPlus_GCStress"), "0xC", "C") ||
CompareGCStressModeAsLower(GetEnvironmentVariableValue("DOTNET_GCStress"), "0xC", "C"));
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could make GetEnvironmentVariableValue get the feature name and then that method could consider both prefixes and if any is set return that value? If we do that maybe consider renaming GetEnvironmentVariableValue to something like GetFeatureEnvironmentVariableValue.

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks much cleaner that way. :)

Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

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

Other than one idea, looks great! Thanks 😄

@am11 am11 force-pushed the feature/skiponcoreclr branch from e831917 to 4d8b3bb Compare September 24, 2021 19:17
@safern safern merged commit dbb65a7 into dotnet:main Sep 28, 2021
@safern
Copy link
Member

safern commented Sep 28, 2021

Thanks @am11 -- I'll let you know whenever this is consumed in dotnet/runtime.

@am11 am11 deleted the feature/skiponcoreclr branch September 28, 2021 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants