Visitar URL original
ci(archlinux): build DDM from source in the Arch workflow by deepin-wm · Pull Request #1619 · linuxdeepin/treeland · GitHub
Skip to content

ci(archlinux): build DDM from source in the Arch workflow - #1619

Draft
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/bot/c422cb8bc320
Draft

deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/bot/c422cb8bc320

Conversation

@deepin-wm

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

Copy link
Copy Markdown
Contributor

问题

Arch Linux 的 Build treeland on Arch Linux 流水线在 Configure and Build treeland with ci preset 步骤失败,src/greeter/greeterproxy.cpp 报:

error: 'LastLogin' is not a member of 'DDM::DaemonMessages'
error: 'SessionDirs' is not a member of 'DDM::DaemonMessages'

这是仓库基线的依赖问题,与 #1618 的 QML 改动无关:#1575 和无关分支 xshape 报的是同样的两行,master 自身最近一次构建也是失败的。

根因:master 87e63ff4 fix(greeter): take session dirs and the last login from DDM 之后,greeter 依赖 DaemonMessages::SessionDirs / LastLogin。这两个枚举值由 ddm 仓库的 ce83963 feat(config)!: migrate DDM configuration to DConfig 引入,而该提交在 ddm 任何 tag 之后(git tag --contains ce83963 为空),也就是说目前没有任何 DDM 发行版包含它们。Arch extra 的 ddm 0.4.0-2 对应上游 0.4.0 tag,头文件里没有这两个值,于是编译失败。

不做编译期兼容降级的原因:87e63ff4 同时改了 Login 消息的协议载荷(原来发 DDM::Session(type, name),现在发会话桌面文件路径字符串)。对着 0.4.0 的头文件做 #ifdef 兜底能编过,但运行期把 Login 发给 0.4.0 的 ddm 会被错误解析,登录直接坏掉。treeland master 事实上要求新版 ddm,所以正确的修法是拉高依赖,而不是把代码降级。

改动

只改 .github/workflows/treeland-archlinux-build.yml(+17/−3):

  1. 删掉 pacman -S ddm,改为只安装 extra-cmake-modules(源码构建 DDM 需要 ECM),并在注释中写明原因。
  2. 新增 Build and Install DDM 步骤:git clone --depth 1 ddm master,用 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release 配置后 build + install,产出 /usr/include/ddm/common/Messages.h 与 /usr/lib/cmake/DDM/DDMConfig.cmake。
  3. 该步骤放在 Build and Install treeland-protocols 之后:ddm master 要求 TreelandProtocols >= 0.5.3,前一步安装的是 master(0.9.0)。

这个做法沿用仓库已有惯例:treeland-deepin-build.yml 一直是源码构建 ddm,只有 Arch 这条之前用了发行版包。

验证

在 archlinux:latest 容器里按 workflow 的同一套包重跑了整条链路(pacman 系统更新 → base/Qt6/graphics/DTK 依赖 → treeland-protocols master → ddm master → treeland master):

  • ddm master 在 Arch 上源码构建通过,装出的 Messages.h 第 55/56 行正是 SessionDirs / LastLogin;Dtk6 的 Core + Tools(/usr/lib/cmake/Dtk6Tools)由 dtk6core 提供,没有缺包。
  • treeland 用 cmake --preset ci -DBUILD_TREELAND_PROTOCOL_TESTS=ON 配置通过,DDM 识别为 >= 0.2.0,1966/1966 个目标编译链接全部通过(含 greeterproxy.cpp 与全部协议测试)。

同时说明本次没有真机运行验证:改动只涉及 CI 构建步骤,实际效果以流水线结果为准。

后续(不在本 PR 范围)

Arch 的 ddm 包会一直是 0.4.0,直到 DDM 发新版本。长期正解是 ddm 把版本提到 0.5.0 后,treeland 把 src/CMakeLists.txt 的 find_package(DDM 0.2.0) 一起抬高,这样能在 configure 阶段而不是编译阶段报错。现在不能抬——ddm master 自身的 project(VERSION) 还写着 0.4.0。

issue:WM-981

Summary by Sourcery

Build DDM from source in the Arch Linux workflow so Treeland compiles against the required daemon message definitions.

Bug Fixes:

  • Fix Arch Linux CI builds by using a DDM version that provides the daemon message fields required by Treeland.

Enhancements:

  • Build and install DDM from its upstream source before building Treeland, alongside the required CMake dependency.

CI:

  • Update the Arch Linux workflow to replace the outdated packaged DDM dependency with a source-built DDM and preserve the required build order.

1. The Arch ddm package is still 0.4.0 and predates the
   DaemonMessages::SessionDirs / LastLogin values that
   src/greeter/greeterproxy.cpp requires, so the container build failed
   with "'LastLogin' is not a member of 'DDM::DaemonMessages'".
2. Replace "pacman -S ddm" with extra-cmake-modules and add a "Build and
   Install DDM" step that clones DDM master and installs it into /usr,
   as the deepin workflow already does.
3. Keep that step after the treeland-protocols build, because DDM master
   requires TreelandProtocols >= 0.5.3 and that step installs master.

Log: Fix the Arch Linux CI build failure caused by the outdated
distribution DDM package

Influence:
1. The "Build treeland on Arch Linux" workflow should pass again on
   master and on every pull request.
2. The job now builds DDM master from source, so it needs network access
   to github.com and the extra-cmake-modules package.
3. Installing DDM into /usr must provide
   /usr/include/ddm/common/Messages.h and /usr/lib/cmake/DDM/DDMConfig.cmake
   for the treeland configure step.

ci(archlinux): Arch 构建改为源码构建 DDM

1. Arch 的 ddm 包仍是 0.4.0,缺少
   src/greeter/greeterproxy.cpp 所需的 DaemonMessages::SessionDirs /
   LastLogin,容器构建报 "'LastLogin' is not a member of
   'DDM::DaemonMessages'"。
2. 把 "pacman -S ddm" 换成 extra-cmake-modules,并新增 "Build and
   Install DDM" 步骤,克隆 DDM master 并安装到 /usr,与 deepin 流水线
   的做法保持一致。
3. 该步骤放在 treeland-protocols 构建之后——DDM master 要求
   TreelandProtocols >= 0.5.3,而前一步装的正是 master。

Log: 修复 Arch Linux CI 因发行版 DDM 版本过旧导致的编译失败

Influence:
1. "Build treeland on Arch Linux" 在 master 与所有 PR 上应恢复正常。
2. 该 job 需要访问 github.com 并安装 extra-cmake-modules 才能源码构建
   DDM master。
3. DDM 安装到 /usr 后应提供 /usr/include/ddm/common/Messages.h 与
   /usr/lib/cmake/DDM/DDMConfig.cmake,供 treeland configure 使用。

Multica Issue: WM-981
@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 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Replace the outdated Arch DDM package with a source build, installed after treeland-protocols so Treeland can use the required DDM messages and dependency.

  • .github/workflows/treeland-archlinux-build.yml L56-61, L80-91

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