fix: avoid icon theme init when GTK is not initialized - #5
Merged
Merged
Conversation
Backport upstream commit fab47760d3aa ("I#571 - libedataserverui: Avoid
initializing the icon_theme when building introspection data") so that
evolution-data-server 3.50.1 builds against GTK 4.18.
GTK 4.18 made gdk_display_manager_get() call gdk_ensure_initialized()
internally, so calling it before gtk_init() now aborts the process:
Gdk-ERROR **: gdk_display_manager_get() was called before gtk_init()
_libedataserverui_init_icon_theme() is called from the class_init() of
ECredentialsPrompterImplPassword, which g-ir-scanner triggers while
dumping type information. Generating EDataServerUI4-1.0.gir therefore
killed the introspection helper with SIGTRAP and the build failed at
76% (shuttle task 596422, amd64 and aarch64 alike), while the GTK3
EDataServerUI-1.2 gir was generated fine in the same run.
Guard the call with gtk_is_initialized(), which is available since
GTK 4.4 (the minimum version required by configure). At runtime the
function is only reached with GTK already initialized, so the guard
only skips the initialization during introspection/documentation
builds.
Log: Fixed the GTK 4.18 build failure of EDataServerUI4-1.0.gir
Influence:
1. Rebuild the package and confirm EDataServerUI4-1.0.gir is generated
2. Verify libedataserverui4 and its credentials prompter work in
evolution with GTK 4.18
3. Check that certificate trust prompts still pick up the bundled icons
4. Ensure no regression on GTK 3 builds of libedataserverui
5. Confirm the package still builds on architectures with older GTK
fix: GTK 未初始化时跳过 icon theme 初始化
backport 上游提交 fab47760d3aa("I#571 - libedataserverui: Avoid
initializing the icon_theme when building introspection data"),使
evolution-data-server 3.50.1 能在 GTK 4.18 下构建。
GTK 4.18 给 gdk_display_manager_get() 内部加了 gdk_ensure_initialized(),
未先 gtk_init() 就调用会直接致命退出:
Gdk-ERROR **: gdk_display_manager_get() was called before gtk_init()
_libedataserverui_init_icon_theme() 由 ECredentialsPrompterImplPassword
的 class_init() 调用,而 g-ir-scanner 在 dump 类型信息时会触发 class_init,
于是生成 EDataServerUI4-1.0.gir 时辅助程序死于 SIGTRAP,构建在 76% 处
失败(shuttle 任务 596422,amd64 与 aarch64 均如此),而同一次构建里
GTK3 的 EDataServerUI-1.2 gir 正常生成。
用 gtk_is_initialized() 守卫该调用(自 GTK 4.4 起提供,正是 configure
要求的最低版本)。运行时该函数只会在 GTK 已初始化后进入,因此该守卫
只影响 introspection 与文档构建,不改变既有行为。
Log: 修复 GTK 4.18 下 EDataServerUI4-1.0.gir 生成失败导致的构建中断
Influence:
1. 重新构建软件包,确认 EDataServerUI4-1.0.gir 正常生成
2. 在 GTK 4.18 下验证 libedataserverui4 及其凭据提示框在 evolution 中正常
3. 检查证书信任提示仍能加载随包提供的图标
4. 确保 GTK 3 版 libedataserverui 构建无回归
5. 确认在 GTK 版本较旧的架构上仍能正常构建
repo: evolution-data-server #master
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
TAG Bot TAG: 3.50.1-1deepin1 |
Contributor
Author
|
/integrate |
|
AutoIntegrationPr Bot |
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.
问题
GTK 4.18 环境下 evolution-data-server 3.50.1 构建失败(shuttle task 596422,amd64 与 aarch64 均失败),卡在 76%:
同一份日志里 GTK3 的
EDataServerUI-1.2gir 正常生成,只有 GTK4 的EDataServerUI4-1.0失败。构建环境 GTK 为 4.18.6(libgtk-4-1_4.18.6+ds-2deepin1_amd64.deb)。根因
GTK 4.18 起
gdk_display_manager_get()内部新增了gdk_ensure_initialized(),在gtk_init()之前调用会g_error致命退出(4.16 及更早是无条件创建 display manager,所以此前无害)。eds 侧的调用链是:
_libedataserverui_init_icon_theme()(src/libedataserverui/libedataserverui-private.c:68)调用gdk_display_manager_get(),而该函数又被ECredentialsPrompterImplPassword的class_init()调用(src/libedataserverui/e-credentials-prompter-impl-password.c:592)。g-ir-scanner 在 dump 类型信息时会触发 class_init,于是 introspection 辅助程序在 GTK 尚未初始化时撞上新检查,SIGTRAP 退出。修复
backport 上游提交
fab47760d3aa("I#571 - libedataserverui: Avoid initializing the icon_theme when building introspection data"),在#if GTK_CHECK_VERSION(4, 0, 0)分支开头加gtk_is_initialized()守卫。gtk_is_initialized()自 GTK 4.4 起提供,正是 configure 要求的最低 GTK 版本;e_source_registry_debug_print()在 3.50.1 的src/libedataserver/e-data-server-util.h中已存在(经libedataserver.h引入)。运行时该函数只在 GTK 已初始化后才会走到这里,因此既有行为不变。按规范只改
debian/:源码改动以 quilt 补丁形式加入debian/patches/并写入series,版本3.50.1-1→3.50.1-1deepin1。验证
gdk_display_manager_get()触发完全相同的Gdk-ERROR并且进程收到 SIGTRAP(exit 133);加上gtk_is_initialized()守卫后正常返回 0,且守卫判断前gtk_is_initialized()为 FALSE,说明守卫正好覆盖 introspection 场景。dpkg-source --before-build .三个补丁(含本补丁)全部干净应用,--after-build正常回退,源码树保持 pristine。EDataServerUI4-1.0.gir正常生成。影响面
gtk_init()之后)行为不变;