Skip to content

fix: kata-containers - remove flagged files - #18706

Draft
Andrew Phelps (anphel31) wants to merge 2 commits into
4.0from
anphel/fix-kata-containers-flagged-files
Draft

fix: kata-containers - remove flagged files#18706
Andrew Phelps (anphel31) wants to merge 2 commits into
4.0from
anphel/fix-kata-containers-flagged-files

Conversation

@anphel31

@anphel31 Andrew Phelps (anphel31) commented Sep 3, 2026

Copy link
Copy Markdown
Member

Removes the Windows-only static import libraries (and their now-dangling checksum references) from the kata-containers vendored-dependencies archive. The real problem these cause is ESRP source scanning (mpgear) recursively decompressing a ~1.6M-member ar-archive explosion in the SRPM; the crates are all target-gated to Windows and never compiled on Linux.

What is removed

File removal — three file-remove overlays on the vendor archive (lib/ only):

  • **/winapi-*-pc-windows-*/lib/** — legacy winapi import libraries.
  • **/windows_*_gnu*/lib/** — the windows_*_{gnu,gnullvm} crates (the big one: each libwindows.*.a holds ~21,689 members, vendored per arch/toolchain).
  • **/windows_*_msvc*/lib/** — the windows_*_msvc .lib import archives.

Checksum cleanup — three file-search-replace overlays strip the now-dangling lib/... entries from each affected crate's .cargo-checksum.json (regex '"lib/[^"]*":"[a-f0-9]{64}",', replacement omitted so the match is deleted).

All these crates are target-gated ([target.*-pc-windows-*] / cfg(target_env = ...)), so a Linux build never compiles them (the vendor archive is fully unpacked in %prep, but cargo only verifies manifests for crates it actually builds). Only the lib/ archives (and their checksum entries) are dropped — each crate's Cargo.toml/src/skeleton is kept, so cargo's resolve stays intact.

The repacked archive is pinned via origin = { type = "overlay" }; the post-overlay SHA512 (2a9018a4...a447e4c) is filled into the source-files entry, the rendered sources, and the lock. The release is bumped to 3.26.0-2 via the azl_release counter (a build.defines macro folded into upstream's Release by one spec-set-tag overlay), matching the repo idiom for manual-release components (rubygem-rake, java-25-openjdk). No manual changelog entry is added — kata's spec isn't %autochangelog.

Impact

  • ar-member count: ~1.6M -> 71 (verified by extracting every remaining .a/.lib from the repacked tarball and summing ar t; the 71 are rustix Linux syscall archives that must stay).
  • Dangling checksum entries removed: 16,947 across 141 manifests (0 residual lib/ refs, 0 invalid JSON afterward).
  • Total files in the repacked tarball: 149,435, max nesting depth 2, no remaining decompression bomb.
  • SRPM: ~598 MB -> 457 MB.

Validation

The three AGENTS.md checks for output-affecting changes:

  • Build -- azldev comp build -p kata-containers succeeds -> kata-containers-3.26.0-2.azl4.x86_64.rpm. The Rust build resolves against the repacked vendor dir with the pruned manifests, confirming cargo tolerates both the removed files and the trimmed checksums on Linux.
  • Inspect -- rpm -qlp shows the expected payload (/usr/bin/kata-runtime, kata-ctl, kata-monitor, containerd-shim-kata-v2, .../kata-agent, ...).
  • Smoke-test -- installed into a mock chroot; kata-runtime --version -> 3.26.0, kata-monitor --version -> 0.3.0, kata-ctl loads (all rc=0).

render --check-only and update --check-only both pass with no drift.

Copilot AI balanced review requested due to automatic review settings September 3, 2026 22:21

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.

🟡 Changes recommended

The archive digest remains a placeholder, generated metadata is stale, and the changelog weekday is incorrect.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds an archive overlay to remove Windows-only import libraries from kata-containers’ vendored dependencies.

Changes:

  • Removes flagged Windows-only static libraries during rendering.
  • Pins the repacked vendor archive.
  • Bumps the package release and changelog.
File summaries
File Description
base/comps/kata-containers/kata-containers.comp.toml Adds the removal overlay and archive hash pin.
specs/k/kata-containers/kata-containers.spec Updates the rendered release and changelog.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

# file and the lock).
[[components.kata-containers.source-files]]
filename = "kata-containers-3.26.0-vendor.tar.gz"
hash = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed. The vendor tarball was repacked with azldev comp prepare-sources -p kata-containers --allow-no-hashes and the real post-overlay digest is now pinned:

aa029a4bc258ef4d13b0c219230112e20a95957cf302c02307919a28b85165c79586b525274232b00b15dc161c7e21093d1c33b45d5d3856dfe1123ad112f62d

specs/k/kata-containers/sources and locks/kata-containers.lock were regenerated (azldev comp render + azldev comp update), and both render --check-only and update --check-only now pass with no drift. The SRPM/RPM build succeeds against this digest, confirming it matches the repacked archive.

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.

It looks to me like this is still all zeroes.

Comment thread base/comps/kata-containers/kata-containers.comp.toml Outdated
Comment thread specs/k/kata-containers/kata-containers.spec Outdated
Copilot AI review requested due to automatic review settings September 3, 2026 23:01
@anphel31
Andrew Phelps (anphel31) force-pushed the anphel/fix-kata-containers-flagged-files branch from e5a3865 to 1df0131 Compare September 3, 2026 23:01
@anphel31
Andrew Phelps (anphel31) marked this pull request as ready for review September 3, 2026 23:02
@anphel31
Andrew Phelps (anphel31) requested a review from a team as a code owner September 3, 2026 23:02

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.

🟡 Changes recommended

The digest and lock are described as placeholders, and mandatory build, inspection, and smoke-test validation remains outstanding.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

base/comps/kata-containers/kata-containers.comp.toml:48

  • The PR description identifies this SHA-512 (and the derived sources/lock state) as a placeholder pending rendering. origin = { type = "overlay" } uses this value to pin the repacked archive, so it must be replaced with the actual post-overlay digest and the dependent sources and lock files regenerated before merge.
hash = "aa029a4bc258ef4d13b0c219230112e20a95957cf302c02307919a28b85165c79586b525274232b00b15dc161c7e21093d1c33b45d5d3856dfe1123ad112f62d"
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread base/comps/kata-containers/kata-containers.comp.toml Outdated

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.

🟡 Changes recommended

The file-removal overlay uses an incorrect metadata category.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread base/comps/kata-containers/kata-containers.comp.toml Outdated
Copilot AI review requested due to automatic review settings September 3, 2026 23:34
@anphel31
Andrew Phelps (anphel31) force-pushed the anphel/fix-kata-containers-flagged-files branch from 1df0131 to 5cdd572 Compare September 3, 2026 23:34

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.

🟢 Approval recommended

The targeted pruning is consistently rendered, locked, and supported by completed build and smoke-test validation.

Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@anphel31

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

Remove the Windows-only static import libraries from the vendored-dependencies
archive via file-remove overlays: the winapi-*-pc-windows-* crates and the
windows_*_{gnu,gnullvm,msvc} (windows-targets) family. These crates are
target-gated to Windows and never built on Linux, but their lib/ import
archives (.a/.lib) ship ~1.6M ar members in aggregate (vendored several times
per arch/toolchain) and are flagged during source package signing. Only the
lib/ archives are dropped; each crate's Cargo.toml/src/checksum skeleton is
kept so cargo's resolve stays intact. The repacked archive is pinned via the
source-files SHA512, and the release is bumped for the changed source.
Copilot AI review requested due to automatic review settings September 4, 2026 02:16
@anphel31
Andrew Phelps (anphel31) force-pushed the anphel/fix-kata-containers-flagged-files branch from 5cdd572 to 2b64357 Compare September 4, 2026 02:16

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.

🟢 Approval recommended

The overlays are narrowly scoped, generated state is consistent, and the required build and smoke-test validation is documented.

Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

🟢 Approval recommended

The overlays, generated files, lock state, and documented build validation are consistent.

Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@anphel31

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

Copilot AI review requested due to automatic review settings September 4, 2026 08:57

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.

🟡 Changes recommended

The component configuration still contains an all-zero source hash inconsistent with the generated sources and claimed validation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

# it with the reported SHA512 (this also updates the `sources` file and the lock).
[[components.kata-containers.source-files]]
filename = "kata-containers-3.26.0-vendor.tar.gz"
hash = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

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.

blocking -- this is critical.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Resolved. The placeholder is replaced with the real post-overlay SHA512 2a9018a423a83ca80741b203b6b96a6895bae8734751f293e3ce7de772664cd69c87ae2fb8d556e77f31ae52051ce518d7075315858a05b5638290f7ea447e4c (digest of the repacked archive after all six overlays), and specs/k/kata-containers/sources + locks/kata-containers.lock were regenerated via render + update. render/update --check-only pass, and the mock build reproduces from this digest.

category = "azl-pruning"
upstream-status = "inapplicable"

# Bump the release for the repacked (flagged-files-removed) archive. This is a

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.

nit(non-blocking): This comment doesn't seem necessary, and in the fullness of time will be incorrect. We don't need to explain why we're bumping the release.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed — the "why we bump" comment is gone; the release overlay is now the standard azl_release fold, which is self-explanatory.

[[components.kata-containers.overlays]]
description = "Bump release for flagged-file removal"
type = "spec-update-tag"
tag = "Release"

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.

issue(blocking): Why are you doing this via a manual Release change? Is there a compelling reason not to use azl_release = 2 instead? Is it because of rcrel or something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call — switched to the azl_release idiom (matching rubygem-rake / java-25-openjdk). Added azl_release = "1" under [build.defines] and a single spec-set-tag overlay that folds it into upstream's Release:

Release: %[1 + %{azl_release}]%{?rcrel}%{?dist}

rcrel wasn't the reason — it composes cleanly. Rebuilt in mock: the RPM is kata-containers-3.26.0-2.azl4.x86_64 (so %[1 + %{azl_release}] evaluates to 2 as expected), and the generated kata-containers.azl.macros sidecar is committed.

# Bump the release for the repacked (flagged-files-removed) archive. This is a
# manual-release component, so the release is owned here via overlays rather than
# by autorelease.
[[components.kata-containers.overlays]]

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.

nit(non-blocking): However you end up bumping the release (see https://github.com/microsoft/azurelinux/pull/18706/changes#r3935292816), I'd prefer that overlay to live near the declaration that this is a manual release component (in this case, that's at the top of the file).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done — the azl_release define and the release spec-set-tag overlay now live at the top of the file, immediately under release = { calculation = "manual" }.

[[components.kata-containers.overlays]]
description = "Add changelog entry for flagged-file removal"
type = "spec-prepend-lines"
section = "%changelog"

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.

issue(blocking): Won't azldev component render handle the changelog for you?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

kata's spec doesn't use %autochangelog, so render does not synthesize a changelog entry — I verified it leaves the changelog as upstream's 3.26.0-1. Following the rubygem-rake convention (manual release calc + azl_release, non-autochangelog), I dropped the manual changelog overlay entirely; the azl_release bump plus the commit history is the record. Happy to add a manual entry instead if you'd prefer one here.

# file and the lock).
[[components.kata-containers.source-files]]
filename = "kata-containers-3.26.0-vendor.tar.gz"
hash = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

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.

It looks to me like this is still all zeroes.

# it with the reported SHA512 (this also updates the `sources` file and the lock).
[[components.kata-containers.source-files]]
filename = "kata-containers-3.26.0-vendor.tar.gz"
hash = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

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.

blocking -- this is critical.

@anphel31
Andrew Phelps (anphel31) marked this pull request as draft September 4, 2026 18:20
Copilot AI review requested due to automatic review settings September 4, 2026 18:36
@anphel31
Andrew Phelps (anphel31) force-pushed the anphel/fix-kata-containers-flagged-files branch from 906ffcd to 48948c8 Compare September 4, 2026 18: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.

🟢 Approval recommended

The implementation and generated state are consistent, with only a non-blocking documentation correction identified.

Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +44 to +46
# These crates are target-gated to Windows and are not unpacked on a Linux build today,
# but leaving ~17k dangling entries would break as soon as cargo's download filtering
# changes or one of them stops being target-gated. In every affected manifest the lib/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed the wording. The comment now says these crates are never compiled on a Linux build — explicitly noting the vendor archive is fully unpacked in %prep, but cargo only verifies manifests for crates it actually builds — rather than implying selective extraction.

Copilot AI review requested due to automatic review settings September 4, 2026 19:18
@anphel31
Andrew Phelps (anphel31) force-pushed the anphel/fix-kata-containers-flagged-files branch from 48948c8 to 3b7681d Compare September 4, 2026 19:18

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.

🟡 Changes recommended

The rendered 3.26.0-2 package lacks the changelog entry claimed in the PR description.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +12 to +14
type = "spec-set-tag"
tag = "Release"
value = "%[1 + %{azl_release}]%{?rcrel}%{?dist}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The PR description was already updated to match the config before this pass — it now states "No manual changelog entry is added — kata's spec isn't %autochangelog", so the description/rendered-spec inconsistency is resolved (this review ran against the earlier description).

On whether to add the entry at all: I'm following the maintainer guidance in this thread (r3935306771 / r3935292816) and the rubygem-rake precedent — a manual-release azl_release bump on a non-%autochangelog spec carries no AZL %changelog entry; the azl_release counter plus commit history record why the rebuild exists. Tobias Brick (@tobiasb-ms), happy to add a 3.26.0-2 changelog entry instead if you'd prefer it here.

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.

🟡 Changes recommended

The related pruning overlays should share one per-file metadata block as required by repository guidance.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +32 to +34
[components.kata-containers.overlays.metadata]
category = "azl-pruning"
upstream-status = "inapplicable"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. Moved the six pruning overlays (3 file-remove + 3 file-search-replace — one logical change) into a single per-file overlay document, overlays/0001-remove-windows-import-libraries.overlay.toml, with one top-level [metadata] block (azl-pruning / inapplicable), auto-loaded via the project-wide overlay-files glob in base/comps/components.toml.

Verified it's a pure reorganization: prepare-sources still applies operations=6, the repacked tarball is byte-identical (same SHA512 2a9018a4…a447e4c), render/update --check-only are clean, and the lock is unchanged (upToDate).

The lone release overlay stays inline — it's a single overlay with a distinct azl-release-management category (no repeated metadata to drift), matching the rubygem-rake / java-25-openjdk layout.

The file-remove overlays drop each Windows-only crate's lib/ import
libraries, but their .cargo-checksum.json manifests still listed those
paths, leaving 16947 dangling entries across 141 crates. Cargo's
directory source verifies every path in the files map and fails with
"failed to verify the checksum of <pkg>" when one is missing; unlisted
files are ignored, so removing the entries is the correct fix.

The crates are target-gated to Windows and are not unpacked on a Linux
build today, so this is latent rather than breaking, but it would
surface if cargo's download filtering changed or a crate stopped being
target-gated.
Copilot AI review requested due to automatic review settings September 4, 2026 20:56
@anphel31
Andrew Phelps (anphel31) force-pushed the anphel/fix-kata-containers-flagged-files branch from 3b7681d to 891bb3f Compare September 4, 2026 20:56

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.

🟢 Approval recommended

The overlays, generated files, lock, release bump, and documented validation are consistent.

Review details
  • Files reviewed: 5/6 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@anphel31

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

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.

3 participants