Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)5.4k · #14961

azldev-build-component

Skill này làm gì

Skill này giải thích cách build một thành phần azldev và xử lý các lỗi build. Nó dành cho lập trình viên đóng gói phần mềm với azldev và cần sửa một bản build bị lỗi.

Khi nào nên dùng

  • ✓Khi một bản build thành phần azldev bị lỗi và bạn cần tìm nguyên nhân.
  • ✓Khi bạn muốn build lại một gói với kho cục bộ các phụ thuộc của nó.
  • ✓Khi một kiểm tra kiểm thử bị lỗi nên được tắt cho một thành phần cụ thể.

Liên kết skill

https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-build-component/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-build-component/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Build thành phần azldev của tôi bị lỗi ở pha kiểm tra. Bạn có thể giúp tôi tìm nguyên nhân và lặp lại quá trình build không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent làm theo vòng lặp render, build và kiểm thử, xem xét đặc tả đã render và các diff. Nó dùng các tùy chọn build của công cụ để nối chuỗi phụ thuộc và giữ môi trường build để gỡ lỗi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Build and debug a component

Never install built RPMs on your host — they target the distro, not your dev machine. Test them in a chroot with the azldev-mock skill. Building and testing are separate steps: azldev comp build produces RPMs; it does not test them.

Build

azldev comp build -p <name>                                     # one component
azldev comp build -p <a> -p <b> --local-repo-with-publish <dir> # chain deps via a local repo
azldev comp build -p <name> --local-repo <dir>                  # rebuild against a populated repo

Build foundational packages before their dependents. RPMs land in the project's configured output directory (out by default). -q quiets output but hides build progress — use it only for inner-loop builds you expect to succeed.

The inner loop

investigate → modify → render → build → test → inspect

Step Command
Investigate read the rendered spec under specs/, or azldev comp diff-sources -p <name>
Modify edit the component's .comp.toml (see the azldev-overlays and azldev-comp-toml skills)
Verify azldev comp render -p <name> (fast — skips source tarballs)
Build azldev comp build -p <name>
Test azldev adv mock shell --add-package <rpm> (see the azldev-mock skill)
Inspect azldev comp build -p <name> --preserve-buildenv always, then a mock shell

Prefer comp render for quick overlay verification; use comp diff-sources to see the exact overlay effect (it fetches sources once, applies overlays to a copy, and diffs the two trees). Builds can be slow — set generous timeouts.

Finalize with azldev comp update -p <name> before opening a PR (see the azldev-update-component skill).

Debugging build failures

  1. Render error mentioning a non-standard Release tag — a release-calculation issue; see the azldev-comp-toml skill.
  2. Preview error mentioning rpmdev-bumpspec, rpmdev-packager, rpm, rpmspec, python3, or the Python RPM module — this applies only when you explicitly use the temporary --rpmdev-bumpspec preview. Provision the named prerequisite for that opt-in path. Without the flag, azldev keeps the legacy static Release calculation.
  3. Overlay did not apply as expected — azldev comp diff-sources -p <name> shows what the overlays actually change.
  4. Inspect the build environment — azldev comp build -p <name> --preserve-buildenv on-failure (values on-failure, always, never), then enter a mock shell.
  5. Failing %check — fix the tests first (root cause, upstream patches, targeted fixes). Only as a last resort, disable with build.check.skip = true and a required build.check.skip_reason explaining what fails, why it cannot be fixed, and whether it is temporary. A transient --no-check build flag exists for one-off local builds.

Per-component build tweaks (build.defines, build.without) live in the .comp.toml — see the azldev-comp-toml skill.

Generated by azldev docs agent; do not hand-edit.

Câu hỏi thường gặp

Có nên cài các RPM đã build lên máy tính không?

Không. Skill ghi rằng nên kiểm thử gói trong mock build root, vì chúng nhắm tới bản phân phối chứ không phải máy của bạn.

Build có kiểm thử gói luôn không?

Không. Skill ghi rằng build và kiểm thử là hai bước riêng.

Tôi có thể bỏ qua một kiểm tra bị lỗi không?

Skill nhắc việc tắt một kiểm tra bị lỗi cho một thành phần qua một cài đặt, và cần dùng thận trọng.

Chi tiết

Mô tả gốc của tác giả

Read this before building a component or diagnosing a build failure; do not guess build flags or the inner loop. Explains how to build, iterate on, and debug an azldev component, covering comp build flags (local-repo, preserve-buildenv), the render/build/test inner loop, diff-sources, and disabling a failing %check via check.skip. Triggers include build component, build failed, build error, inner loop, preserve buildenv, local repo, disable check.

repo: microsoft/azurelinux

Độ phổ biến

Sao GitHub
5.4k
Vị trí xếp hạng
#14961
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự