Skip to content

Conversation

@wanlin31
Copy link
Collaborator

@wanlin31 wanlin31 commented Sep 9, 2025

The Problem

Previously, our customized build hook downloaded a platform-specific Go executable and embedded it directly into the Python wheel.

This creates a platform mismatch: the embedded executable matches the platform that built the package, which is not necessarily the same as the platform running the package (e.g., a wheel built on a Linux CI runner will fail for a developer on macOS).

Rejected Approaches

Bundle all platform executables: This was rejected as it would significantly bloat the Python wheel size.

Build platform-specific wheels (Python standard): While this is the standard Python approach (e.g., one wheel for manylinux_x86_64, one for macosx_arm64, etc.), it adds significant complexity and overhead to our release process.

Solution

This PR follows the pattern used by the TypeScript SDK:

The Python wheel no longer contains any pre-built executable.

We have added a "post-install" hook that runs when the user executes the python test-server-sdk.

This hook detects the user's current runtime platform (OS and architecture) and downloads the correct, compatible Go executable at installation time.

This ensures the user always has the correct binary for their environment without bloating the package or complicating the release matrix.

@wanlin31 wanlin31 force-pushed the runtime-install branch 2 times, most recently from 4df2c4b to 9e22777 Compare September 9, 2025 14:10
@wanlin31 wanlin31 force-pushed the runtime-install branch 2 times, most recently from ab32626 to a0fea66 Compare September 9, 2025 16:06
@wanlin31 wanlin31 marked this pull request as ready for review September 9, 2025 16:07
@wanlin31 wanlin31 requested review from Annhiluc and hkt74 September 9, 2025 16:55
@wanlin31 wanlin31 changed the title Not include the binary in the built wheel. Don't include the binary in the built wheel. Sep 10, 2025
@wanlin31 wanlin31 merged commit e35b7a0 into google:main Sep 10, 2025
2 checks passed
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.

2 participants