azldev-build-component
它能做什么
这项技能说明如何构建 azldev 组件,并处理构建失败的问题。它适用于使用 azldev 打包软件、需要修复构建失败的开发者。
适用场景
- ✓当 azldev 组件构建失败,你需要找出原因时。
- ✓当你想针对依赖项的本地仓库重新构建软件包时。
- ✓当某个组件的测试检查失败,需要为该组件关闭检查时。
技能链接
https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-build-component/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 azldev 组件在 check 阶段构建失败。请帮我找出原因,并反复调整构建。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会遵循渲染、构建和测试的循环,检查渲染后的规格文件和差异。它会使用该工具的构建选项串联依赖项,并保留构建环境以便调试。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
- Render error mentioning a non-standard
Releasetag — a release-calculation issue; see theazldev-comp-tomlskill. - 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-bumpspecpreview. Provision the named prerequisite for that opt-in path. Without the flag, azldev keeps the legacy static Release calculation. - Overlay did not apply as expected —
azldev comp diff-sources -p <name>shows what the overlays actually change. - Inspect the build environment —
azldev comp build -p <name> --preserve-buildenv on-failure(valueson-failure,always,never), then enter a mock shell. - Failing
%check— fix the tests first (root cause, upstream patches, targeted fixes). Only as a last resort, disable withbuild.check.skip = trueand a requiredbuild.check.skip_reasonexplaining what fails, why it cannot be fixed, and whether it is temporary. A transient--no-checkbuild 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.
常见问题
构建好的 RPM 应该安装在我的电脑上吗?
不应该。技能说明,应在模拟构建根环境中测试软件包,因为它们是针对发行版的,而不是针对你的电脑。
构建也会测试软件包吗?
不会。技能说明,构建和测试是两个独立的步骤。
可以跳过失败的测试检查吗?
技能提到可以通过设置为某个组件关闭失败的检查,但应谨慎使用。
详情
作者的原始描述
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
热度
- GitHub 星标
- 5.4k
- 排名
- #14961
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
azldev-add-component
5.4k帮你的智能体把新的软件组件添加到 azldev Linux 发行版构建中,从检查上游规格文件(spec)到验证结果。
azldev-comp-toml
5.4k帮你的智能体编写、编辑和审查 azldev 用来描述每个软件包如何构建的组件定义文件。
azldev-image
5.4k帮你的智能体使用 azldev 镜像命令构建、启动和测试 Linux 镜像,例如容器镜像或虚拟机镜像。
azldev-mock
5.4k帮你的智能体在模拟构建环境中测试和检查已构建的软件包,使它们不会触及你自己的电脑。