Skip to content

fix: handle all OS/arch combinations in uriFromLifecycleVersion - #2551

Open
mvanhorn wants to merge 1 commit into
buildpacks:mainfrom
mvanhorn:fix-lifecycle-uri-os-arch
Open

mvanhorn wants to merge 1 commit into
buildpacks:mainfrom
mvanhorn:fix-lifecycle-uri-os-arch

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

Fixes uriFromLifecycleVersion to correctly handle all OS/architecture combinations that the lifecycle project publishes binaries for.

Why this matters

Three issues existed in the URL builder (#2546):

  1. FreeBSD was entirely unhandled - the function always fell through to a Linux URL
  2. Windows binaries stopped after v0.20.5 but the function attempted any version
  3. Architecture aliases (e.g. amd64 vs x86-64) differed by OS but were only handled for Linux

Changes

  • pkg/client/create_builder.go: Rewrote uriFromLifecycleVersion with a switch on OS. Added linuxArch, freebsdArch, and windowsArch helpers that map input architectures to the correct binary suffix per OS. Windows now caps at v0.20.5 with a deprecation warning.
  • internal/builder/lifecycle.go: Added SupportedFreeBSDArchitecture for consistency with the existing SupportedLinuxArchitecture.

Architecture mapping per OS

OS Input Binary suffix
linux amd64 / x86-64 x86-64
linux arm64 / ppc64le / s390x as-is
freebsd amd64 / x86-64 amd64
freebsd arm64 arm64
windows any x86-64 (only published arch)

Fixes #2546

This contribution was developed with AI assistance (Claude Code).

@mvanhorn
mvanhorn requested review from a team as code owners March 20, 2026 06:18
@github-actions github-actions Bot added this to the 0.41.0 milestone Mar 20, 2026
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label Mar 20, 2026
@mvanhorn
mvanhorn force-pushed the fix-lifecycle-uri-os-arch branch from d98b06b to 861eae8 Compare October 27, 2026 21:48
@mvanhorn

Copy link
Copy Markdown
Author

Rebased onto current main as one signed-off commit (861eae8), which clears DCO. The earlier test failures came from the Windows cap: two download tests still expected a v3.4.5 or default-version Windows URL. Lifecycle stopped shipping Windows binaries after v0.20.5 (v0.21.x only has Linux and FreeBSD assets), so those tests now expect the capped v0.20.5 URL. I also added a FreeBSD arm64 download test. go test ./pkg/client/ passes.

@mvanhorn

Copy link
Copy Markdown
Author

The red test (linux) job comes from TestBuild/build/#Build/Quiet_mode/local/only_prints_app_name_and_sha, not from the lifecycle URI change. The runner's Docker daemon now uses containerd storage, so the build prints the containerd performance warning before the image digest and the exact-output assertion fails. The same test fails the same way on unrelated PRs (for example the dependabot run 40410771505), and #2730 is open to fix the assertion. The tests this PR touches in pkg/client/create_builder_test.go pass on all three OSes.

- Add FreeBSD support with amd64 and arm64 architectures
- Cap Windows lifecycle version at v0.20.5, the last release with a
  Windows binary, with a warning
- Replace the SupportedLinuxArchitecture check with per-OS arch mappers
- Map the amd64 alias per OS (x86-64 on Linux/Windows, amd64 on FreeBSD)
- Update the Windows download tests to the capped URL and add a FreeBSD
  download test

Fixes buildpacks#2546

Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
@mvanhorn
mvanhorn force-pushed the fix-lifecycle-uri-os-arch branch from 861eae8 to 0bc9343 Compare November 4, 2026 22:58
@mvanhorn

mvanhorn commented Nov 4, 2026

Copy link
Copy Markdown
Author

Rebased onto current main as 0bc9343 to pick up #2730. The PR diff is unchanged.

@jjbustamante jjbustamante added type/bug Issue that reports an unexpected behaviour. and removed type/enhancement Issue that requests a new feature or improvement. labels Nov 15, 2026

This branch has not been deployed

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

Labels

type/bug Issue that reports an unexpected behaviour.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: improve uriFromLifecycleVersion to handle all supported OS/arch combinations correctly

2 participants