Repository navigation
fix: sync CMake version to 6.6.2 - #420
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates CMake version metadata to 6.6.2 and makes both reader components derive their default application version from PROJECT_VERSION, fixing community CMake builds while retaining Debian packaging overrides. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="batch-print/CMakeLists.txt" line_range="80" />
<code_context>
INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}"
- APP_VERSION="1.0.0"
+ APP_VERSION="${PROJECT_VERSION}"
)
</code_context>
<issue_to_address>
**Batch-print version remains unreported**
When the batch-print tool is expected to report its version, `APP_VERSION` is only defined for `batchprint-convert`; no batch-print source consumes it or sets an application version, so this change does not make the tool report 6.6.2 as promised.
Add a batch-print version-reporting path that consumes `APP_VERSION`, or narrow the claim that the tool reports the version.
</issue_to_address>| INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" | ||
| INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}" | ||
| APP_VERSION="1.0.0" | ||
| APP_VERSION="${PROJECT_VERSION}" |
There was a problem hiding this comment.
🟡 Medium · Batch-print version remains unreported
When the batch-print tool is expected to report its version, APP_VERSION is only defined for batchprint-convert; no batch-print source consumes it or sets an application version, so this change does not make the tool report 6.6.2 as promised.
Add a batch-print version-reporting path that consumes APP_VERSION, or narrow the claim that the tool reports the version.
Prompt for AI agents
In `batch-print/CMakeLists.txt` at line 80:
**Batch-print version remains unreported**
When the batch-print tool is expected to report its version, `APP_VERSION` is only defined for `batchprint-convert`; no batch-print source consumes it or sets an application version, so this change does not make the tool report 6.6.2 as promised.
Add a batch-print version-reporting path that consumes `APP_VERSION`, or narrow the claim that the tool reports the version.0398bbc to
9da0127
Compare
1. Root cause: project() VERSION and APP_VERSION defaults were never-updated "1.0.0" placeholders, and the linglong build invoked plain cmake with no version flags, so the About dialog showed "1.0.0" for installed packages 2. Fix: make project(VERSION) and the submodule APP_VERSION defaults read the injectable VERSION variable, and bridge the changelog version into the linglong build via -DVERSION (same as deepin-editor's linglong.yaml) 3. Impact: About dialog shows the release version on the deb and linglong build paths Log: Fix About dialog showing version 1.0.0 instead of 6.6.2 fix: 同步 CMake 版本号至 6.6.2 1. 根因:project() VERSION 与子模块 APP_VERSION 默认值是从未更新的 "1.0.0" 占位符,且玲珑构建以裸 cmake 调用不传版本参数,导致安装后 "关于"对话框显示 "1.0.0" 2. 方案:project(VERSION) 与子模块 APP_VERSION 默认值改为读取可注入 的 VERSION 变量;linglong.yaml 参照 deepin-editor 以 -DVERSION 传入 changelog 版本 3. 影响:deb 与玲珑构建路径的"关于"对话框均显示发版版本 Log: 修复"关于"对话框显示版本号 1.0.0 而非 6.6.2 的问题 PMS: BUG-378351
9da0127 to
e0c83c0
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ["在 linglong.yaml 中增加版本号清洗:VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}' | cut -d- -f1 | sed 's/^[0-9]*://'),剥离 Debian 修订号和 epoch 前缀"] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['在根 CMakeLists.txt 的 project() 之前增加:if(NOT VERSION) set(VERSION "1.0.0") endif(),确保非 linglong 构建也有合理默认版本', '在 reader/CMakeLists.txt 中保留默认回退:if(NOT APP_VERSION) set(APP_VERSION "${VERSION}") endif() 后增加 if(NOT APP_VERSION) set(APP_VERSION "1.0.0") endif()'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例# 根 CMakeLists.txt — 增加默认回退值
# 在 project() 之前增加 VERSION 默认值保护
if(NOT VERSION)
set(VERSION "1.0.0")
endif()
project(deepin-reader
VERSION ${VERSION}
DESCRIPTION "Deepin Document Viewer"
LANGUAGES CXX C
)
# linglong.yaml — 剥离 Debian 修订号和 epoch 前缀
# 原始行:
# VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}')
# 修改为:
VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}' | cut -d- -f1 | sed 's/^[0-9]*://')本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx 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 |
|
/merge |
修复说明
问题
文档查看器(deepin-reader)在社区 CMake 构建中,"关于"对话框显示版本号为"1.0.0",而非期望的"6.6.2"。
根因
版本号升级提交(6.6.0 → 6.6.1 → 6.6.2)仅更新了
debian/changelog和linglong.yaml,从未同步更新CMakeLists.txt中的VERSION字段及子模块APP_VERSION默认值。Debian 打包通过debian/rules传-DAPP_VERSION=$(DEB_VERSION_UPSTREAM)覆盖了默认值,故 Debian 构建正常;但社区 CMake 构建不传此参数,回退为初始占位值"1.0.0"。修复内容
CMakeLists.txt:5—VERSION 1.0.0→VERSION 6.6.2reader/CMakeLists.txt:112—set(APP_VERSION "1.0.0")→set(APP_VERSION "${PROJECT_VERSION}")batch-print/CMakeLists.txt:80—APP_VERSION="1.0.0"→APP_VERSION="${PROJECT_VERSION}"影响范围
-DAPP_VERSION覆盖机制正常)PROJECT_VERSION成为版本号唯一数据源改动安全评估
风险等级:低风险。三处改动均为 CMake 版本字符串字面值更新,不涉及函数签名、控制逻辑或外部调用者。Debian 覆盖机制不受影响。
PMS: BUG-378351
Summary by Sourcery
Synchronize application version reporting across CMake-based builds with the package version.
Bug Fixes:
Enhancements: