Visitar URL original
fix: compat with DDM 0.4.0 missing SessionDirs/LastLogin by deepin-wm · Pull Request #1615 · linuxdeepin/treeland · GitHub
Skip to content

fix: compat with DDM 0.4.0 missing SessionDirs/LastLogin - #1615

Draft
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/treeland-developer/1eda4fd8bfed
Draft

deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/treeland-developer/1eda4fd8bfed

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Arch Linux CI fails to build treeland because ddm 0.4.0-2 package headers lack DDM::DaemonMessages::SessionDirs and DDM::DaemonMessages::LastLogin — these enum values were added in ddm master (commit ce83963) but not yet released in a tagged version.

src/greeter/greeterproxy.cpp:527:30: error: 'LastLogin' is not a member of 'DDM::DaemonMessages'
src/greeter/greeterproxy.cpp:539:30: error: 'SessionDirs' is not a member of 'DDM::DaemonMessages'

Fix

Add CMake configure-time feature detection (check_cxx_source_compiles) to test whether the installed DDM headers have SessionDirs/LastLogin. Guard the two case branches in greeterproxy.cpp with the resulting DDM_HAS_LAST_LOGIN_SESSION_DIRS macro.

This follows the existing DDM_VERSION_LT_0_3_8 pattern already in the codebase.

  • On systems with ddm 0.4.0 (Arch): the check fails → macro undefined → case branches excluded → builds clean
  • On systems with ddm master (Deepin): the check passes → macro defined → full functionality

Issue: WM-978

Summary by Sourcery

Make treeland build against both released and development DDM versions by conditionally compiling newer daemon message handling.

Bug Fixes:

  • Restore compatibility with released DDM 0.4.0 headers that lack the newer SessionDirs and LastLogin messages.

Enhancements:

  • Detect DDM message support during configuration and conditionally enable the corresponding greeter message handling.

Build:

  • Add CMake compile-time feature detection for SessionDirs and LastLogin in installed DDM headers.

1. Add CMake feature detection for DDM::DaemonMessages::SessionDirs/LastLogin
2. Guard the two case branches in greeterproxy.cpp with the detected macro
3. Treeland now builds against both old (0.4.0) and new (master) DDM headers

Log: Arch CI failed because ddm 0.4.0-2 package lacks SessionDirs/LastLogin

Influence:
1. Verify Arch Linux CI build passes with ddm 0.4.0-2 installed
2. Verify Deepin build with ddm master still receives SessionDirs/LastLogin
3. Verify greeter login flow works on both old and new DDM

fix: 兼容 DDM 0.4.0 缺少 SessionDirs/LastLogin 的问题

1. 新增 CMake 特性检测 DDM::DaemonMessages::SessionDirs/LastLogin 是否存在
2. 在 greeterproxy.cpp 中用检测到的宏保护两个 case 分支
3. Treeland 可同时兼容旧版(0.4.0)和新版(master) DDM 头文件

Log: Arch CI 因 ddm 0.4.0-2 包缺少 SessionDirs/LastLogin 构建失败

Influence:
1. 验证 Arch Linux CI 在安装 ddm 0.4.0-2 时构建通过
2. 验证 Deepin 构建使用 ddm master 时仍能接收 SessionDirs/LastLogin
3. 验证 greeter 登录流程在新旧 DDM 上均正常工作

WM-978
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Compile the LastLogin message handler only when the corresponding DDM message values are available.

  • src/greeter/greeterproxy.cpp L527, L551

Configuration

Detect whether the installed DDM headers define both message values and expose the result as a compile definition for compatible builds.

  • src/CMakeLists.txt L19-37

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

3 participants