Repository navigation
feat(windows): add WINE and Proton runtime context - #1995
Conversation
|
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 Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1995 +/- ##
==========================================
- Coverage 74.69% 74.32% -0.37%
==========================================
Files 104 104
Lines 26182 26477 +295
Branches 4740 4821 +81
==========================================
+ Hits 19557 19680 +123
- Misses 5295 5455 +160
- Partials 1330 1342 +12 🚀 New features to boost your workflow:
|
|
The problem with the bare Wine context from 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:
What else can we do (that I didn't get to):
One |
|
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. :) |
…ontext # Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
jpnurmi
left a comment
There was a problem hiding this comment.
#2001 has been merged. There's now a dedicated Wine CI job. Let's replace the unit test with an integration test that runs in an actual Wine environment. Here's a starting point:
diff --git a/tests/test_integration_stdout.py b/tests/test_integration_stdout.py
index 54485adc..83cc0da8 100644
--- a/tests/test_integration_stdout.py
+++ b/tests/test_integration_stdout.py
@@ -389,3 +389,32 @@ def test_breakpad_stack_overflow_stdout(cmake, stack_size):
assert_attachment(envelope)
assert_minidump(envelope)
assert_breakpad_crash(envelope)
+
+
+@pytest.mark.skipif(not is_wine, reason="test needs Wine")
+def test_wine_context(cmake):
+ tmp_path = cmake(
+ ["sentry_example"],
+ {
+ "SENTRY_BACKEND": "none",
+ "SENTRY_TRANSPORT": "none",
+ },
+ )
+ env = dict(os.environ)
+ env.pop("STEAM_COMPAT_DATA_PATH", None)
+
+ output = check_output(
+ tmp_path,
+ "sentry_example",
+ ["stdout", "capture-event"],
+ env=env,
+ )
+ context = Envelope.deserialize(output).get_event()["contexts"]["wine"]
+
+ version = subprocess.check_output(["wine", "--version"], text=True).split()[0]
+ assert version.startswith("wine-")
+ assert context == {
+ "type": "runtime",
+ "name": "Wine",
+ "version": version.removeprefix("wine-"),
+ }There was a problem hiding this comment.
Thank you so much! It's starting to look good, I think. I left a few more minor findings in comments.
P.S. Feel free to let me know if you're tired of iterating the PR, and we can help with the last remaining touches. Thank you bearing with me through the constant rebases and nitpicks. :)
limbonaut
left a comment
There was a problem hiding this comment.
Thanks for adapting it! I've checked against different Proton distributions, and it works well:
Wine: {"type": "runtime", "name": "Wine", "version": "11.15"}
Proton 10.0: {"type": "runtime", "name": "Proton", "version": "10.0-4b"}
Proton Experimental: {"type": "runtime", "name": "Proton Experimental", "version": "11.0-20260805"}
Proton Hotfix: {"type": "runtime", "name": "Proton Hotfix", "version": "20260730"}
GE-Proton10-32: {"type": "runtime", "name": "GE-Proton", "version": "10-32"}
proton_tkg: {"type": "runtime", "name": "Proton Custom", "version": "TKG-proton-experimental.bleeding.edge.10.0.326241.20260312"}
Just needs a little bit more work before we can merge it.
|
Thanks @GtechGovind for the contribution, and @limbonaut for the review! 🙏 |
sentry-native 0.16.4 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`. - [ ] `resource` blocks have been checked for updates. <details> <summary>release notes</summary> <pre>**Features**: - Windows: report WINE and Proton metadata in a separate runtime context. ([#1995](getsentry/sentry-native#1995)) - Add a public custom HTTP transport client interface (`sentry_http_transport_new`) so applications can plug in their own HTTP client (e.g. platform-native ones) while sentry-native continues to own request queueing, retry/backoff, offline caching, rate-limiting, and client reports. The built-in curl and WinHTTP transports are now implemented against this same interface. ([#1987](getsentry/sentry-native#1987)) - Native/Windows: capture WER report ID and expose as `contexts.wer.report_id` in crash events when the WER integration is enabled. ([#1970](getsentry/sentry-native#1970)) - Add `sentry_set_tags` and `sentry_scope_set_tags` for updating multiple tags with a single scope flush, improving bulk-update performance. ([#1993](getsentry/sentry-native#1993)) - Add `on_crashed_last_run` callback for inspecting crash envelopes from previous runs. ([#1985](getsentry/sentry-native#1985)) - Add `sentry_get_last_event_id` and `sentry_scope_get_last_event_id` for retrieving the last event ID captured with the global or given scope, respectively. ([#1992](getsentry/sentry-native#1992)) - Native/Unix: The native crash daemon now loads `libcurl` dynamically at runtime by default when `SENTRY_LINK_CURL=AUTO`, avoiding `libcurl` linker work during process startup and significantly speeding up startup time. Explicitly set `SENTRY_LINK_CURL=ON` to link it directly. ([#1955](getsentry/sentry-native#1955)) - Add missing public scope mutators: `set_release`, `set_environment`, `set_transaction`, `remove_tag`, `remove_extra`, `remove_context`, and `remove_attachment`. ([#2011](getsentry/sentry-native#2011)) **Deprecations**: - Deprecate `sentry_options_get/set_enable_logs` and `sentry_options_get/set_enable_metrics`. ([#2000](getsentry/sentry-native#2000)) **Fixes**: - Native: store daemon logs, minidumps, crash envelopes, and scratch files in `.run` directories so they are cleaned up with the run instead of accumulating in the database root. Minidumps can still be retained with `cache_keep`, which stores `.dmp` sidecars alongside cached envelopes. ([#1976](getsentry/sentry-native#1976)) - Linux/ARM32: prevent recursive crashes when libunwind receives an unmapped initial instruction pointer during crash handling. ([#1977](getsentry/sentry-native#1977)) - Improve log and metric delivery when telemetry is captured faster than envelopes can be serialized by offloading serialization to an internal thread pool. ([#1946](getsentry/sentry-native#1946)) - Wine: fix OS version detection and cross-compiling Windows builds from Linux. ([#2001](getsentry/sentry-native#2001)) - Destroy condition variables as approriate when no longer needed. ([#2004](getsentry/sentry-native#2004)) - Crashpad/Windows: preserve module CodeView UUIDs for minimal PDB70 records with empty PDB filenames. ([#2003](getsentry/sentry-native#2003)) - Native/Windows: improve crash-processing performance for applications with many threads. ([#2018](getsentry/sentry-native#2018)) - Prevent a race between SDK reinitialization and cleanup of the previous curl client when libcurl is linked directly. ([#2015](https://github.com/getsentry/sentry-native/pull/2015))</pre> <p>View the full release notes at <a href="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/getsentry/sentry-native/releases/tag/0.16.4">https://github.com/getsentry/sentry-native/releases/tag/0.16.4</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!17725

Closes #1004.
Summary
Validation
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.