azldev-comp-toml
它能做什么
这项技能说明 azldev 组件文件的格式,这些文件用于设定软件包的规格来源以及如何定制。它适用于在 azldev 发行版中维护软件包定义的开发者。
适用场景
- ✓当你需要创建或编辑组件定义文件时。
- ✓当你审查组件文件,查找错误或多余设置时。
- ✓当你想修改软件包的构建设置或发布版本计算方式时。
技能链接
https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-comp-toml/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我审查 jq 组件文件,并告诉我哪些设置与默认值相同,可以删除。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会读取组件文件的结构和结构定义,然后检查规格来源、构建设置和覆盖层。它会提出符合该工具格式的修改建议。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Component definition files (*.comp.toml)
A component definition tells azldev where a package's spec comes from and how to
customize it for your distro. Every component lives under [components.<name>].
Get the authoritative, always-current field list from the schema:
azldev config generate-schema
Structure
A bare entry inherits everything from your distro's defaults — most upstream packages need nothing more:
[components.curl]
Add sub-tables only for what you change. The fields you will reach for most:
| Field | Purpose |
|---|---|
spec |
where the spec comes from (see below) |
overlays / overlay-files |
targeted spec/source edits (see the azldev-overlays skill) |
build.defines / build.with / build.without |
RPM macro and bcond build tweaks |
release.calculation |
how the Release tag is managed |
render.skip-file-filter |
rendering edge-case escape hatch |
Spec source
The spec field selects where the spec is fetched from. When omitted, the component
inherits the distro default (normally an upstream import).
# Upstream import (the usual case) — inherits the distro's upstream version
[components.curl]
# Upstream, but pinned to a specific upstream distro/version
[components.curl]
spec = { type = "upstream", upstream-distro = { name = "fedora", version = "rawhide" } }
# Upstream package whose name differs from the component name
[components.mydistro-rpm-config]
spec = { type = "upstream", upstream-name = "redhat-rpm-config" }
# Local spec that lives in your repo (not imported from an upstream distro)
[components.mydistro-release]
spec = { type = "local", path = "mydistro-release.spec" }
Build configuration
[components.mypackage.build]
defines = { rhel = "11" } # override RPM macros
with = ["feature_x"] # enable %bcond_with conditionals
without = ["plugin_rhsm"] # disable %bcond_with conditionals
Release calculation
release.calculation controls the Release: tag. There are four modes:
auto(default) — leave%autoreleaseunchanged; otherwise bump a static integer Release once for each fingerprint-derived synthetic change.autorelease— force%autoreleasehandling (use when auto-detection misreads a spec that wraps%autoreleasein a conditional).static— require a non-%autoreleasestatic release. The default legacy calculation supports only an integer,integer%{?dist}, orinteger%{dist}; other forms requiremanualor an overlay.manual— you own theRelease:value. Use this only when render fails with a "non-standard Release tag" error. Amanualcomponent is not bumped by the render/commit/amend cycle, so increment its release yourself in the same change (see theazldev-update-componentskill).
[components.mypackage.release]
calculation = "manual"
The temporary --rpmdev-bumpspec flag on comp build, comp render, and
comp prepare-sources opts into transactional host handling while Azure Linux
migrates. Only that path requires rpmdev-bumpspec, rpmdev-packager, rpm,
rpmspec, and Python with its RPM module. It preserves the fixed team
identity/comment/datestamp and strict source-EVR transaction checks; locks and
synthetic history still determine the number and order of bumps. Without the
flag, no bumpspec runtime discovery occurs and the legacy static calculation is
used. %autorelease behavior is unchanged on either path.
Render configuration
render.skip-file-filter = true keeps all source and patch files during render.
azldev normally prunes files not referenced by the rendered spec; set this only for
the rare spec whose Source/Patch filenames use macros the filter cannot expand.
File organization
- Inline — put simple, customization-free components directly in a shared config
file (e.g.
[components.jq]). - Dedicated — give a component its own
<name>/<name>.comp.tomlonce it needs overlays, build config, or a local spec. Rule of thumb: anything more than[components.<name>]earns a dedicated file. - A parent config picks up dedicated files through an
includesglob, for exampleincludes = ["**/*.comp.toml"].
Review checklist
Start with azldev comp list -p <name> -q -O json, then use
azldev comp query -p <name> -q -O json when the review needs parsed spec details.
For a change review, focus on the diff while checking enough surrounding context to
ensure
常见问题
组件文件可以非常短吗?
可以。技能说明,只写一个基本条目就会继承默认值,因此大多数上游软件包几乎不需要更多设置。
精确的字段列表在哪里?
技能说明,应使用该工具的配置命令生成结构定义,而不是凭记忆。
什么是覆盖层?
它是在构建时应用于软件包规格文件的补丁,而不需要复制整个规格文件。
详情
作者的原始描述
Read this before authoring, editing, or reviewing a *.comp.toml file; do not work from memory. Explains the azldev component definition format and review workflow, covering component structure, spec sources, build config, release calculation, render options, file organization, overlay hygiene, stale files, disabled tests, and testing verification. Triggers include comp.toml, component config, review component, component hygiene, spec source, upstream-distro, build defines, release calculation, includes.
repo: microsoft/azurelinux
热度
- GitHub 星标
- 5.4k
- 排名
- #14962
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
azldev-add-component
5.4k帮你的智能体把新的软件组件添加到 azldev Linux 发行版构建中,从检查上游规格文件(spec)到验证结果。
azldev-build-component
5.4k帮你的智能体构建和调试 azldev 软件包,包括渲染、构建和测试循环,以及修复失败的构建检查。
azldev-image
5.4k帮你的智能体使用 azldev 镜像命令构建、启动和测试 Linux 镜像,例如容器镜像或虚拟机镜像。
azldev-mock
5.4k帮你的智能体在模拟构建环境中测试和检查已构建的软件包,使它们不会触及你自己的电脑。