Repository navigation
fix cache failures caused due to outdated buildah. - #1350
Draft
Venkumahanti Subhankar (V-Subhankar-infy) wants to merge 1 commit into
Draft
Venkumahanti Subhankar (V-Subhankar-infy) wants to merge 1 commit into
Venkumahanti Subhankar (V-Subhankar-infy) wants to merge 1 commit into
Conversation
Venkumahanti Subhankar (V-Subhankar-infy)
requested a max review from Copilot
November 4, 2026 11:53
Copilot started reviewing on behalf of
Venkumahanti Subhankar (V-Subhankar-infy)
November 4, 2026 11:53
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The COPY fallback can break Podman no-cache builds by pulling a local-only image, while its shared mutable image tag can cause concurrent builds to run the wrong Feature content.
3 open issues
What changed in this PR
Adds an automatic compatibility fallback for Podman Feature caching (#1262), using the existing COPY transport when bundled Buildah cannot reliably cache named-context mounts.
Changes:
- Detect bundled Buildah and select COPY below 1.41.1 or when version detection is uncertain.
- Carry the Feature-only policy through resolver setup without disabling BuildKit globally or changing Docker behavior.
- Add version-policy and transport-generation tests, plus user-facing caching guidance.
| File | Description |
|---|---|
src/test/dockerUtils.test.ts |
Tests Buildah version policy, probe failures, and command plumbing. |
src/test/container-features/generateFeaturesConfig.test.ts |
Tests consistent COPY, mount, and non-BuildKit Feature generation. |
src/spec-shutdown/dockerUtils.ts |
Adds Buildah detection, fallback selection, and diagnostics. |
src/spec-node/utils.ts |
Adds the typed Feature transport policy field. |
src/spec-node/devContainers.ts |
Resolves the policy and skips probing for explicit non-BuildKit builds. |
src/spec-node/containerFeatures.ts |
Applies the policy to Feature transport selection. |
README.md |
Adds Podman caching guidance for affected CLI users. |
CHANGELOG.md |
Records the compatibility fix under Unreleased. |
Review effort: Max
| const minRequiredVersion = [0, 8, 0]; | ||
| const useBuildKitBuildContexts = buildKitVersionParsed ? !isEarlierVersion(buildKitVersionParsed, minRequiredVersion) : false; | ||
| // Keep BuildKit enabled globally while using COPY for Features on affected Podman builders. | ||
| const useBuildKitBuildContexts = !params.useFeatureCopyFallback && (buildKitVersionParsed ? !isEarlierVersion(buildKitVersionParsed, minRequiredVersion) : false); |
| const minRequiredVersion = [0, 8, 0]; | ||
| const useBuildKitBuildContexts = buildKitVersionParsed ? !isEarlierVersion(buildKitVersionParsed, minRequiredVersion) : false; | ||
| // Keep BuildKit enabled globally while using COPY for Features on affected Podman builders. | ||
| const useBuildKitBuildContexts = !params.useFeatureCopyFallback && (buildKitVersionParsed ? !isEarlierVersion(buildKitVersionParsed, minRequiredVersion) : false); |
| reason = `Buildah version detection returned an unrecognized or prerelease version: ${JSON.stringify(versionString)}`; | ||
| } | ||
| } catch (err) { | ||
| reason = `Buildah version detection failed: ${err instanceof Error ? err.message : String(err)}`; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fix Podman Feature cache misses with older Buildah
Fixes #1262
Problem and Root Cause
Podman builds using bundled Buildah older than 1.41.1 can reinstall unchanged Features instead of reusing their installation layers, repeating work and downloads. This CLI fallback also covers prerelease, unrecognized, or unavailable Buildah versions. The investigation reproduced misses with Podman 4.9.3 / Buildah 1.33.7 and Podman 5.4.0 / Buildah 1.39.0. Since distributions bundle different Buildah versions, check with
podman info --format '{{.Host.BuildahVersion}}'rather than relying on the Podman version alone.This affects the CLI-generated Feature installation path, not a particular Feature installer. The issue was reproduced with Color, Git, and Common Utilities; other Features using the same path may be affected too.
Two upstream Buildah bugs explain the reported behavior:
Solution
Podman uses its bundled Buildah, so adding a Buildah pin to the CLI manifest or upgrading a separate
buildahexecutable cannot change the builder used bypodman build. Buildah before 1.39.0 can bypass named-context cache lookup; 1.39.0 still hashes regenerated source timestamps and can miss cache. The upstream timestamp fix is in 1.41.1 (backport) and 1.42.0 (mainline). Upgrading Podman to include both fixes is valid, but leaves users on older supported runtimes without a solution.This change checks Podman's bundled Buildah and uses the existing COPY-based Feature path below 1.41.1 or when detection is uncertain. Newer stable versions retain the named-context path. The policy is limited to Feature transport, preserves Docker behavior, and skips detection when
--buildkit neveralready selects COPY.Impact
Affected Podman users can reuse unchanged Feature installation layers without manually setting
--buildkit never. The supplied runtime investigation confirmed that the existing COPY fallback cached unchanged Color Feature builds on Podman 4.9.3 / Buildah 1.33.7 and Podman 5.4.0 / Buildah 1.39.0; a modern fixed builder also cached the default path. Changed inputs and--no-cachestill rebuild as expected. COPY may increase image size because Feature source files can remain in layers.Files Changed
No package manifest, lockfile, generated artifact, published Feature installer, or third-party notice update is required. The implementation uses the existing
semverdependency.Validation and Limits
npm run type-check.npm test -- --grep 'Podman Feature cache compatibility'.npm run test-container-features -- --grep 'Feature content transport'.