Repository navigation
build(linglong): migrate to buildext.apt declarative dependencies - #534
Conversation
Replace the manual install_dep/deploy_dep packaging with declarative buildext.apt.build_depends/depends, aligning with the buildext migration of deepin-movie-reborn and deepin-editor: - declare build-time packages missing from base/runtime (cmake, ffmpeg dev libs, v4l/portaudio/pciaccess/usb/va/imageeditor/gstreamer dev) - declare runtime packages missing from base/runtime (deepin-event-log, libimageeditor6, libportaudio2, libffmpegthumbnailer4v5, gst plugins-base/good, dmidecode); drop entries unused by code or already provided by base/runtime - fix hardcoded include paths (gstreamer/libusb) for the buildext layout via build-time seds, keeping src/CMakeLists.txt untouched - copy real libblas.so.3/liblapack.so.3 and create bare-name symlinks (libswscale/libffmpegthumbnailer/libportaudio) into the app lib dir, reproducing the old layer's dlopen support and replacing the mv-blas/lapack + LDD_FILES logic Verified with ll-builder build (runtime ldd check included); the app runs with zero dlopen failures in an offscreen smoke test. Change-Id: I7ce1c50db645bbad31d670090aabdbdc85691205
|
Warning
详情 {
"dmidecode": {
"linglong.yaml": [
" - dmidecode"
]
}
} |
Reviewer's Guide本 PR 将 deepin-camera 从手动 apt 下载、解包和 LDD 部署迁移到 buildext.apt 的声明式依赖管理,并在保持源码构建不变的基础上适配头文件路径及运行时动态库布局,确保层内 ldd 检查和应用启动兼容性。 Sequence diagram for buildext dependency migrationsequenceDiagram
participant Builder as ll-builder
participant Buildext as buildext.apt
participant CMake as CMake build
participant Layer as Application layer
participant Check as Runtime check
Builder->>Buildext: Resolve build_depends
Buildext-->>CMake: Provide development headers and libraries
CMake->>CMake: cmake --build build-linglong
CMake->>Layer: Install deepin-camera
Builder->>Buildext: Resolve depends
Buildext-->>Layer: Add runtime packages
Layer->>Layer: Copy libblas.so.3 and liblapack.so.3
Layer->>Layer: Create bare-name dlopen links
Layer->>Check: Validate installed binaries
Check-->>Builder: ldd closure passes
Flow diagram for runtime library compatibilityflowchart TD
App["deepin-camera"] --> Loader["Runtime dlopen by bare name"]
Loader --> Links["libswscale.so\nlibffmpegthumbnailer.so\nlibportaudio.so"]
Loader --> EventLog["libdeepin-event-log.so from depends"]
FFmpeg["ffmpegthumbnailer / ffmpeg"] --> BLAS["Real libblas.so.3 and liblapack.so.3"]
Links --> Layer["Application library directory"]
EventLog --> Layer
BLAS --> Layer
Layer --> Valid["No missing libraries in ldd check"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['无需修改,语法和逻辑均正确'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['建议将 src/CMakeLists.txt 中的 ${CMAKE_INSTALL_PREFIX}/include/gstreamer-1.0 和 ${CMAKE_INSTALL_PREFIX}/include/libusb-1.0 路径改为使用 CMake find_package 或 pkg_check_modules 自动检测,避免构建时 sed 修改源文件'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['无需修改,性能表现良好'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: ['无需修改,安全合规'] 💡 改进建议代码示例# 建议:将 src/CMakeLists.txt 中的头文件路径改为通过 CMake 自动检测,避免构建时 sed 修改
#
# 在 src/CMakeLists.txt 中,将硬编码路径替换为 find_package / pkg_check_modules:
#
# # 旧代码(需 sed 修改):
# target_include_directories(deepin-camera PRIVATE
# ${CMAKE_INSTALL_PREFIX}/include/gstreamer-1.0
# ${CMAKE_INSTALL_PREFIX}/include/libusb-1.0
# )
#
# # 新代码(自动检测,无需 sed):
# find_package(PkgConfig REQUIRED)
# pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
# pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
#
# target_include_directories(deepin-camera PRIVATE
# ${GSTREAMER_INCLUDE_DIRS}
# ${LIBUSB_INCLUDE_DIRS}
# )
#
# 这样无论头文件安装在 ${PREFIX}/include 还是 /usr/include,
# CMake 都能自动定位,linglong.yaml 中可移除 sed 命令。本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind 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 |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
迁移 deepin-camera 的玲珑打包方式:将手动
apt --download-only+install_dep/deploy_dep/LDD_FILES方案替换为声明式buildext.apt.build_depends/depends,与 deepin-movie-reborn、deepin-editor 已完成的 buildext 迁移保持一致。变更内容
install_dep、deploy_dep脚本及.reuse/dep5中对应的 REUSE 条目buildext.apt.build_depends(仅声明 base/runtime 层未提供的构建期包):cmake、libavutil-dev、libavformat-dev、libavcodec-dev、libswscale-dev、libswresample-dev、libv4l-dev、portaudio19-dev、libpciaccess-dev、libusb-1.0-0-dev、libffmpegthumbnailer-dev、libva-dev、libimageeditor6-dev、libgstreamer1.0-dev、libgstreamer-plugins-base1.0-dev
(Qt6/DTK6/X11/glib/udev 等开发包与工具链由 base
org.deepin.base/25.2.2与 runtimeorg.deepin.runtime.dtk/6.7.0提供;debian/control 中未被代码引用的 deepin-gettext-tools 等条目已剔除)buildext.apt.depends(仅声明 base/runtime 层未提供的直接运行时包):deepin-event-log、libimageeditor6、libportaudio2、libffmpegthumbnailer4v5、gstreamer1.0-plugins-base、gstreamer1.0-plugins-good、dmidecode
(代码 QProcess 调用 dmidecode;deepin-event-log 提供代码 dlopen 的裸名 libdeepin-event-log.so;blas/lapack 由 apt 闭包自动带入,替代旧配方的手动 mv + ldconfig)
build::保留源码编译,新增两处头文件路径 sed(gstreamer/libusb,buildext 将 -dev 头文件装入 /usr/include 而非 ${PREFIX}/include),不改源码libblas.so.3/liblapack.so.3到应用库目录(其顶层符号链接指向层内不存在的 /etc/alternatives,会导致层内 ffmpegthumbnailer/ffmpeg 二进制 ldd 检查失败)libswscale.so/libffmpegthumbnailer.so/libportaudio.so(代码经 libPath()/load_libs.c 按裸名 dlopen,缺失会导致缩略图等功能失效)验证
ll-builder build全流程通过(含 [Runtime Check] ldd 闭包检查),产物层 241M(对比:deepin-movie-reborn 迁移后 317M)ldd ./deepin-camera无 not found;QT_QPA_PLATFORM=offscreen启动 10s 无 dlopen 失败、无崩溃(无摄像头设备仅报正常警告)Summary by Sourcery
Migrate deepin-camera’s Linglong packaging to declarative APT dependencies while preserving runtime library compatibility and validated application startup.
Bug Fixes:
Enhancements:
Build:
Tests:
Chores: