Skip to content

storesession: Fix build failure with glibmm >= 2.62 and libsigrok 0.5.x#127

Open
kg5zsh-png wants to merge 1 commit into
sigrokproject:masterfrom
kg5zsh-png:fix/glibmm-timeval-datetime-compat
Open

storesession: Fix build failure with glibmm >= 2.62 and libsigrok 0.5.x#127
kg5zsh-png wants to merge 1 commit into
sigrokproject:masterfrom
kg5zsh-png:fix/glibmm-timeval-datetime-compat

Conversation

@kg5zsh-png

Copy link
Copy Markdown

Problem

Building PulseView HEAD against libsigrok 0.5.x fails with:

pv/storesession.cpp:188:47: error: no viable conversion from
'Glib::DateTime' to 'Glib::TimeVal'

Session::get_acquisition_start_time() was updated to return
Glib::DateTime (correct — Glib::TimeVal was deprecated in
glibmm 2.62 and removed in 2.76). However, the libsigrok C++
binding create_header_packet() still declares its parameter as
Glib::TimeVal, so there is a type mismatch at the call site.

Fix

Convert Glib::DateTime to Glib::TimeVal at the one call site
in storesession.cpp, using DateTime::to_unix() for seconds and
DateTime::get_microsecond() for microseconds. No other files
touched.

Tested on

  • macOS 15 (Sequoia) arm64 — Apple Silicon (M-series)
  • glibmm 2.66.8 (Homebrew)
  • libsigrok 0.5.2 / libsigrokcxx 0.5.2 (Homebrew)
  • libsigrokdecode 0.6.0-git (built from source)
  • Qt 6.11.0 (Homebrew)
  • CMake 3.x, AppleClang 21 (Xcode 26 beta)

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++ binding
create_header_packet() signature from Glib::TimeVal to
Glib::DateTime — but that is a libsigrok change and out of
scope here. This patch is the minimal fix on the PulseView side.

73 de KG5ZSH

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant