Skip to content

feat: build dde-wlroots from source via FetchContent - #1715

Merged
wineee merged 1 commit into
linuxdeepin:master-nextfrom
wineee:master-next
Nov 24, 2026
Merged

wineee merged 1 commit into
linuxdeepin:master-nextfrom
wineee:master-next

Conversation

@wineee

@wineee wineee commented Nov 24, 2026 •

Copy link
Copy Markdown
Member
  1. Add TREELAND_FETCH_DDE_WLROOTS option (default OFF) to resolve
    dde-wlroots from exactly one of two mutually exclusive ways:
    FetchContent builds it in-tree, otherwise pkg-config discovers the
    installed dde-wlroots-dev package.
  2. FetchContent_MakeAvailable defines Wlroots::wlroots and exports
    WLR_HAVE_*/WLROOTS_VERSION so waylib regenerates wconfig.h in-tree;
    key waylib's wlroots branch off the option accordingly.
  3. Drop the stale 3rdparty/wlroots include fallback and switch the
    Arch/Debian/Deepin CI to FetchContent (no clone+install steps, no
    dde-wlroots-dev Build-Depends).

Log: No user-facing changes

Influence:

  1. Configure with -DTREELAND_FETCH_DDE_WLROOTS=ON and no installed
    dde-wlroots-dev: treeland and standalone waylib build dde-wlroots
    from source.
  2. Configure without the option: behavior is unchanged and still
    resolves the installed dde-wlroots via pkg-config.
  3. Run the Arch/Debian/Deepin CI: dde-wlroots is fetched in-tree
    instead of cloned and installed separately.

feat: 通过 FetchContent 从源码编译 dde-wlroots

  1. 新增 TREELAND_FETCH_DDE_WLROOTS 选项(默认 OFF),dde-wlroots 只从
    两种互斥方式中选其一解析:FetchContent 在树内构建,否则 pkg-config
    发现已安装的 dde-wlroots-dev 包。
  2. FetchContent_MakeAvailable 定义 Wlroots::wlroots 并导出
    WLR_HAVE_*/WLROOTS_VERSION,使 waylib 在树内重新生成 wconfig.h;
    waylib 的 wlroots 分支据此以该选项为键。
  3. 删除过时的 3rdparty/wlroots include 回退,并将 Arch/Debian/Deepin
    CI 改为 FetchContent(无克隆安装步骤、无 dde-wlroots-dev 构建依赖)。

Log: 无用户可见变化

Influence:

  1. 不带 dde-wlroots-dev 包,以 -DTREELAND_FETCH_DDE_WLROOTS=ON 配置:
    treeland 与 standalone waylib 从源码编译 dde-wlroots。
  2. 不传该选项:行为不变,仍通过 pkg-config 解析已安装的 dde-wlroots。
  3. 运行 Arch/Debian/Deepin CI:dde-wlroots 在树内拉取,
    而非单独克隆安装。

Summary by Sourcery

Enable optional in-tree dde-wlroots builds while retaining installed-package discovery as the default.

New Features:

  • Add an opt-in CMake configuration to fetch and build dde-wlroots from source for Treeland and standalone waylib builds.

Enhancements:

  • Unify wlroots resolution around the Wlroots::wlroots target and remove the obsolete vendored-header fallback.
  • Preserve installed dde-wlroots-dev discovery through pkg-config when source fetching is disabled.

CI:

  • Update Arch Linux CI to build dde-wlroots through FetchContent instead of installing it separately.
  • Update Deepin packaging CI to build and install dde-wlroots before Treeland dependency resolution.

Documentation:

  • Document the new dde-wlroots fetch option and its configuration requirements.

Chores:

  • Remove the obsolete wlroots licensing file.

@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

@wineee
wineee marked this pull request as ready for review November 24, 2026 07:44
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wineee

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 24, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Read the CMake integration that selects FetchContent or pkg-config and shares the resulting wlroots target and feature metadata with waylib.

  • CMakeLists.txt L102-124, L132-136 (+2 small edits)
  • waylib/CMakeLists.txt L26-31, L38-52
  • waylib/src/server/CMakeLists.txt L28-44, L54 (removed lines)

Review the CI configuration changes that exercise the fetched dependency in Arch and Deepin builds and prepare it for Treeland.

  • .github/workflows/treeland-archlinux-build.yml L87
  • .github/workflows/treeland-deepin-build.yml L55-80
  • .github/workflows/waylib-archlinux-build.yml L48 (removed lines), L53

Review the repository formatting configuration change accompanying the build-system update.

  • .clang-format L26-28

Documentation

Read the build-skill documentation for the new option, its dependency-resolution behavior, and disconnected Debian packaging constraint.

  • .agents/skills/treeland-build/SKILL.md L60-62

Review the removal of the repository license text file.

  • LICENSES/LGPL-2.1-or-later.txt (deleted)

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="CMakeLists.txt" line_range="115" />
<code_context>
+        dde_wlroots
+        GIT_REPOSITORY https://github.com/linuxdeepin/dde-wlroots.git
+        GIT_TAG master
+        GIT_SHALLOW TRUE
+    )
+    FetchContent_MakeAvailable(dde_wlroots)
</code_context>
<issue_to_address>
**Mutable dependency executes during configure**

