Skip to content

fix: sync CMake version to 6.6.2 - #420

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:agent/pms-bug-bot/c1aab947c531
Oct 20, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:agent/pms-bug-bot/c1aab947c531

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

修复说明

问题

文档查看器(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"。

修复内容

  1. CMakeLists.txt:5 — VERSION 1.0.0 → VERSION 6.6.2
  2. reader/CMakeLists.txt:112 — set(APP_VERSION "1.0.0") → set(APP_VERSION "${PROJECT_VERSION}")
  3. batch-print/CMakeLists.txt:80 — APP_VERSION="1.0.0" → APP_VERSION="${PROJECT_VERSION}"

影响范围

  • 社区 CMake 构建版本号显示正确(6.6.2)
  • Debian 打包构建不受影响(-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:

  • Ensure community and Linglong CMake builds use the intended project version instead of displaying the placeholder 1.0.0.

Enhancements:

  • Use the configured project version as the default application version across the reader and batch-print components.
  • Pass the package version from debian/changelog into the Linglong CMake build.

@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates 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

Change Details Files
Synchronize the project’s CMake version and propagate it as the default application version.
  • Update the top-level project version to 6.6.2.
  • Use PROJECT_VERSION for the reader’s fallback APP_VERSION.
  • Use PROJECT_VERSION for the batch-print compile definition while preserving Debian’s override path.
CMakeLists.txt
reader/CMakeLists.txt
batch-print/CMakeLists.txt

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 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>

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

Comment thread batch-print/CMakeLists.txt Outdated
INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}"
APP_VERSION="1.0.0"
APP_VERSION="${PROJECT_VERSION}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

@pengfeixx pengfeixx closed this Oct 20, 2026
@pengfeixx
pengfeixx deleted the agent/pms-bug-bot/c1aab947c531 branch October 20, 2026 05:52
@pengfeixx
pengfeixx restored the agent/pms-bug-bot/c1aab947c531 branch October 20, 2026 07:05
@pengfeixx pengfeixx reopened this Oct 20, 2026
@pengfeixx
pengfeixx force-pushed the agent/pms-bug-bot/c1aab947c531 branch 5 times, most recently from 0398bbc to 9da0127 Compare October 20, 2026 08:12
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
@pengfeixx
pengfeixx force-pushed the agent/pms-bug-bot/c1aab947c531 branch from 9da0127 to e0c83c0 Compare October 20, 2026 08:15
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 93 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交将多处硬编码版本号 1.0.0 替换为从 debian/changelog 动态提取的 ${VERSION} 变量, 实现了版本号统一管理,消除了重复硬编码。四维度均通过,无安全漏洞。 存在两个轻微问题:1) 非 linglong 构建环境下 VERSION 变量缺失时无默认回退值; 2) 从 debian/changelog 提取的版本号未剥离 Debian 修订号(如 6.6.2-1), 可能导致 CMake project(VERSION) 配置错误。建议增加版本号清洗逻辑和默认值保护。

🔍 详细分析

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个安全漏洞 ✅ 通过

🔐 发现 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 代码审查工具自动生成

@deepin-ci-robot

Copy link
Copy Markdown

[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.

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

@pengfeixx

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 5afe64b into linuxdeepin:master Oct 20, 2026
9 checks passed
@pengfeixx
pengfeixx deleted the agent/pms-bug-bot/c1aab947c531 branch October 20, 2026 08:55
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