feat: add PipeWire socket mount support for sandbox#1746
Conversation
|
[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 |
|
pre-commit.ci autofix |
There was a problem hiding this comment.
Code Review
This pull request introduces support for mounting the PipeWire socket inside the sandbox via a new enable_pipewire configuration option and a corresponding --enable-pipewire CLI flag. This includes updates to the API schemas, CLI arguments, container builder, and OCI configuration generator, along with associated unit tests. Feedback on the changes highlights a critical issue in ContainerCfgBuilder::buildXDGRuntime(), where calling std::filesystem::is_socket without an std::error_code argument inside a noexcept function could throw an exception and crash the application if the path is inaccessible or does not exist.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
d263416 to
2dadc44
Compare
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
2dadc44 to
d3e2ec4
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for mounting the PipeWire socket inside the sandbox via a new "enable_pipewire" configuration option and a corresponding "--enable-pipewire" CLI flag. It updates the schema, API models, container builders, and OCI configuration generators to handle this new option, and includes comprehensive unit tests. The feedback highlights a redundant nested "if (pipewireMountOption)" check in "container_cfg_builder.cpp" that should be simplified.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
1. Added `enable-pipewire` flag to CLI for enabling PipeWire socket mount 2. Extended API schema v1 with `enable_pipewire` option in RuntimeConfigure 3. Implemented mount logic in ContainerCfgBuilder to bind host PipeWire socket into container 4. Enhanced container_builder to resolve XDG runtime directory and mount socket 5. Added unit tests covering runtime config and CLI option propagation 6. Updated merge logic for runtime configs to handle PipeWire setting 7. Integrated option flow from CLI, runtime config, and JSON serialization/deserialization Log: Added --enable-pipewire option to mount PipeWire audio socket inside sandbox for audio support Influence: 1. Test CLI flag with `--enable-pipewire` on container run, verify socket is mounted 2. Test runtime config JSON with `enable_pipewire: true`, verify mount behavior 3. Test mount failure when host socket does not exist or is not a socket 4. Test config merge: partial configs, overwrite order, and default behavior 5. Verify socket accessibility inside container (permissions, path) 6. Test combined with other options like --disable-xdp to confirm no conflicts 7. Test on systems with and without PipeWire installed 8. Verify backward compatibility for existing configs without the new field
d3e2ec4 to
a57e109
Compare
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 文件: libs/oci-cfg-generators/src/linglong/oci-cfg-generators/container_cfg_builder.cpp
// 在 buildXDGRuntime() 中增加防御性检查
if (pipewireMountOption) {
if (!containerXDGRuntimeDir.has_value()) {
return LINGLONG_ERR("container XDG runtime dir is not set");
}
bindIfExist(*runMount,
pipewireMountOption->hostSocketPath,
*containerXDGRuntimeDir / "pipewire-0",
false);
} |
enable-pipewireflag to CLI for enabling PipeWire socket mountenable_pipewireoption in RuntimeConfigureLog: Added --enable-pipewire option to mount PipeWire audio socket inside sandbox for audio support
Influence:
--enable-pipewireon container run, verify socket is mountedenable_pipewire: true, verify mount behavior