Skip to content

feat(windows): add WINE and Proton runtime context - #1995

Open
GtechGovind wants to merge 5 commits into
getsentry:masterfrom
GtechGovind:agent/add-wine-os-context
Open

feat(windows): add WINE and Proton runtime context#1995
GtechGovind wants to merge 5 commits into
getsentry:masterfrom
GtechGovind:agent/add-wine-os-context

Conversation

@GtechGovind

@GtechGovind GtechGovind commented Aug 16, 2026

Copy link
Copy Markdown

Closes #1004.

Summary

  • detect WINE through the exports exposed by ntdll.dll
  • detect the precise Proton compatibility tool from Steam config_info and version metadata
  • report Wine, Proton, Proton Experimental, Proton Hotfix, GE-Proton, and custom variants through a typed runtime context
  • avoid adding the context on native Windows or when the required WINE version export is unavailable
  • add unit coverage for runtime classification and missing metadata

Validation

  • make test-unit
  • clang-format verification via scripts/check-clang-format.py

Notes

The Proton lookup follows the reference implementation in getsentry/sentry-godot#591 while keeping this PR focused on compatibility runtime detection. Broader SteamOS, device, and host OS enrichment can be added separately.

@GtechGovind
GtechGovind marked this pull request as ready for review August 16, 2026 12:47
@jpnurmi

jpnurmi commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the contribution, @GtechGovind!

While this implements the old minimal Wine metadata proposed in #1004, there's now a more recent and comprehensive reference implementation in sentry-godot:

@limbonaut What do you think? Should we rather port the Godot implementation?

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.48780% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.33%. Comparing base (38fb099) to head (7f8e655).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1995      +/-   ##
==========================================
+ Coverage   74.31%   74.33%   +0.02%     
==========================================
  Files         104      104              
  Lines       25738    25779      +41     
  Branches     4648     4656       +8     
==========================================
+ Hits        19126    19164      +38     
+ Misses       5305     5304       -1     
- Partials     1307     1311       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@limbonaut

limbonaut commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

The problem with the bare Wine context from ntdll is that it's misleading with the Proton distributions. The proton builds report wine-10.0. And while Proton is based on Wine, this misleads on which actual Wine/Proton is being used.

I see no reason why we shouldn't move Godot's implementation into native, maybe even device/OS detection too. Currently, we maintain parallel implementations in Godot and Unreal. Unity would probably need a separate treatment though, since it's based primarily on the .NET SDK. I think it would be best if we also add this in the .NET SDK.

What we do in Godot:

  • Fill runtime context with the proton/wine info.
  • Detect SteamOS, Bazzite and Linux distros and fill the os context.
  • Detect SteamDeck skews and fill the device context.
  • Detect Steam environment and add steam: true tag.

What else can we do (that I didn't get to):

  • Detect native Steam containers (scout, sniper, etc), fill runtime and report the actual host OS.

One contention point: we only have one runtime context, and both Wine and .NET compete for it (correction: specs indicate that we may add several runtime contexts). We can name it "compatibility" or "wine" context with the type "runtime".

@GtechGovind GtechGovind changed the title feat(windows): add WINE runtime context feat(windows): add WINE and Proton runtime context Aug 18, 2026
Comment thread src/sentry_os.c Outdated
Comment thread src/sentry_os.c
@jpnurmi

jpnurmi commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Hi @GtechGovind, I'm fixing up the basics for Wine and setting up a CI test pipeline at #2001. Once we have it merged, we can update this PR to test the Wine context in an actual Wine environment. I'd prefer it over the current unit test that not only forces us to expose internal details in the module API, but also doesn't guarantee that it actually works on Wine. :)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit be92308. Configure here.

Comment thread src/sentry_os.c
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.

Add WINE meta-data to OS context.

3 participants