WM-58: fix: preserve Debian build flags in CMake preset ci#1054
WM-58: fix: preserve Debian build flags in CMake preset ci#1054deepin-wm wants to merge 1 commit into
Conversation
|
Skipping CI for Draft Pull Request. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAligns Debian packaging builds with the CI CMake preset while preserving dpkg-buildflags-derived compiler flags, updating presets to support env macros and Debian policy-compliant options, and simplifying GitHub Actions workflows now that waylib’s debian rules natively disable the qwlroots submodule. Sequence diagram for Debian CI build using CMake ci preset and system qwlrootssequenceDiagram
actor GithubActions
participant dpkg_buildpackage
participant debian_rules_waylib
participant cmake
rect rgb(230,230,230)
GithubActions->>dpkg_buildpackage: dpkg-buildpackage -uc -us -b
dpkg_buildpackage->>debian_rules_waylib: run debian/rules
alt before_PR
GithubActions->>debian_rules_waylib: sed -i ... -DWITH_SUBMODULE_QWLROOTS=OFF
debian_rules_waylib->>cmake: cmake -DCMAKE_INSTALL_PREFIX=/usr
cmake-->>cmake: ignore dpkg-buildflags CFLAGS/CXXFLAGS
else after_PR
debian_rules_waylib->>cmake: cmake --preset ci --builddirectory=build
debian_rules_waylib->>cmake: -DCMAKE_BUILD_TYPE=None -DWITH_SUBMODULE_QWLROOTS=OFF
cmake-->>cmake: use $env{CFLAGS} and $env{CXXFLAGS}
cmake-->>cmake: use system qwlroots (WITH_SUBMODULE_QWLROOTS=OFF)
end
cmake-->>dpkg_buildpackage: build artifacts for Debian package
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
608e7ff to
d3be173
Compare
1. Use $env{CFLAGS}/$env{CXXFLAGS} in ci preset to preserve
dpkg-buildflags security flags instead of overriding them
2. Change -Wno-stringop-overflow to -Wno-error=stringop-overflow
in treeland/waylib ci presets (downgrade to non-fatal warning)
3. Switch debian/rules to use --preset ci for consistent builds
4. Add -DCMAKE_BUILD_TYPE=None to qwlroots/waylib debian/rules
to comply with Debian packaging policy
5. Restore CMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) in qwlroots
6. Bump qwlroots/waylib CMakePresets.json version 3 -> 4
(required for $env{} macro support)
Influence:
1. Verify deepin/debian build still passes with dpkg-buildflags
2. Verify archlinux CI build still passes with cmake --preset ci
3. Test that unused variable warnings are still caught as errors
fix: 保留 Debian 构建标志在 CMake preset ci 中
1. 在 ci preset 中使用 $env{CFLAGS}/$env{CXXFLAGS} 保留
dpkg-buildflags 安全标志,而非覆盖它们
2. 在 treeland/waylib ci preset 中将 -Wno-stringop-overflow
改为 -Wno-error=stringop-overflow(降级为非致命警告)
3. 切换 debian/rules 使用 --preset ci 以保持构建一致性
4. 在 qwlroots/waylib debian/rules 中添加
-DCMAKE_BUILD_TYPE=None 以符合 Debian 打包策略
5. 在 qwlroots 中恢复 CMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
6. 将 qwlroots/waylib CMakePresets.json 版本从 3 升至 4
($env{} 宏支持所需最低版本)
Influence:
1. 验证 deepin/debian 构建仍能通过 dpkg-buildflags
2. 验证 archlinux CI 构建仍能通过 cmake --preset ci
3. 测试未使用变量警告仍作为错误被捕获
d3be173 to
2064275
Compare
|
TAG Bot New tag: 0.8.13 |
|
|
||
| # Build waylib with submodule disabled (use system qwlroots) | ||
| # Modify debian/rules to disable submodule | ||
| sed -i 's/-DCMAKE_INSTALL_PREFIX=\/usr/-DCMAKE_INSTALL_PREFIX=\/usr -DWITH_SUBMODULE_QWLROOTS=OFF/' debian/rules |
| run: | | ||
| set -euxo pipefail | ||
| # Disable qwlroots submodule, use system-installed qwlroots package | ||
| sed -i 's/-DCMAKE_INSTALL_PREFIX=\/usr/-DCMAKE_INSTALL_PREFIX=\/usr -DWITH_SUBMODULE_QWLROOTS=OFF/' debian/rules |
There was a problem hiding this comment.
不应该动rules,这样会影响非github action的deb打包,本次目的只想改变github actioin的构建,我觉得可以用sed替换文件内容的方式进行
|
#1070 在这里完成了 |
Fixes GitHub Actions builds not using the correct CMake configuration (CI Build Config).
Changes
$env{CFLAGS}/$env{CXXFLAGS}in ci preset to preserve dpkg-buildflags security flags instead of overriding them-Wno-stringop-overflowto-Wno-error=stringop-overflowin treeland/waylib ci presetsdebian/rulesto use--preset ciwith--builddirectory=buildfor consistent builds-DCMAKE_BUILD_TYPE=Noneto qwlroots/waylibdebian/rulesto comply with Debian packaging policyCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)in qwlrootsCMakePresets.jsonversion 3 → 4 (required for$env{}macro support)-DWITH_SUBMODULE_QWLROOTS=OFFto waylibdebian/rulesfor system qwlrootsFiles Changed
CMakePresets.json— ci preset:$env{}macros,-Wno-error=stringop-overflowdebian/rules— use--preset ci --builddirectory=build, removeDEB_CFLAGS_MAINT_APPEND/DEB_CXXFLAGS_MAINT_APPENDqwlroots/CMakePresets.json— version 3→4,$env{}macrosqwlroots/debian/rules—--preset ci -DCMAKE_BUILD_TYPE=None -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) --builddirectory=buildwaylib/CMakePresets.json— version 3→4,$env{}macros,-Wno-error=stringop-overflowwaylib/debian/rules—--preset ci -DCMAKE_BUILD_TYPE=None -DWITH_SUBMODULE_QWLROOTS=OFF --builddirectory=buildRelated: #WM-58
Summary by Sourcery
Align CMake CI presets and Debian packaging rules to use the shared
cipreset while preserving Debian build flags and disabling the qwlroots submodule where appropriate.Bug Fixes:
Enhancements:
debian/rulesacross qwlroots and waylib to build via theciCMake preset with explicit build directories and Debian-compliantCMAKE_BUILD_TYPEsettings.CMAKE_LIBRARY_PATHconfiguration for qwlroots to ensure correct multiarch library discovery and prefer system qwlroots over the submodule in waylib builds.CI:
debian/rules, relying instead on packaging configuration for submodule control.