跳到正文
Skillpedia
部署与云(DevOps)5.4k · #14961

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-build-component/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

  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.

常见问题

构建好的 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能