Skip to content

build: migrate linglong.yaml to buildext.apt - #533

Closed
re2zero wants to merge 1 commit into
linuxdeepin:masterfrom
re2zero:build/camera-buildext-migration
Closed

re2zero wants to merge 1 commit into
linuxdeepin:masterfrom
re2zero:build/camera-buildext-migration

Conversation

@re2zero

@re2zero re2zero commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Migrate linglong.yaml from manual install_dep/deploy_dep/apt --download-only to declarative buildext.apt.

Changes

  • Replace manual apt --download-only, install_dep, deploy_dep and .install generation with buildext.apt.build_depends / buildext.apt.depends.
  • Add sed command to fix ${CMAKE_INSTALL_PREFIX}/include → /usr/include in src/CMakeLists.txt at build time (required because buildext.apt installs dependencies to system paths, not ``).
  • Copy libblas.so.3/liblapack.so.3 from alternatives subdirs to \$PREFIX/lib/\$TRIPLET/ so ffmpegthumbnailer passes the ldd runtime check.

Verification

  • ll-builder build (including ldd runtime check) passes successfully.
  • Only linglong.yaml is modified; no source files changed.

Notes

  • Migration PR is separate from the pt_BR manual PR.
  • Multica issue: V-6803

Summary by Sourcery

Migrate the Linglong package build to declarative buildext.apt dependency management while preserving required runtime library availability.

Enhancements:

  • Migrate dependency handling in the Linglong build configuration to declarative APT build and runtime dependencies.
  • Retain required library discovery and installation behavior under the new dependency model.

Build:

  • Simplify the build process by removing custom dependency download, installation, deployment, and generated install metadata scripts.

Chores:

  • Remove the obsolete install_dep and deploy_dep helper scripts.

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: re2zero

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

Migrates dependency management in linglong.yaml from manual apt/install/deploy scripting to declarative buildext.apt, while adding build-time path normalization and library relocation needed for the existing CMake build and runtime ldd checks.

File-Level Changes

Change Details Files
Replace imperative dependency download, installation, deployment, and generated install metadata with declarative buildext.apt configuration.
  • Move development packages into build-time dependencies.
  • Move runtime libraries into runtime dependencies.
  • Remove manual apt archive handling, install_dep/deploy_dep calls, ldd library enumeration, and .install generation.
linglong.yaml
Adapt the build script to dependencies being installed into system paths by buildext.apt.
  • Rewrite the CMake include path from the prefix-based location to /usr/include during the build.
  • Copy BLAS and LAPACK sonames from alternatives directories into the application library directory for runtime ldd discovery.
linglong.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@re2zero
re2zero marked this pull request as ready for review October 28, 2026 01:03
@sourcery-ai

sourcery-ai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Sorry @re2zero, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 7 hours and 10 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@re2zero
re2zero force-pushed the build/camera-buildext-migration branch from a4fac8c to 2520250 Compare October 28, 2026 01:12
1. Replace manual apt --download-only, install_dep, deploy_dep and .install
   generation with declarative buildext.apt build_depends/depends.
2. Add sed to fix include path (${CMAKE_INSTALL_PREFIX}/include -> /usr/include)
   in src/CMakeLists.txt at build time, since buildext.apt installs to system paths.
3. Copy libblas.so.3/liblapack.so.3 from alternatives subdirs to $PREFIX/lib/$TRIPLET/
   so ffmpegthumbnailer passes ldd runtime check.

Log: Migrate linglong.yaml from manual install_dep/deploy_dep to buildext.apt.

Influence:
1. linglong build uses buildext.apt for dependency management.
2. ll-builder build passes including ldd runtime check.

PMS:Task-396575   Multica: V-6803
@re2zero
re2zero force-pushed the build/camera-buildext-migration branch from 2520250 to ca16c56 Compare October 28, 2026 01:26
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 87 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交将 linglong.yaml 构建配置从旧的 install_dep/deploy_dep 脚本方式迁移到声明式 buildext.apt 格式, 删除了 239 行复杂 Shell 脚本,显著简化了构建流程。代码安全维度无漏洞,代码质量和性能维度表现良好。 语法逻辑维度存在 2 个问题:sed 路径替换不完整(LUT_DIR 未修正,可能导致运行时找不到 filter cube 文件), 以及部分运行时依赖未显式声明(依赖传递依赖,存在潜在风险)。建议修复后合并。

🔍 详细分析

1. 语法逻辑 ❌

评价: 存在逻辑缺陷 ❌ 不通过

潜在问题:
✅ 未发现明显问题

建议: ['在 sed 命令后追加: sed -i "s|${CMAKE_INSTALL_PREFIX}/share|/usr/share|g" src/CMakeLists.txt,或显式复制 libimagevisualresult 资源文件到 ${PREFIX}/share/', '在 buildext.apt.depends 中显式添加应用直接链接的关键运行时库,如 libavcodec-extra60、libv4l-0、libusb-1.0-0 等']


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: ['将 || true 改为 || echo "WARNING: libblas/liblapack not found in alternatives path",使失败可见于构建日志']


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: []


💡 改进建议代码示例

# linglong.yaml build 段修复示例:
build: |
  # 修改路径
  find src -type f -name "*.service" -exec sed -i 's|^Exec=.*|Exec=deepin-camera|g' {} +

  # buildext.apt 安装依赖到系统路径而非 $PREFIX,修正 CMakeLists.txt 中的 include 和 share 路径
  sed -i 's|${CMAKE_INSTALL_PREFIX}/include|/usr/include|g' src/CMakeLists.txt
  sed -i 's|${CMAKE_INSTALL_PREFIX}/share|/usr/share|g' src/CMakeLists.txt

  # 构建
  VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}')
  cmake -B build ${conf_args} \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build -j`nproc`
  cmake --build build --target install > install.log 2>&1

  # blas/lapack 通过 alternatives 安装到子目录,复制到主库目录以供 ldd 检查通过
  mkdir -p ${PREFIX}/lib/${TRIPLET}
  cp -aL /usr/lib/${TRIPLET}/blas/libblas.so.3* ${PREFIX}/lib/${TRIPLET}/ 2>/dev/null || echo "WARNING: libblas.so.3 not found in alternatives path"
  cp -aL /usr/lib/${TRIPLET}/lapack/liblapack.so.3* ${PREFIX}/lib/${TRIPLET}/ 2>/dev/null || echo "WARNING: liblapack.so.3 not found in alternatives path"

# buildext.apt.depends 补充关键运行时库:
buildext:
  apt:
    depends:
      - libffmpegthumbnailer4v5
      - libportaudio2
      - deepin-event-log
      - libimageeditor6
      - libsdl2-2.0-0
      - gstreamer1.0-plugins-good
      - libavcodec-extra60
      - libv4l-0
      - libusb-1.0-0

本报告由 AI 代码审查工具自动生成

@re2zero

re2zero commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

#534 已合入

@re2zero re2zero closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants