Skip to content

Commit 853bf2d

Browse files
fix(win): make narrow utf-8 the canoncial path encoding (#1413)
* fix: make narrow utf-8 canonical across platforms * fix unix path effects * sentry__filewriter_byte_count now takes a const filewriter * sentry__path_filename always returns a char. * provide a platform-dependent accessor for the crashpad backend * eliminate double-free sentry__path_from_str_owned. * use correct format specifier for cli in debug logger for spawn * Apply suggestion from @JoshuaMoelans Co-authored-by: JoshuaMoelans <[email protected]> * introduce `expect_failure` parameter to integration test run() * reintroduce wide string comparisons in unit-tests * update changelog * clarify encoding in public header and clean up inline docs generally * clarify encoding in the path header * clarify remove behavior in the path header and fix windows implementation * apply review feedback and various cleanups * clean up sentry__path_append_str() sentry__path_absolute() sentry__path_clone() * update changelog * format * update breakpad * fix "unknown command tag name" * update breakpad * update crashpad * update changelog * fix is_last_error_path_not_found() definition * update breakpad to handler branch * fixup changelog after master rebase * add NULL check to sentry__string_clone_wstr * clean up crash_marker path strin accessor * add more `const` (#1422) * Update include/sentry.h Co-authored-by: JoshuaMoelans <[email protected]> * Update include/sentry.h Co-authored-by: JoshuaMoelans <[email protected]> * limit system allocated `_wfullpath()` buffer to the `sentry__path_absolute()` scope use `free()` internally in the function, and clone the resulting wide-string at the end so we can be sure that the absolute path being passed around is not using system allocated buffer. * document breaking change * fix(logs): add `expect_failure` to logs_on_crash tests (#1421) * add check for unexpected fail * refactor logs tests to use expect_failure * add missing `expect_failure` for logger tests * fix copy mistake * infer check `expect_failure` and remove from passed-in kwargs * remove check from run_benchmark * add check for `check` in kwargs * Try to run the entire test-suite against a UTF-8 CWD * realign with crashpad getsentry branch like master * make the external crashreporter fixture wide-string aware on Windows. * clean up external crashreporter fixture (fwprintf + SetConsoleOutputCP instead of explict wide to multibyte conversion) * use wmain in the external crash reporter fixture only when building for _MSC_VER * wait at the end of the WER integration tests that no WerFault.exe instances are still running * clean up wide-to-multibyte string handling --------- Co-authored-by: JoshuaMoelans <[email protected]>
1 parent 7e753da commit 853bf2d

39 files changed

+1031
-726
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ jobs:
143143
TEST_X86: 1
144144
- name: Windows (latest)
145145
os: windows-latest
146+
- name: Windows (latest, UTF-8 paths)
147+
os: windows-latest
148+
UTF8_TEST_CWD: 1
146149
- name: Windows ClangCL (latest)
147150
os: windows-latest
148151
VS_GENERATOR_TOOLSET: ClangCL
@@ -182,6 +185,7 @@ jobs:
182185
SYSTEM_VERSION_COMPAT: ${{ matrix.SYSTEM_VERSION_COMPAT }}
183186
VS_GENERATOR_TOOLSET: ${{ matrix.VS_GENERATOR_TOOLSET }}
184187
SYSTEM_PYTHON: ${{ matrix.SYSTEM_PYTHON }}
188+
UTF8_TEST_CWD: ${{ matrix.UTF8_TEST_CWD }}
185189

186190
steps:
187191
- uses: actions/checkout@v4
@@ -263,7 +267,7 @@ jobs:
263267
$newPath = ($cleanedPaths -join ';')
264268
265269
"PATH=$newPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
266-
270+
267271
- name: Installing LLVM-MINGW Dependencies
268272
if: ${{ runner.os == 'Windows' && env['TEST_MINGW'] }}
269273
shell: powershell

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22

33
## Unreleased
44

5+
**Breaking changes**:
6+
7+
- If you use a narrow string path interface (for instance, `sentry_options_set_database_path()`) on _Windows_ rather than one of the wide string variants (`sentry_options_set_database_pathw()`), then the expected encoding is now UTF-8. ([#1413](https://github.com/getsentry/sentry-native/pull/1413))
8+
59
**Fixes**:
610

711
- Add logs flush on crash. This is not available for macOS with the `crashpad` backend. ([#1404](https://github.com/getsentry/sentry-native/pull/1404))
12+
- Make narrow UTF-8 the canonical path encoding on Windows. ([#1413](https://github.com/getsentry/sentry-native/pull/1413))
813
- Re-add setting thread name for Windows transport. ([#1424](https://github.com/getsentry/sentry-native/pull/1424))
914

1015
**Internal**:
1116

1217
- Add `SENTRY_SDK_VERSION` CMake cache variable to allow downstream SDKs to override the SDK version at configuration time. ([#1417](https://github.com/getsentry/sentry-native/pull/1417))
1318
- Updated `crashpad` to 2025-10-22. ([#1426](https://github.com/getsentry/sentry-native/pull/1426), [crashpad#136](https://github.com/getsentry/crashpad/pull/136), [mini_chromium#4](https://github.com/getsentry/mini_chromium/pull/4)).
19+
- CI: bump Python to `3.12`. ([#1413](https://github.com/getsentry/sentry-native/pull/1413))
20+
- Remove any `MAX_PATH` dependencies in `crashpad` and `breakpad`. ([#1413](https://github.com/getsentry/sentry-native/pull/1413), [breakpad#43](https://github.com/getsentry/breakpad/pull/43), [crashpad#135](https://github.com/getsentry/crashpad/pull/135))
1421

1522
## 0.11.3
1623

0 commit comments

Comments
 (0)