When the dde-wlroots upstream `master` branch is compromised or changed to malicious content, `FetchContent_MakeAvailable` resolves the mutable branch and runs its CMake and build scripts during configuration, executing attacker-controlled code with the builder's permissions.

Pin dde-wlroots to a reviewed immutable commit (and verify its integrity) in both FetchContent declarations.

Also at `waylib/CMakeLists.txt:48`.
</issue_to_address>

### Comment 2
<location path="waylib/CMakeLists.txt" line_range="46" />
<code_context>
+    include(FetchContent)
+    FetchContent_Declare(
+        dde_wlroots
+        GIT_REPOSITORY https://github.com/linuxdeepin/dde-wlroots.git
+        GIT_TAG master
+        GIT_SHALLOW TRUE
</code_context>
<issue_to_address>
**Debian package builds cannot configure**

When a Debian package build runs with only its declared Build-Depends and either lacks Git or cannot access GitHub, debian rules force this fetch on, so `FetchContent_MakeAvailable` tries to clone dde-wlroots from GitHub and CMake configuration fails; the package does not declare Git as a build dependency or include the source.

Provide dde-wlroots in the package build without requiring an external Git clone.

Also at `CMakeLists.txt:113`, `waylib/CMakeLists.txt:50`.
</issue_to_address>

### Comment 3
<location path="waylib/src/server/CMakeLists.txt" line_range="33" />
<code_context>
+    # exported WLR_HAVE_* / WLROOTS_VERSION. The Wlroots::wlroots target
+    # already exists and carries its include dirs and compile definitions,
+    # so nothing needs to be resolved from pkg-config.
+    set(WAYLIB_WLROOTS_PUBLIC_TARGET Wlroots::wlroots)
+else()
+    # Installed dde-wlroots-dev package: resolve the static libdde-wlroots.a
</code_context>
<issue_to_address>
**Installed Waylib consumers cannot configure**

When a standalone FetchContent build installs its development package and a downstream consumer lacks installed dde-wlroots-dev, `waylibserver` exports a public `Wlroots::wlroots` dependency, but the install export does not provide that target and `WaylibServerConfig.cmake` only recreates `PkgConfig::WLR_INSTALLED` while requiring dde-wlroots through pkg-config, so install validation or downstream `find_package(Waylib)` fails.

Make the fetched wlroots dependency available to the installed export and load or recreate its target from `WaylibServerConfig.cmake` without requiring the system pkg-config package.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread CMakeLists.txt Resolved
Comment thread waylib/CMakeLists.txt Resolved
Comment thread waylib/src/server/CMakeLists.txt Resolved
1. Add TREELAND_FETCH_DDE_WLROOTS option (default OFF) to resolve
   dde-wlroots from exactly one of two mutually exclusive ways:
   FetchContent builds it in-tree, otherwise pkg-config discovers the
   installed dde-wlroots-dev package.
2. FetchContent_MakeAvailable defines Wlroots::wlroots and exports
   WLR_HAVE_*/WLROOTS_VERSION so waylib regenerates wconfig.h in-tree;
   key waylib's wlroots branch off the option accordingly.
3. Drop the stale 3rdparty/wlroots include fallback and switch the
   Arch/Debian/Deepin CI to FetchContent (no clone+install steps, no
   dde-wlroots-dev Build-Depends).

Log: No user-facing changes

Influence:
1. Configure with -DTREELAND_FETCH_DDE_WLROOTS=ON and no installed
   dde-wlroots-dev: treeland and standalone waylib build dde-wlroots
   from source.
2. Configure without the option: behavior is unchanged and still
   resolves the installed dde-wlroots via pkg-config.
3. Run the Arch/Debian/Deepin CI: dde-wlroots is fetched in-tree
   instead of cloned and installed separately.

feat: 通过 FetchContent 从源码编译 dde-wlroots

1. 新增 TREELAND_FETCH_DDE_WLROOTS 选项(默认 OFF),dde-wlroots 只从
   两种互斥方式中选其一解析:FetchContent 在树内构建,否则 pkg-config
   发现已安装的 dde-wlroots-dev 包。
2. FetchContent_MakeAvailable 定义 Wlroots::wlroots 并导出
   WLR_HAVE_*/WLROOTS_VERSION,使 waylib 在树内重新生成 wconfig.h;
   waylib 的 wlroots 分支据此以该选项为键。
3. 删除过时的 3rdparty/wlroots include 回退,并将 Arch/Debian/Deepin
   CI 改为 FetchContent(无克隆安装步骤、无 dde-wlroots-dev 构建依赖)。

Log: 无用户可见变化

Influence:
1. 不带 dde-wlroots-dev 包,以 -DTREELAND_FETCH_DDE_WLROOTS=ON 配置:
   treeland 与 standalone waylib 从源码编译 dde-wlroots。
2. 不传该选项:行为不变,仍通过 pkg-config 解析已安装的 dde-wlroots。
3. 运行 Arch/Debian/Deepin CI:dde-wlroots 在树内拉取,
   而非单独克隆安装。
@wineee
wineee merged commit 727ab78 into linuxdeepin:master-next Nov 24, 2026
10 checks passed
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.

2 participants