-
-
Notifications
You must be signed in to change notification settings - Fork 200
feat: Auto-split build ID from version in sentry_library_info #1416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When downstream SDKs modify sentry.h to include build metadata in the version string (e.g., 0.11.3+20251016-9e31c9f-dirty), the embedded library info now automatically extracts the build ID from the version. Changes: - Parse build metadata from SENTRY_VERSION_FULL if present - Use base version (major.minor.patch) for SENTRY_VERSION field - Use extracted build ID for BUILD field - SENTRY_BUILD_ID cache variable still takes precedence - Update template to use new SENTRY_EMBEDDED_VERSION and SENTRY_EMBEDDED_BUILD_ID - Update tests to validate base version format - Add test for build ID field This ensures the embedded info format is: SENTRY_VERSION:0.11.3;BUILD:20251016-9e31c9f-dirty instead of: SENTRY_VERSION:0.11.3+20251016-9e31c9f-dirty;BUILD:0.11.3+20251016-9e31c9f-dirty 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
…_VERSION Simplifies the code by reusing the existing SENTRY_VERSION_BASE variable which already contains the major.minor.patch format without build metadata. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Optimizes the logic to check SENTRY_BUILD_ID cache variable first. Only attempts to extract build ID from version string if not explicitly provided. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Cleaner and more readable conditional structure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
According to semver.org spec, build metadata must contain only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Spaces are not allowed. Changed from: "2025-10-17 10:59:00 UTC" Changed to: "20251017-105900" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…on and build ID separation
Contributor
Author
|
@sentry review |
|
Seer had some issues with your request. Please try again. |
Contributor
Author
|
This is not good enough because it only sets the right values on the second cmake configure invocation (i.e. when the sentry.h has been patched). Instead, I think we'll need to provide a way to override the sdk version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Automatically extracts build ID from the version string read from
sentry.hwhen downstream SDKs modify it to include build metadata in semver format.Fixes the issue where both
SENTRY_VERSIONandBUILDfields contained the full version with build metadata (e.g.,0.11.3+20251016-9e31c9f-dirty).Problem
When downstream SDKs modify
sentry.hto include the full version with build ID and also setSENTRY_BUILD_IDvia CMake, the embedded library info duplicates the build ID:Solution
The CMake configuration now:
sentry.hand extracts any build metadata after the+characterSENTRY_VERSIONfieldBUILDfieldSENTRY_BUILD_IDcache variable if explicitly set (takes precedence)Result
Embedded library info now correctly separates version and build ID:
Changes
SENTRY_VERSION_FULLusing regexSENTRY_EMBEDDED_VERSIONandSENTRY_EMBEDDED_BUILD_ID+character) and added new test for build ID fieldembedded_info_build_idtestTesting
SENTRY_VERSIONcontains only base version without build metadataBUILDfield is present and non-empty🤖 Generated with Claude Code