storesession: Fix build failure with glibmm >= 2.62 and libsigrok 0.5.x#127
Open
kg5zsh-png wants to merge 1 commit into
Open
storesession: Fix build failure with glibmm >= 2.62 and libsigrok 0.5.x#127kg5zsh-png wants to merge 1 commit into
kg5zsh-png wants to merge 1 commit into
Conversation
Session::get_acquisition_start_time() returns Glib::DateTime (updated in PulseView to avoid the deprecated Glib::TimeVal), but the libsigrok C++ binding create_header_packet() still expects Glib::TimeVal. Convert at the call site: extract seconds via DateTime::to_unix() and microseconds via DateTime::get_microsecond() into a TimeVal struct. This restores the build on any host where glibmm >= 2.62 is installed (Glib::TimeVal was deprecated in 2.62, removed in 2.76). Confirmed to build and run cleanly on macOS 15 arm64 against: - glibmm 2.66.8 - libsigrok 0.5.2 / libsigrokcxx 0.5.2 - libsigrokdecode 0.6.0-git - Qt 6.11.0
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
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.
Problem
Building PulseView HEAD against libsigrok 0.5.x fails with:
Session::get_acquisition_start_time()was updated to returnGlib::DateTime(correct —Glib::TimeValwas deprecated inglibmm 2.62 and removed in 2.76). However, the libsigrok C++
binding
create_header_packet()still declares its parameter asGlib::TimeVal, so there is a type mismatch at the call site.Fix
Convert
Glib::DateTimetoGlib::TimeValat the one call sitein
storesession.cpp, usingDateTime::to_unix()for seconds andDateTime::get_microsecond()for microseconds. No other filestouched.
Tested on
PulseView builds to a native arm64 Mach-O binary and runs
correctly, including fx2lafw device detection and protocol
decoder loading.
This is the first confirmed native arm64 build of PulseView on
macOS. The fix is equally applicable on Linux hosts with newer
glibmm distributions (Arch, Fedora 38+, Ubuntu 24.04+).
Notes
A follow-on item would be updating
libsigrok's C++ bindingcreate_header_packet()signature fromGlib::TimeValtoGlib::DateTime— but that is a libsigrok change and out ofscope here. This patch is the minimal fix on the PulseView side.
73 de KG5ZSH