[Skill] Build and test Azure Linux components using azldev. Use when building packages, debugging build failures, inspecting mock chroots, preparing sources, or working with the build inner loop. Triggers: build component, build failed, mock shell, prepare sources, debug build, build error.
78
100%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Never install built RPMs on the host. They target Azure Linux, not your dev machine. Use
skill-mockfor testing.
A successful build is NOT the finish line. If your change could affect the built RPMs, smoke-test before reporting success. See
skill-mock.
Pure organizational changes (moving definitions between files, editing comments/descriptions) don't need a rebuild. When in doubt, test.
Build output paths are configured in base/project.toml (output-dir, log-dir, work-dir). Default layout:
project.toml key | Default value | Resolves to | Contents |
|---|---|---|---|
output-dir | out | base/out/ | Built RPMs and SRPMs |
log-dir | build/logs | base/build/logs/ | Build logs |
work-dir | build/work | base/build/work/ | Per-component working dirs (<name>/) |
Paths are relative to the project root (base/). Don't edit anything in these dirs — they are generated output.
prep-sourcesoutput is separate.comp prep-sources -o <dir>writes to a user-specified directory, NOT to the project's configured output dirs. Don't look inbase/out/forprep-sourcesresults.
# Build a single component
azldev comp build -p <name>
# Build multiple components, auto-publishing RPMs to local repo for chained deps
azldev comp build --local-repo-with-publish ./base/out -p <dep1> -p <dep2>
# Rebuild a single component against an already-populated local repo
azldev comp build -p <name> --local-repo ./base/outNOTE: -q (silent) can be used with all commands for cleaner logs, but will limit visibility into build progress. Only use -q for inner-loop builds when you know the build will run to completion without infrastructure issues.
Build foundational packages first (e.g., azurelinux-rpm-config), then dependents. See scripts/demo-build.sh for a working example.
The standard cycle for investigating, modifying, and verifying components:
investigate → modify → render → build → test → inspectFinalize with
azldev comp update -p <name>before opening a PR — lock fingerprints are computed from the full component config, so any TOML change can invalidate them. TheUpdate LocksCI check enforces this. After committing your change, re-render and amend so%changelog/Release:track the new commit (rpmautospec walksgit logevery render). Seeskill-update-componentfor the full finalize-and-amend pattern, plus the pin-bump variant.
| Step | Command | What to check |
|---|---|---|
| Investigate | Read specs/<first-char>/<name>/<name>.spec or prep-sources --skip-overlays --force -o base/build/work/scratch/<name>-pre | Upstream spec/sources as-is |
| Compare | prep-sources --force -o base/build/work/scratch/<name>-post + diff -r ...-pre ...-post | Current overlay effect (deep debug) |
| Modify | Edit *.comp.toml (overlays, defines, without) | — |
| Verify | comp render -p <name> + inspect specs/<first-char>/<name>/ | Overlay applies cleanly (fast path) |
| Build | comp build -p <name> | RPMs appear in base/out/ |
| Test | adv mock shell --add-package base/out/<name>*.rpm | Package installs, binary runs, basic functionality works |
| Inspect | comp build --preserve-buildenv always + adv mock shell | BUILDROOT contents, file lists |
Prefer
comp renderfor quick verification. It's faster thanprep-sourcessince it skips downloading source tarballs. Useprep-sourceswhen you need the full source tree or want to diff pre/post overlay output for debugging.
Use a temp dir for
prep-sourcesoutput. Use--forceto overwrite an existing output dir.
Package builds are often very long, so adjust command timeouts accordingly when using shell tools to run builds, or use background mode if available.
If render fails with non-standard Release tag value ... does not start with an integer, or if %autorelease is incorrectly expanded to a hardcoded integer (common with conditional %autorelease specs), see Release Configuration.
The fastest way to verify overlays applied correctly:
azldev comp render -p <name>
# Inspect the result
cat specs/<first-char>/<name>/<name>.specWhen you need to understand exactly what upstream provides vs. what overlays change:
azldev comp prep-sources -p <name> --skip-overlays --force -o base/build/work/scratch/<name>-pre -q
azldev comp prep-sources -p <name> --force -o base/build/work/scratch/<name>-post -q
diff -r base/build/work/scratch/<name>-pre base/build/work/scratch/<name>-postThis reveals whether overlays apply as intended or whether upstream changed.
azldev comp build -p <name> --preserve-buildenv on-failure -q
# Use `always` to inspect even successful buildsFor testing built RPMs or inspecting the chroot, see the skill-mock skill. Quick reference:
# Non-interactive (preferred for agents)
azldev adv mock shell --add-package /path/to/rpm <<'CMDS'
rpm -q <name>
exit
CMDS
# Interactive (requires user cooperation — see skill-mock for agent workflow)
azldev adv mock shell --add-package /path/to/rpm --enable-network⚠️ Don't mix
-p <name>with--add-packagefor the same package.-pis shorthand for--add-package, so-p cowsay --add-package ./cowsay.rpminstalls two conflicting builds. Use one or the other. Seeskill-mockfor details.
Inside the chroot: rpmbuild, find, dnf5 — standard RPM tooling. BUILDROOT is at builddir/build/BUILD/<pkg>-<ver>-build/BUILDROOT/.
Use build.defines (macros) and build.without (disable conditionals) in the component's .comp.toml. See comp-toml.instructions.md for syntax and examples.
Verify with prep-sources before doing a full build.
%check (test suites)Disabling %check (via build.without = ["check"]) is an absolute last resort. Always attempt to fix failing tests first — investigate the root cause, check upstream for patches or known issues, and try targeted fixes. If disabling is truly unavoidable, the component's skip_reason field MUST clearly explain:
azldev comp build --help, azldev advanced mock --helpazldev advanced (alias adv) is hidden from azldev --help but contains mock shell, mock build-rpms, mcp, and wget.azldev config generate-schema > base/build/work/scratch/schema.json for latest changes)9e308ff
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.