Skip to content

Commit 3997178

Browse files
committed
Merge branch 'master' into feat/emit-transaction-data-in-trace-context-data_joshua
# Conflicts: # CHANGELOG.md
2 parents 65c4373 + 34a9901 commit 3997178

10 files changed

Lines changed: 102 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,48 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
**Features**:
6+
7+
- Provide version information for non-static Windows binaries. ([#1076](https://github.com/getsentry/sentry-native/pull/1076), [crashpad#110](https://github.com/getsentry/crashpad/pull/110))
8+
39
**Fixes**:
410

5-
- Emit `transaction.data` inside `context.trace.data` ([#1075](https://github.com/getsentry/sentry-native/pull/1075))
11+
- Correct the timeout specified for the upload-task awaiting `dispatch_semaphore_wait()` when using an HTTP-proxy on macOS. ([#1077](https://github.com/getsentry/sentry-native/pull/1077), [crashpad#111](https://github.com/getsentry/crashpad/pull/111))
12+
- Emit `transaction.data` inside `context.trace.data`. ([#1075](https://github.com/getsentry/sentry-native/pull/1075))
13+
14+
**Thank you**:
15+
16+
[olback](https://github.com/olback)
617

718
## 0.7.12
819

920
**Features**:
1021

11-
- Add `sentry_capture_minidump()` to capture independently created minidumps ([#1067](https://github.com/getsentry/sentry-native/pull/1067))
22+
- Add `sentry_capture_minidump()` to capture independently created minidumps. ([#1067](https://github.com/getsentry/sentry-native/pull/1067))
1223

1324
**Fixes**:
1425

15-
- Add breadcrumb ringbuffer to avoid O(n) memmove on adding more than max breadcrumbs ([#1060](https://github.com/getsentry/sentry-native/pull/1060))
26+
- Add breadcrumb ringbuffer to avoid O(n) memmove on adding more than max breadcrumbs. ([#1060](https://github.com/getsentry/sentry-native/pull/1060))
1627

1728
## 0.7.11
1829

1930
**Fixes**:
2031

21-
- Reject invalid trace- and span-ids in context update from header ([#1046](https://github.com/getsentry/sentry-native/pull/1046))
32+
- Reject invalid trace- and span-ids in context update from header. ([#1046](https://github.com/getsentry/sentry-native/pull/1046))
2233
- Lookup `GetSystemTimePreciseAsFileTime()` at runtime and fall back to `GetSystemTimeAsFileTime()` to allow running on Windows < 8. ([#1051](https://github.com/getsentry/sentry-native/pull/1051))
23-
- Allow for empty DSN to still initialize crash handler ([#1059](https://github.com/getsentry/sentry-native/pull/1059))
34+
- Allow for empty DSN to still initialize crash handler. ([#1059](https://github.com/getsentry/sentry-native/pull/1059))
2435

2536
## 0.7.10
2637

2738
**Fixes**:
2839

2940
- Correct the timestamp resolution to microseconds on Windows. ([#1039](https://github.com/getsentry/sentry-native/pull/1039))
3041

42+
**Thank you**:
43+
44+
- [ShawnCZek](https://github.com/ShawnCZek)
45+
3146
## 0.7.9
3247

3348
**Fixes**:

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ if(WIN32)
369369
endif()
370370
endif()
371371

372+
include(cmake/utils.cmake)
373+
if (WIN32 AND SENTRY_BUILD_SHARED_LIBS)
374+
sentry_add_version_resource(sentry "Client Library")
375+
endif()
376+
372377
# handle platform libraries
373378
if(ANDROID)
374379
set(_SENTRY_PLATFORM_LIBS "dl" "log")

cmake/utils.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generates a version resource file from the `sentry.rc.in` template for the `TGT` argument and adds it as a source.
2+
function(sentry_add_version_resource TGT FILE_DESCRIPTION)
3+
# generate a resource output-path from the target name
4+
set(RESOURCE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${TGT}.rc")
5+
set(RESOURCE_PATH_TMP "${RESOURCE_PATH}.in")
6+
7+
# Extract major, minor and patch version from SENTRY_VERSION
8+
string(REPLACE "." ";" _SENTRY_VERSION_LIST "${SENTRY_VERSION}")
9+
list(GET _SENTRY_VERSION_LIST 0 SENTRY_VERSION_MAJOR)
10+
list(GET _SENTRY_VERSION_LIST 1 SENTRY_VERSION_MINOR)
11+
list(GET _SENTRY_VERSION_LIST 2 SENTRY_VERSION_PATCH)
12+
13+
# Produce the resource file with configure-time replacements
14+
configure_file("${CMAKE_SOURCE_DIR}/sentry.rc.in" "${RESOURCE_PATH_TMP}" @ONLY)
15+
16+
# Replace the `ORIGINAL_FILENAME` at generate-time using the generator expression `TARGET_FILE_NAME`
17+
file(GENERATE OUTPUT ${RESOURCE_PATH} INPUT ${RESOURCE_PATH_TMP})
18+
19+
# Finally add the generated resource file to the target sources
20+
target_sources("${TGT}" PRIVATE "${RESOURCE_PATH}")
21+
endfunction()

scripts/bump-version.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ perl -pi -e "s/^#define SENTRY_SDK_VERSION.*/#define SENTRY_SDK_VERSION \"${NEW_
1818
perl -pi -e "s/\"version\": \"[^\"]+\"/\"version\": \"${NEW_VERSION}\"/" tests/assertions.py
1919
perl -pi -e "s/sentry.native\/[^\"]+\"/sentry.native\/${NEW_VERSION}\"/" tests/test_integration_http.py
2020
perl -pi -e "s/^versionName\=.*/versionName\=${NEW_VERSION}/" ndk/gradle.properties
21+
perl -pi -e "s/^sentry_version \=.*/sentry_version \= \"${NEW_VERSION}\"/" tests/win_utils.py

sentry.rc.in

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1 VERSIONINFO
2+
FILEVERSION @SENTRY_VERSION_MAJOR@,@SENTRY_VERSION_MINOR@,@SENTRY_VERSION_PATCH@,0
3+
PRODUCTVERSION @SENTRY_VERSION_MAJOR@,@SENTRY_VERSION_MINOR@,@SENTRY_VERSION_PATCH@,0
4+
BEGIN
5+
BLOCK "StringFileInfo"
6+
BEGIN
7+
BLOCK "040904E4"
8+
BEGIN
9+
VALUE "FileDescription", "@FILE_DESCRIPTION@"
10+
VALUE "FileVersion", "@SENTRY_VERSION@"
11+
VALUE "InternalName", "sentry-native"
12+
VALUE "LegalCopyright", "https://sentry.io"
13+
VALUE "OriginalFilename", "$<TARGET_FILE_NAME:@TGT@>"
14+
VALUE "ProductName", "Sentry Native SDK"
15+
VALUE "ProductVersion", "@SENTRY_VERSION@"
16+
END
17+
END
18+
BLOCK "VarFileInfo"
19+
BEGIN
20+
VALUE "Translation", 0x409, 1252
21+
END
22+
END

tests/cmake.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import shutil
44
import subprocess
55
import sys
6+
import platform
7+
from pathlib import Path
68

79
import pytest
810

@@ -204,6 +206,14 @@ def cmake(cwd, targets, options=None):
204206
except subprocess.CalledProcessError:
205207
raise pytest.fail.Exception("cmake build failed") from None
206208

209+
# check if the DLL and EXE artifacts contain version-information
210+
if platform.system() == "Windows":
211+
from tests.win_utils import check_binary_version
212+
213+
check_binary_version(Path(cwd) / "sentry.dll")
214+
check_binary_version(Path(cwd) / "crashpad_wer.dll")
215+
check_binary_version(Path(cwd) / "crashpad_handler.exe")
216+
207217
if "code-checker" in os.environ.get("RUN_ANALYZER", ""):
208218
# For whatever reason, the compilation summary contains duplicate entries,
209219
# one with the correct absolute path, and the other one just with the basename,

tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pytest-httpserver==1.0.10
44
msgpack==1.0.8
55
pytest-xdist==3.5.0
66
clang-format==19.1.3
7+
pywin32==308; sys_platform == "win32"

tests/unit/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ sentry_get_property(INCLUDE_DIRECTORIES)
1313
sentry_get_property(LINK_LIBRARIES)
1414
sentry_get_property(INTERFACE_LINK_LIBRARIES)
1515

16+
list(FILTER SENTRY_SOURCES EXCLUDE REGEX "\\.rc$")
17+
1618
add_executable(sentry_test_unit
1719
${SENTRY_SOURCES}
1820
main.c

tests/win_utils.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pathlib
2+
import win32api
3+
4+
sentry_version = "0.7.12"
5+
6+
7+
def check_binary_version(binary_path: pathlib.Path):
8+
if not binary_path.exists():
9+
return
10+
11+
info = win32api.GetFileVersionInfo(str(binary_path), "\\")
12+
ms = info["FileVersionMS"]
13+
ls = info["FileVersionLS"]
14+
file_version = (ms >> 16, ms & 0xFFFF, ls >> 16, ls & 0xFFFF)
15+
file_version = f"{file_version[0]}.{file_version[1]}.{file_version[2]}"
16+
if sentry_version != file_version:
17+
raise RuntimeError(
18+
f"Binary {binary_path.parts[-1]} has a different version ({file_version}) than expected ({sentry_version})."
19+
)

0 commit comments

Comments
 (0)