Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use Mono.RuntimeStructs rather than Mono.Runtime to test if app is running on Mono runtime - #1573

#1573
Merged
AArnott merged 1 commit into
MessagePack-CSharp:masterMessagePack-CSharp/MessagePack-CSharp:masterfrom
takeshik:fix-MonoProtection-on-newer-mono-vmCopy head branch name to clipboard
Mar 13, 2023
Merged

Use Mono.RuntimeStructs rather than Mono.Runtime to test if app is running on Mono runtime#1573
AArnott merged 1 commit into
MessagePack-CSharp:masterMessagePack-CSharp/MessagePack-CSharp:masterfrom
takeshik:fix-MonoProtection-on-newer-mono-vmCopy head branch name to clipboard

Conversation

@takeshik

Copy link
Copy Markdown
Contributor

In newer versions of .NET (6 or later), Mono runtime is still used for some targets like mobile OSes, rather than CoreCLR.
However, currently, Mono.Runtime class does not exist in latest Mono-flavored System.Private.CoreLib library.

This causes the problem of MonoProtection (introduced by #1035) not being enabled unintentionally.
The bug in Mono that is the cause of introducing MonoProtection is not fixed yet so MonoProtection is still needed.

Mono.RuntimeStructs is one of the types which exist in both the older Mono and newer Mono.
So this pullreq modifies to use this type to determine the current runtime rather than Mono.Runtime.

Other projects like BenchmarkDotnet also uses Mono.RuntimeStructs to make decisions.

In newer versions of .NET (6 or later), Mono.Runtime does not exist even
if the runtime is Mono. Mono.RuntimeStructs is one of the types which is
existed both older and newer Mono.

@AArnott AArnott left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

@AArnott AArnott added this to the v2.5 milestone Mar 13, 2023
@AArnott
AArnott merged commit 1d322ca into MessagePack-CSharp:master Mar 13, 2023
@takeshik
takeshik deleted the fix-MonoProtection-on-newer-mono-vm branch March 13, 2023 23:46
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.