Skip to content

chore(comps): annotate azl-pruning overlays with metadata#17886

Open
liunan-ms wants to merge 3 commits into
4.0from
liunan/azl-pruning
Open

chore(comps): annotate azl-pruning overlays with metadata#17886
liunan-ms wants to merge 3 commits into
4.0from
liunan/azl-pruning

Conversation

@liunan-ms

@liunan-ms liunan-ms commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary
This PR migrates all azl-pruning components to the per-file overlay layout (overlays/*.overlay.toml) with file-level [metadata]. This is a pure annotation/restructuring change — no overlay is added, removed, reordered, or semantically altered. The rendered spec is byte-identical before and after.

  • 86 components migrated
  • 115 overlay files added
  • structural no-op verified against 4.0 for every component.

Changes
Three commits, deliberately kept separate so the two scaffolding pieces can be dropped independently after #17727 is merged:

  • chore(comps): annotate azl-pruning overlays with metadata
    Each migrated component's overlays move into overlays/*.overlay.toml files carrying file-level category (+ upstreamable/commits where known). Original comp.toml comments are preserved into the overlay files. Because a migrated component's overlays aren't all one category, sibling overlays move with it and keep their own metadata — so besides azl-pruning the commit also touches: azl-release-management, azl-disable-unsupported-tests, azl-compatibility, azl-dep-missing-workaround, azl-security-compliance, azl-platform-adaptation, azl-branding-policy (notably systemd, which spans several).
    qemu's 46 overlays are consolidated into a single overlay file using TOML 1.1.0 multi-line inline tables to preserve their exact interleaved apply order and section comments.

  • chore(distro): set overlay-files default-component-config - ⚠️ PR-CHECK ONLY, REVERT BEFORE MERGE
    Temporary. Sets overlay-files = ["overlays/*.overlay.toml"] in the 4.0 stage1/stage2 default-component-config, so every component inherits per-file overlay discovery (no per-component key needed). Standalone so it can be reverted independently.

  • chore(azldev): pin to 35d8fae and regenerate schema - ⚠️ PR-CHECK ONLY, REVERT BEFORE MERGE
    Temporary. Pins .azldev-version to 35d8fae (merged form of azure-linux-dev-tools#256: inheritable overlay-files + empty-list override) and regenerates external/schemas/azldev.schema.json so PR checks run against a tool that understands the new overlay-files / metadata / BugRef fields. Must be reverted before this PR merges.

Validation

  • Structural no-op: reconstructed overlay list (minus metadata, normalized ../ source paths) is identical to git show 4.0:<comp>.comp.toml for all migrated components; qemu verified value-identical via go-toml deep-compare.
  • azldev component list -a parses cleanly (7424 components).
  • comp render in PR check passed
  • metadata is fingerprint-excluded

liunan-ms and others added 3 commits July 1, 2026 21:32
Migrate all azl-pruning components to the per-file overlay layout with
file-level metadata (category = "azl-pruning"). A handful of migrated
components carry sibling overlays in other categories, which move with
them and keep their own metadata: azl-release-management,
azl-disable-unsupported-tests, azl-compatibility,
azl-dep-missing-workaround, azl-security-compliance,
azl-platform-adaptation, and azl-branding-policy (notably systemd, which
spans several).

46 qemu overlays are consolidated into a single overlay
file using TOML 1.1.0 multi-line inline tables to preserve their exact
interleaved apply order and section comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable per-file overlay discovery for every component by setting
overlay-files = ["overlays/*.overlay.toml"] in the 4.0 stage1/stage2
default-component-config. This is what makes the migrated components'
overlays/*.overlay.toml files load. Kept as a standalone latest commit so
it can be reverted independently of the annotation migration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… BEFORE MERGE]

TEMPORARY: this commit exists solely so the PR checks run against an azldev
build that understands the new overlay-files / metadata / BugRef config. It
MUST be reverted before the PR is merged.

Pin azldev to 35d8fae562980db7bda057d79322cc51ddad8d62, the merged form of the
overlay-files-after-resolution change (microsoft/azure-linux-dev-tools#256).
This version supports inheriting overlay-files from a project-wide
[default-component-config] and allows an empty overlay-files list to disable
inherited patterns. Regenerate external/schemas/azldev.schema.json against the
pinned tool so the authoritative schema knows the new metadata / overlay-files /
BugRef fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the overlays of ~86 azl-pruning (and adjacent-category) components from inline [[components.<name>.overlays]] blocks in each *.comp.toml into per-file overlays/*.overlay.toml documents, each carrying a single file-level [metadata] block (category, and upstreamable where known). It builds on the sibling PR #17727 (backport-overlay annotation) and relies on the inheritable overlay-files feature. Per the description, this is a pure annotation/restructuring change with byte-identical rendered specs, and two of the three commits are temporary scaffolding to make PR checks pass in isolation.

Changes:

  • Move each migrated component's inline overlays into numbered overlays/*.overlay.toml files with file-level [metadata] (category + upstreamable), preserving overlay order, descriptions, comments, and regex/replacement escaping (single-quote TOML literals re-expressed as double-quote basic strings).
  • [Temporary — "REVERT BEFORE MERGE"] Add overlay-files = ["overlays/*.overlay.toml"] to the 4.0-stage1/4.0-stage2 default-component-config in distro/azurelinux.distro.toml.
  • [Temporary — "REVERT BEFORE MERGE"] Bump .azldev-version to 35d8fae so PR checks run against a tool that understands the new overlay-files/metadata fields.

Spot checks confirmed the mechanical correctness of the sampled diffs: escaping conversions preserve regex semantics (e.g. wxGTK, libsndfile, plymouth), multi-file splits are numbered in original overlay sequence so apply-order is preserved (e.g. systemd 0001–0005, webkitgtk 0001–0003), and patch source paths are correctly rewritten to ../ (e.g. anaconda/overlays/0002, resolving to the existing component-root patch). No functional defects were found in the reviewed files. The main considerations are the enormous scope (115+ new files across 86 components), the correctness dependence on the byte-identical render verification that cannot be reproduced here, the ordering-invariant that must hold for every multi-file split, and the two commits that must be manually reverted before merge (and the dependency on #17727 landing first).

Reviewed changes

Copilot reviewed 205 out of 205 changed files in this pull request and generated no comments.

File Description
distro/azurelinux.distro.toml Adds inheritable overlay-files default to both 4.0 stages (temporary scaffolding to revert)
.azldev-version Pins azldev to 35d8fae for new overlay/metadata support (temporary scaffolding to revert)
base/comps/*/*.comp.toml (~86) Removes inline overlays now relocated to per-file overlay documents
base/comps/*/overlays/*.overlay.toml (115+) New per-file overlays with file-level [metadata], preserving original operations, order, and comments

@liunan-ms liunan-ms marked this pull request as ready for review July 2, 2026 03:03
@liunan-ms liunan-ms requested a review from a team as a code owner July 2, 2026 03:03

@tobiasb-ms tobiasb-ms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spot-checked some things and the fact that the spec renderer ran and didn't complain -- despite no changes to specs/ -- indicates this is a functional no-op. Approved.

@reubeno reubeno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main high level feedback here is that there's a fair bit of pruning where the overlays should be upstreamed as new bconds/fixes to existing bit-rotted bconds, even if the choice to disable the features remains in Azure Linux.


[metadata]
category = "azl-pruning"
upstreamable = false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does seem upstreamable.


[metadata]
category = "azl-pruning"
upstreamable = false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we express that the upstreamable thing here is to turn the %global into a %bcond that would allow us to configure without the need for an overlay?

Ditto for other similar instances.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current expression with category = "azl-pruning" + upstreamable = true cannot allow us to filter out this group of overlays that can be removed by turning the %global into a %bcond. There're roughly 24~ overlay definitions hard-code a %global flip. Do you think this group deserve a separate category?

[[overlays]]
description = "Remove elfutils-default-yama-scope package"
type = "spec-search-replace"
regex = "%global provide_yama_scope\\s+1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above question regarding %global; I'll refrain from additional instances, but the general question holds.

description = "Drop BuildRequires: pkgconfig(fdk-aac) (fdk-aac-free not available in AZL)"
type = "spec-remove-tag"
tag = "BuildRequires"
value = "pkgconfig(fdk-aac)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a %global but also something that we'd want to upstream as a new bcond. Ditto for various other instances in this PR.

category = "azl-pruning"

[[overlays]]
description = "Remove RDP-only enable-service from %files"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this upstreamable? It looks like we build the component without rdp, and if that config is supported upstream then these fixes are needed.

# cliff.sphinxext uses argparse.HelpFormatter._format_actions_usage, a private API
# removed in Python 3.14. This crashes sphinx-build during %build when generating docs.
# Disable doc generation while we figure out what to do about this.
# Fixed in cliff: https://opendev.org/openstack/cliff/commit/391261c849c994ca2d3f42926497e633047ed8c7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit?

@@ -0,0 +1,339 @@
# Disable features not needed in Azure Linux's Hyper-V/KVM environment, and strip

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a big one. Can we break it into multiple .toml files?

# Retarget to the openjdk25 variant.

[metadata]
category = "azl-pruning"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstreamable? Another jdk 25.

@@ -0,0 +1,15 @@
[metadata]
category = "azl-branding-policy"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a branding thing.

# it explicitly when oscilloscope is disabled.

[metadata]
category = "azl-pruning"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does seem upstreamable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants