fix: mount host font configuration directories#1602
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Iceyer 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 |
deepin pr auto review这段代码修改主要是在 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议这段修改解决了容器内显示字体的问题,但为了提高健壮性和安全性,建议进行以下改进:
改进后的代码示例(建议): ContainerCfgBuilder &ContainerCfgBuilder::bindHostStatics() noexcept
{
std::vector<std::filesystem::path> statics{
"/etc/machine-id",
// Support for host fonts and font configurations
"/etc/fonts",
// FIXME: support for host /etc/ssl, ref https://github.com/p11-glue/p11-kit
"/usr/lib/locale",
"/usr/share/fontconfig",
"/usr/share/fonts",
"/usr/share/icons",
"/usr/share/themes",
// ...
};
// ... 后续处理逻辑
} |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where containerized applications failed to display CJK (Chinese, Japanese, Korean) characters correctly due to a lack of access to the host's font configuration settings. By bind-mounting essential font configuration directories from the host system into containers, applications can now properly utilize font fallback mechanisms, ensuring correct text rendering. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly adds the necessary host font configuration directories (/etc/fonts and /usr/share/fontconfig) to the container's bind mounts, which should resolve the CJK font rendering issue. The change is straightforward and follows the existing structure. While it's noted that tests could not be run due to environment issues, the change itself is low-risk. I have one suggestion to improve code consistency and maintainability.
| "/etc/machine-id", | ||
| "/etc/fonts", |
There was a problem hiding this comment.
For better maintainability and consistency, please consider keeping the list of paths sorted alphabetically within their respective groups (e.g., /etc, /usr/share). The /usr/share paths are already sorted alphabetically, and applying the same convention to the /etc paths would improve readability as this list grows.
"/etc/fonts",
"/etc/machine-id",
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Motivation
Description
/etc/fontsand/usr/share/fontconfigtobindHostStatics()mounts inlibs/oci-cfg-generators/src/linglong/oci-cfg-generators/container_cfg_builder.cppso font configuration files are bound into the container alongside font files.Testing
cmake -S . -B build -G Ninjato validate configuration, but the configure step failed in this environment due to missingGTest(Could NOT find GTest), so no unit tests were executed.Codex Task
Note
Low Risk
Low risk: a small, read-only mount list change that only expands which host fontconfig directories are bind-mounted into containers.
Overview
Ensures containerized apps can see the host’s font configuration by adding read-only binds for
/etc/fontsand/usr/share/fontconfiginContainerCfgBuilder::bindHostStatics()alongside existing font-related mounts.Written by Cursor Bugbot for commit eb8fdf6. This will update automatically on new commits. Configure here.