Release 1.12.2#1626
Conversation
Added RISC-V 64 architecture support to the package architecture system. This includes: 1. Added RISCV64 enum value to Architecture class 2. Implemented toString() method returning "riscv64" 3. Implemented getTriplet() method returning "riscv64-linux-gnu" 4. Added parsing support for "riscv64" string input 5. Updated test cases to include RISC-V 64 architecture This change enables the package system to properly handle RISC-V 64 architecture, which is necessary for supporting applications built for RISC-V 64 platforms. The architecture follows the same pattern as other supported architectures with proper string conversion and triplet generation. Influence: 1. Verify Architecture::toString() returns "riscv64" for RISCV64 enum 2. Test Architecture::getTriplet() returns "riscv64-linux-gnu" for RISCV64 3. Validate Architecture constructor parses "riscv64" string correctly 4. Confirm existing architecture tests still pass with new RISCV64 addition 5. Test error handling for unknown architecture strings remains functional
- Parse protocol/hostname/display/screen from DISPLAY environment variable - Add unit tests for display parsing edge cases Signed-off-by: reddevillg <reddevillg@gmail.com>
Release 1.12.2.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengbo11 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 |
8ad8355
into
OpenAtom-Linyaps:release/1.12
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 primarily focuses on enhancing the robustness and flexibility of XOrg display handling within the application by completely refactoring the display parsing logic. It also incorporates support for the RISCV64 architecture, expanding the range of supported platforms. These changes are accompanied by a version increment and new unit tests to ensure the reliability of the updated display parsing mechanism. Highlights
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. Footnotes
|
deepin pr auto reviewGit Diff 代码审查报告总体评价本次提交主要包含三个方面的修改:
整体代码质量较高,逻辑清晰,但有一些可以改进的地方。 详细审查1. CMakeLists.txt 文件修改优点:
建议:
2. libs/common/CMakeLists.txt 修改优点:
建议:
3. libs/common/src/linglong/common/display.cpp 修改优点:
问题和建议:
4. libs/common/src/linglong/common/display.h 修改优点:
问题和建议:
5. libs/linglong/src/linglong/package/architecture.cpp/h 修改优点:
问题和建议:
6. libs/linglong/src/linglong/runtime/run_context.cpp 修改优点:
问题和建议:
7. libs/oci-cfg-generators/src/linglong/oci-cfg-generators/container_cfg_builder.cpp/h 修改优点:
问题和建议:
8. 测试用例修改优点:
问题和建议:
总结本次提交的代码整体质量较高,主要改进了显示系统的处理逻辑,使其更加灵活和可扩展。主要改进建议集中在:
这些改进建议不是必须的,但可以进一步提高代码质量和安全性。 |
There was a problem hiding this comment.
Code Review
This pull request bumps the project version to 1.12.2 and introduces several changes. The main functional change is a significant refactoring of the X11 DISPLAY environment variable parsing and handling. This includes a more robust parsing mechanism in libs/common/display.cpp and updated logic for setting up X11 socket mounts in the container configuration builder. Additionally, support for the riscv64 architecture has been added. The changes are accompanied by new unit tests for the display parsing logic. My review identifies a potential issue in the new display parsing logic that should be addressed.
| if (!display.empty() && display[0] == '/') { | ||
| result.protocol = "unix"; | ||
| std::error_code ec; | ||
| if (std::filesystem::exists(display, ec)) { | ||
| result.host = display; | ||
| return result; | ||
| } | ||
|
|
||
| auto dot = display.find_last_of('.'); | ||
| if (dot == std::string_view::npos) { | ||
| return LINGLONG_ERR(fmt::format("{} doesn't exist", display)); | ||
| } | ||
|
|
||
| auto sub = display.substr(0, dot); | ||
| if (std::filesystem::exists(sub, ec)) { | ||
| result.host = sub; | ||
| try { | ||
| result.screenNo = std::stoi(std::string(display.substr(dot + 1))); | ||
| if (result.screenNo < 0) { | ||
| return LINGLONG_ERR(fmt::format("invalid screen No: {}", result.screenNo)); | ||
| } | ||
| } catch (const std::exception &e) { | ||
| return LINGLONG_ERR(fmt::format("failed to get screen No: {}", e.what())); | ||
| } | ||
| return result; | ||
| } | ||
|
|
||
| return LINGLONG_ERR(fmt::format("{} doesn't exist", sub)); | ||
| } |
There was a problem hiding this comment.
The logic for parsing a display string that is an absolute path (e.g., /tmp/.X11-unix/X1) does not correctly parse the display number. It appears to default to 0 because result.displayNo is not updated in this code block. For a path like /tmp/.X11-unix/X1, result.displayNo will be 0 instead of 1. The existing tests pass because they only use X0. This could lead to incorrect behavior in ContainerCfgBuilder::buildDisplaySystem, which relies on the parsed displayNo. The display number should be extracted from the path, for example by parsing the number after the last /X in the path.
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
No description provided.