azldev-update-component
它能做什么
这项技能说明何时以及如何更新 azldev 中的组件锁文件。它适用于完成软件包变更,或在 azldev 发行版中添加新软件包的开发者。
适用场景
- ✓当你添加新组件,需要在构建前创建其锁文件时。
- ✓当你完成软件包变更,需要为拉取请求刷新锁文件时。
- ✓当你修改软件包所使用的上游提交或版本时。
技能链接
https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-update-component/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我已经完成了 curl 软件包的覆盖层修改。请帮我刷新它的锁文件,并重新渲染规格文件。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会为该组件运行更新命令,提交锁文件,然后按照工作流程的说明重新渲染并修补。日常工作使用单组件刷新。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Update component lock files
azldev comp update (comp is an alias for component) refreshes one or more
component lock files under locks/. A lock pins the resolved upstream commit plus
an input fingerprint computed from the component's render inputs — its TOML config,
overlays, the pinned upstream commit, and the distro release version. If any of
those change, the lock is stale.
When to run update
| Situation | Run update? |
|---|---|
| Adding a new upstream component (no lock yet) | Yes — first, to create the lock before render/build can resolve it |
| Finalizing a component change for a PR | Yes — once at the end |
| Changing source resolution (commit pin, upstream distro/version, or snapshot) | Yes — also mid-workflow (see below) |
| Iterating on overlays / build config / metadata | No — once the lock exists, render alone is enough while iterating |
| Just reading or building existing components | No |
Refresh a single component with -p <name>. Use -a (all components) only for
coordinated mass refreshes (e.g. a new distro snapshot) or when investigating
lock drift across many components — it is slow. For day-to-day work use -p. Add
-O json for machine-readable lock output when debugging.
End-of-work refresh (the common case)
For most edits — overlays, build flags, metadata — run update once at the end,
then re-render after committing so the generated changelog and release reflect
your new commit:
azldev comp update -p <name>
azldev comp render -p <name>
git add <changed-component-config-and-source-paths> \
locks/<name>.lock \
specs/<first-char>/<name>/
git commit -m "fix(<name>): ..."
# Re-render and amend so the changelog / Release: track the new commit.
azldev comp render -p <name>
git add specs/<first-char>/<name>/
git commit --amend --no-edit
Why the second render-and-amend?
Changelog generation and release calculation are separate. When a spec uses
%autochangelog, rpmautospec derives it from the component's git history for
every release mode. For non-manual release modes, azldev also derives or bumps
Release: from that history. The first render happens before your commit exists,
so a fresh render after committing incorporates the new changelog entry and any
automatic release bump. Amending folds that output into a single clean commit and
keeps rendered-spec / lock CI gates (which run against committed state) green.
For a component with release.calculation = "manual", increment the release
counter yourself in the same change. Manual mode is not an exemption from the
post-commit render-stage-amend cycle: when the spec uses %autochangelog, that
render incorporates the new commit.
Changing source resolution
A source-resolution change follows the same rule, using one commit followed by a post-render amend:
Change the commit pin, upstream distro/version, or snapshot, then
azldev comp update -p <name>; sanity-checklocks/<name>.lock.azldev comp render -p <name>— the spec body now tracks the newly resolved source.%changelog/Release:still reflect the previous source; that is expected until you commit.Iterate on overlays / patches / build config as the new source requires, re-rendering after each change. Re-run
updateonly if you change a source-resolution input again.azldev comp update -p <name>, then stage and commit all component inputs changed above with the refreshed lock and rendered output:git add <changed-component-config-and-source-paths> \ locks/<name>.lock \ specs/<first-char>/<name>/ git commit -m "update(<name>): ..."azldev comp render -p <name>—%changelog/Release:now reflect the new lock.git add specs/<first-char>/<name>/, thengit commit --amend --no-editso the source change and rendered output land together.
Generated by azldev docs agent; do not hand-edit.
常见问题
什么是锁文件?
它固定上游提交和输入内容的指纹,使构建保持可重复。
什么时候不需要更新锁文件?
技能说明,在迭代覆盖层或构建参数时,锁文件存在后仅渲染即可。
应该刷新所有组件吗?
通常不需要。技能说明,全量刷新很慢,适用于协调进行的大规模更新。
详情
作者的原始描述
Read this before finalizing a component change, changing source resolution, or touching a lock file; lock edits are easy to get wrong. Explains how to refresh azldev component lock files with 'azldev comp update', covering when to run update versus render, the update/render/commit/re-render/amend workflow, and per-component versus -a refresh. Triggers include comp update, refresh lock, bump pin, change snapshot, upstream distro, lock drift, version bump, finalize component.
repo: microsoft/azurelinux
热度
- GitHub 星标
- 5.4k
- 排名
- #14968
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
azldev-add-component
5.4k帮你的智能体把新的软件组件添加到 azldev Linux 发行版构建中,从检查上游规格文件(spec)到验证结果。
azldev-build-component
5.4k帮你的智能体构建和调试 azldev 软件包,包括渲染、构建和测试循环,以及修复失败的构建检查。
azldev-comp-toml
5.4k帮你的智能体编写、编辑和审查 azldev 用来描述每个软件包如何构建的组件定义文件。
azldev-image
5.4k帮你的智能体使用 azldev 镜像命令构建、启动和测试 Linux 镜像,例如容器镜像或虚拟机镜像。