Repository navigation
build(linglong): fix file-loss regressions from buildext migration (recording crash + missing filter LUTs) - #541
Conversation
Reviewer's GuideConfigurationAdd the missing bare-name libavformat link and copy its resolved library into the app lib directory when the depends closure did not provide it, preventing recording-time dlopen failure.
Copy filter LUT assets from the build container into the application share directory because buildext dependency merging omits share/ data.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The buildext migration (dcf0c67) creates bare-name dlopen symlinks only for libswscale/libffmpegthumbnailer/libportaudio, missing libavformat.so. libavformat60 is provided only by the runtime layer and is invisible to the app's libPath() scan of Qt LibrariesPath (/usr/lib/${TRIPLET}); the lookup then falls back to the bare name, which ld.so cannot resolve without a symlink (no wildcard matching). Recording (libcam_encoder mp4/muxer -> getAvformat) therefore fails dlopen("libavformat.so") and every dlsym returns NULL, and the first call segfaults the app (ll-box retval=139) although startup, preview and filters keep working. - add libavformat.so to the bare-name symlink loop, same recipe as the other three libs (link to the real versioned file from the build container's -dev package) - add a cp -L fallback when the depends closure did not bring the real file into the app lib dir, keeping the bare link resolvable in-layer regardless of buildext skip_existing behaviour Verified with ll-builder build; in the built container (which mirrors the runtime layout, no libavformat in /usr/lib) a dlopen probe loads libavformat.so via the default ld path and resolves all recording-path symbols (avformat_open_input/alloc_output_context2/new_stream/ write_header/write_frame/write_trailer/avio_open/avio_closep); offscreen startup smoke test shows no dlopen failures. Log: 修复玲珑包录像必崩(libavformat.so 裸名缺失导致 dlopen 失败、函数指针为空) Influence: 玲珑包录像功能恢复正常,滤镜/预览行为不变 Change-Id: Iff8eb0d8af0dbfecbf7ca4a52ee09daa
89be5e8 to
57eed38
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例本次代码无需修复,实现正确。以下为当前实现的良好实践总结: ```yaml # 1. 裸名链接:先确保真实文件在目标目录,再建链接 cd ${PREFIX}/lib/${TRIPLET} for n in libavformat.so libswscale.so libffmpegthumbnailer.so libportaudio.so; do
src=$(readlink -f /usr/lib/${TRIPLET}/$n 2>/dev/null || true)
[ -n "$src" ] && [ -e "$src" ] || continue
real=$(basename "$src")
if [ ! -e "./$real" ]; then
cp -L "$src" "./$real"
fi
ln -sf "$real" "$n"
done cd - >/dev/null
# 2. 非白名单资源(share/ 目录)手动复制 if [ -d /usr/share/libimagevisualresult6/filter_cube ]; then
install -d -m 0755 ${PREFIX}/share/libimagevisualresult6/filter_cube
cp -a /usr/share/libimagevisualresult6/filter_cube/. \
${PREFIX}/share/libimagevisualresult6/filter_cube/
fi ```本报告由 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 |
|
/merge |
背景 / Background
buildext.apt 迁移(dcf0c67)后打包的玲珑包出现两个文件丢失类回归,本 PR 各用一个 commit 修复:
libavformat.soshare/,滤镜 LUT 数据丢失问题 1:录像必崩 / Recording crash
应用启动、预览、滤镜均正常,但一开始录制视频就崩溃(
ll-box retval=139/ SIGSEGV),日志libavformat.so: cannot open shared object file+ 13 个undefined symbol与load_libs.c的newAvformat()dlsym 序列完全吻合。根因:录像链路
libcam/libcam_encoder/mp4.c、muxer.c经getAvformat()→dlopen("libavformat.so")。libavformat60只由 runtime 层提供,不在 QtLibrariesPath(/usr/lib/${TRIPLET})扫描范围内,libPath()退回裸名;迁移脚本的裸名软链循环漏了libavformat.so,ld.so 不做通配匹配 → dlopen 失败 →dlsym全空 → 首次调用即 SIGSEGV。启动路径newClass()不加载 avformat,故迁移冒烟测试未覆盖。修复:裸名软链循环加入
libavformat.so;并加cp -L兜底(闭包未带入真实文件时复制,保证链接目标同目录可解析)。问题 2:滤镜文件丢失 / Missing filter LUTs
滤镜面板加载时持续输出
filter:bright/warm/cold/classic/print/gray/black file is not found..,所有滤镜不可用。根因:滤镜 LUT 数据(
.CUBE/.dat)由libimageeditor6安装在/usr/share/libimagevisualresult6/filter_cube/。旧install_dep整包解包会把它带入层;而 buildext.apt 的 depends 合并仅拷贝bin/、sbin/、lib/(linyapslinglong_builder.cppmergeOutput白名单),share/目录被设计性丢弃。应用启动时按编译期LUT_DIR(${PREFIX}/share/libimagevisualresult6/filter_cube,main.cppinitFilters())加载,目录为空 → 全部滤镜失效。修复:build 段从构建容器(
build_depends的libimageeditor6-dev→libimageeditor6提供)复制filter_cube数据到应用层 share 目录。验证 / Verification
ll-builder build成功(两个 commit 各自构建验证);/usr/lib无任何 libavformat)中用 python3-ctypes 探针验证:默认 ld 搜索路径下dlopen("libavformat.so")成功,录像链路 8 个符号(avformat_open_input / alloc_output_context2 / new_stream / write_header / write_frame / write_trailer / avio_open / avio_closep)全部可解析;files/share/libimagevisualresult6/filter_cube/含 17 个.CUBE/.dat文件;offscreen 启动冒烟测试file is not found输出为 0(修复前每个滤镜多次输出);Summary by Sourcery
Prevent buildext-based Linglong packages from omitting runtime libraries and filter assets required for recording and camera filters.
Bug Fixes:
Enhancements: