Skip to content

chore(debian): remove unneeded fonts-noto-cjk runtime dependency - #199

Open
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:chore/remove-fonts-noto-cjk-dep
Open

chore(debian): remove unneeded fonts-noto-cjk runtime dependency#199
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:chore/remove-fonts-noto-cjk-dep

Conversation

@Ivy233

@Ivy233 Ivy233 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove fonts-noto-cjk from the dde-api runtime Depends in debian/control. It is a historical leftover: no code path in current dde-api uses Noto CJK fonts anymore, so the hard dependency is unnecessary.


原因分析 / Why it is no longer needed

1. 依赖的来源(2018)

fonts-noto-cjk 是 2018 年随 adjust-grub-theme 引入的(commit 69b1ee7,同批还加入了 fonts-noto-mono)。当时 GRUB 主题的菜单/标签字体是 Noto Sans CJK SC,需要运行时通过 fc-match 查找字体文件、再用 grub-mkfont 生成 pf2 字体,因此需要硬依赖该字体包。

2. 后续演进

  • 2019 年 commit 6559305:终端字体从 Noto Mono 改为 Unifont,fonts-noto-mono 依赖随之被 unifont 替换,但菜单字体仍是 Noto Sans CJK SC,故 fonts-noto-cjk 保留。
  • 2026 年 2 月 commit 8e0fda0(V25 主题迁移):默认 deepin 主题被替换为基于 fallback 的新主题,仅使用 Unifont 字体,且直接附带预生成的 unifont-regular-16.pf2(由 copyThemeFiles 复制,运行时不再生成字体);使用 Noto 的旧主题被迁移到 deepin-v20 目录。

3. 当前代码状态

  • adjustTheme() 只调用 adjustThemeFallback()adjustThemeNormalV25(),两者均不做任何字体生成;使用 Noto 字体的 adjustThemeNormalV20()死代码(仅测试调用)。
  • findFont/genPF2Font(调用 fc-match/grub-mkfont)只被上述死代码路径引用,在已发布二进制中已被 Go 链接器消除。
  • 当前生效的 deepin/deepin-fallback 主题模板仅引用 Unifont Regular(由已存在的依赖 fonts-unifont 提供)。
  • dde-api 其余二进制(device/graphic/image-blur/sound 等)均不做文本渲染。
  • language_supportpkg_depends 机制本就是在添加 ja/ko/zh 语言时按需安装 fonts-noto-cjk,这是设计上的正确途径,无需硬依赖。

验证 / Verification

已在 deepin V25.2.1(dde-api 6.0.45.0)实机确认:

  • 已安装的 /usr/lib/deepin-api/adjust-grub-theme(VERSION 20)二进制中不含 grub-mkfontfc-matchNoto Sans CJK SCdeepin-v20 任何字符串 —— 链接器死代码消除证实 Noto 路径在生产二进制中不可达
  • 系统安装的主题模板 deepin/deepin-fallback 仅引用 Unifont,且附带预生成 pf2
  • dde-daemon 的 grub2 模块(adjust-grub-theme 的调用方)二进制中无 Noto/v20 引用
  • /etc/default/grub.d/11_dde.cfg 显示 V25 主题正常在用(GRUB_THEME=/boot/grub/themes/deepin/theme.txt

风险评估 / Risk assessment

  • 标准 deepin 桌面系统:零实际影响。deepin-desktop-environment-core 硬依赖 fonts-noto-cjk,标准系统上该字体无论如何都会安装,此改动仅为打包元数据的准确性修正。
  • 裁剪/定制镜像(无 DDE core):可避免被拉入约 91MB 的 CJK 字体;dde-api 自身不渲染文本,无功能回归。
  • 唯一回归场景是未来重新启用 adjustThemeNormalV20/v20 主题,届时把依赖加回即可。

Related

PMS: TASK-394379

Summary by Sourcery

Enhancements:

  • Remove the obsolete fonts-noto-cjk runtime dependency from dde-api packaging metadata.

- The dependency was introduced in 2018 along with adjust-grub-theme, whose
  GRUB themes then used "Noto Sans CJK SC" for menu text, resolved via
  fc-match and rendered with grub-mkfont
- Since the V25 theme migration, the active deepin/deepin-fallback themes
  use Unifont only and ship a pre-generated unifont-regular-16.pf2, so no
  runtime font generation is needed anymore
- The Noto-based v20 theme path (adjustThemeNormalV20) is dead code now, and
  the font-generation code (findFont/genPF2Font) has already been eliminated
  by the linker in released binaries
- No other dde-api binary renders text, and language_support installs
  fonts-noto-cjk on demand via pkg_depends when adding ja/ko/zh locales

---

chore(debian): 移除不再需要的 fonts-noto-cjk 运行时依赖

- 该依赖于 2018 年随 adjust-grub-theme 一并引入,当时 GRUB 主题的菜单文字
  使用 "Noto Sans CJK SC" 字体,需通过 fc-match 查找字体文件并用
  grub-mkfont 生成 pf2 字体
- V25 主题迁移后,当前生效的 deepin/deepin-fallback 主题仅使用 Unifont
  字体,且自带预生成的 unifont-regular-16.pf2,运行时不再需要生成字体
- 基于 Noto 字体的 v20 主题路径(adjustThemeNormalV20)已成为死代码,字体
  生成相关代码(findFont/genPF2Font)在已发布的二进制中已被链接器消除
- 其余二进制均不进行文本渲染;language_support 在添加 ja/ko/zh 语言时会
  通过 pkg_depends 按需安装 fonts-noto-cjk

Log: 移除 dde-api 不再需要的 fonts-noto-cjk 运行时依赖
Influence: 打包依赖,不影响运行时功能
PMS: TASK-394379
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ivy233

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 Aug 19, 2026

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

Reviewer's Guide

Removes the unnecessary fonts-noto-cjk runtime dependency from the dde-api package in debian/control, keeping only the dependencies actually required at runtime.

File-Level Changes

Change Details Files
Drop the historical fonts-noto-cjk runtime dependency from the dde-api Debian package metadata.
  • Update dde-api stanza in debian/control to remove fonts-noto-cjk from Depends
  • Ensure remaining runtime dependencies still reflect actual code paths and theme assets in use
debian/control

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 reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Ivy233
Ivy233 requested review from fly602 and mhduiy August 19, 2026 03:48
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码正确移除了debian/control中的fonts-noto-cjk依赖,无任何安全问题
逻辑正确且无安全漏洞,得满分

■ 【详细分析】

  • 1.语法逻辑(正确)✓
    debian/control文件格式符合Debian打包规范,依赖列表的删除操作准确无误,没有引入语法错误
    建议:保持现有的依赖管理规范
  • 2.代码质量(良好)✓
    变更意图明确,仅移除了指定的字体依赖包,没有引入冗余或无关的修改
    建议:确保移除该依赖后系统有其他可用的CJK字体回退方案
  • 3.代码性能(无性能问题)✓
    此变更为打包配置修改,不涉及运行时代码,对系统运行性能无直接影响,反而因减少了一个依赖包的安装可能略微提升部署速度
    建议:无
  • 4.代码安全(存在0个安全漏洞)✓
    漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
    变更仅涉及Debian依赖列表的裁剪,不包含任何可执行代码、命令拼接或权限变更,无攻击面
  • 建议:无需安全修复

■ 【改进建议代码示例】

--- a/debian/control
+++ b/debian/control
@@ -48,7 +48,6 @@ Depends:
  blur-effect,
  coreutils(>=8.30),
  fontconfig,
- fonts-noto-cjk,
  libcanberra-pulse,
  locales,
  rfkill,

@deepin-bot

deepin-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.0.47
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #203

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