Skip to content

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

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

fix: handle all OS/arch combinations in uriFromLifecycleVersion#2551
mvanhorn wants to merge 1 commit intobuildpacks:mainfrom
mvanhorn:fix-lifecycle-uri-os-arch

Conversation

@mvanhorn
Copy link

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).

- Add FreeBSD support with amd64 and arm64 architectures
- Cap Windows lifecycle version at v0.20.5 (deprecated) with warning
- Replace SupportedLinuxArchitecture check with per-OS arch mappers
- Map amd64 alias correctly per OS (x86-64 on Linux/Windows, amd64 on FreeBSD)

Fixes buildpacks#2546
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant