Repository navigation
feat: build dde-wlroots from source via FetchContent - #1715
Conversation
|
Skipping CI for Draft Pull Request. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideConfigurationRead the CMake integration that selects FetchContent or pkg-config and shares the resulting wlroots target and feature metadata with waylib.
Review the CI configuration changes that exercise the fetched dependency in Arch and Deepin builds and prepare it for Treeland.
Review the repository formatting configuration change accompanying the build-system update.
DocumentationRead the build-skill documentation for the new option, its dependency-resolution behavior, and disconnected Debian packaging constraint.
Review the removal of the repository license text file.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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>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 在树内拉取, 而非单独克隆安装。
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.
WLR_HAVE_*/WLROOTS_VERSION so waylib regenerates wconfig.h in-tree;
key waylib's wlroots branch off the option accordingly.
Arch/Debian/Deepin CI to FetchContent (no clone+install steps, no
dde-wlroots-dev Build-Depends).
Log: No user-facing changes
Influence:
dde-wlroots-dev: treeland and standalone waylib build dde-wlroots
from source.
resolves the installed dde-wlroots via pkg-config.
instead of cloned and installed separately.
feat: 通过 FetchContent 从源码编译 dde-wlroots
两种互斥方式中选其一解析:FetchContent 在树内构建,否则 pkg-config
发现已安装的 dde-wlroots-dev 包。
WLR_HAVE_*/WLROOTS_VERSION,使 waylib 在树内重新生成 wconfig.h;
waylib 的 wlroots 分支据此以该选项为键。
CI 改为 FetchContent(无克隆安装步骤、无 dde-wlroots-dev 构建依赖)。
Log: 无用户可见变化
Influence:
treeland 与 standalone waylib 从源码编译 dde-wlroots。
而非单独克隆安装。
Summary by Sourcery
Enable optional in-tree dde-wlroots builds while retaining installed-package discovery as the default.
New Features:
Enhancements:
CI:
Documentation:
Chores: