Fix cross-platform builds, PyPI upload, and Beam 2.53+ compatibility #97
@vkarampudi @aktech This is ready to go. Please feel free to merge or let me know any changes needed in this PR.
Do you want to use 2.17.1 for serving or master. I think pinning to stable releases is better in general.
I have changed to only update the minimal version from 2.13.0 to 2.17.1. Rest everything is the same. Tests are passing on my fork.
@vkarampudi
ModuleNotFoundError: No module named 'pkg_resources'
Minor error I guess. Will fix it after I am free from tfx.
Adding a downstream user data point to support this PR.
The TFT/Beam combination this PR unblocks is already declared compatible upstream, but the wheel build breaks the contract. Per TFT
1.17.0's Compatible versions table:
| tensorflow-transform | apache-beam[gcp] | pyarrow | tensorflow | tensorflow-metadata | tfx-bsl |
| --- | --- | --- | --- | --- | --- |
| 1.17.0 | 2.65.0 | 10.0.1 | 2.17 | 1.17.1 | 1.17.1 |
So TFT 1.17.0 + Beam 2.65.0 + tfx-bsl 1.17.1 is explicitly the supported combination. In practice it doesn't work end-to-end in any
Beam-recommended Python runtime, because:
- The published tfx-bsl==1.17.1 wheel is tagged manylinux_2_39_x86_64.
- apache/beam_python3.11_sdk:2.65.0 is built FROM (glibc 2.36) and is the standard
python:3.11-bookworm
runtime base for Dataflow workers per Google's
build-container-image guide.
- Result: pip install tfx-bsl==1.17.1 fails inside that image, and any TFT-on-Dataflow user is blocked at TFT 1.16 / apache-beam==2.60.0
(or stuck on the previous compat row).
We hit this concretely in GiGL (Snap's open-source GNN training/inference library), where TFT and tfx-bsl
run inside Apache Beam pipelines on Dataflow — see
containers/Dockerfile.dataflow.base.
This PR's manylinux2014 → manylinux_2_28 change in pyproject.toml is the fix.
manylinux_2_28 installs cleanly on Debian 12 (glibc 2.36) and Ubuntu 24.04 (2.39), restoring the documented support contract. Looking at the
v1.17.1 build workflow and
pyproject.toml, the manylinux_2_39 tag appears unintentional — there's
no manylinux-x86_64-image setting and the build runs on ubuntu-latest, so auditwheel embeds whichever host glibc the runner happens to have
(currently 2.39 on ubuntu-24.04).
A v1.17.2 (or v1.18.0) cut with this PR + the dill / tensorflow-serving-api / Beam 2.53+ test fixes would unblock us and, we suspect, every
other TFT-on-Dataflow user at the documented compat row.
(Note: #100 makes the same manylinux_2_28 change as part of a larger TF 2.21 + Python
3.12/3.13 push. Either landing fixes our specific blocker; this PR's narrower scope seems easier to ship first.)
Happy to dogfood a release candidate against our Dataflow integration suite if that helps land it.
@czgdp1807 @vkarampudi @aktech is it possible for us to get this PR in?
czgdp1807
Problem
Building and publishing tfx-bsl fails on both Linux and macOS due to multiple issues:
1. macOS linker error: ThinLTO assumes Apple's
libLTO.dylib, causing failures with conda-provided compilers2. zlib compilation: Macro conflicts between zlib 1.2.11 and modern macOS SDK headers
3. Module symbols: Python 2-era extension symbols cause linker failures on Python 3
4. HDF5 dependency: Missing system library for h5py (transitive dependency) on Python 3.10+ and 3.11+
5. Test failures: Apache Beam 2.53+ metrics API changes break telemetry tests on Python 3.11+
6. Missing dependencies:
dillnot explicitly listed despite being required7. C++ compilation: Missing
absl/strings/str_cat.hheader causes build failure8. PyPI upload failure: Incorrect repository URL (
pypi.org/legacy/instead ofupload.pypi.org/legacy/) causes 404 errorsSolution
This PR addresses all build and test failures across platforms:
Changes
.bazelrc
HAVE_UNISTD_H=1for zlib compatibility with modern macOS headers.github/workflows/build.yml
workflow_dispatchtrigger to enable manual PyPI uploadshttps://pypi.org/legacy/tohttps://upload.pypi.org/legacy/WORKSPACE
http_archivefor zlib before tensorflow dependency loads it_stdio.hpyproject.toml
manylinux2014tomanylinux_2_28for HDF5 >= 1.10.7hdf5-develinstallation inbefore-buildstepbrew install hdf5inbefore-buildstepsetup.py
dill>=0.3.1,<1.0.0dependency (required by Apache Beam but not declared)tensorflow-serving-apito>=2.17.1,<3(was>=2.13.0,<3)tfx_bsl/build_macros.bzl
init_,init)PyInit_<module>for Python 3 compatibilitytfx_bsl/cc/sketches/misragries_sketch.h
#include "absl/strings/str_cat.h"headerno member named 'StrCat' in namespace 'absl'tfx_bsl/telemetry/collection_test.py
withcontext manager pattern and explicitly callpipeline_result.wait_until_finish()tfx_bsl/coders/csv_decoder_test.py
ValueErrorandRuntimeError(newer Beam wraps exceptions)pipeline_result.wait_until_finish()callTesting
Local testing: macOS arm64, Python 3.12, Bazel 6.5.0
pip install -e ".[test]"CI validation: All checks passing on fork
PyPI Upload verification: Tested and working
workflow_dispatchtrigger enables manual PyPI uploads for future releasesImpact
Root Cause Analysis
The CI failures emerged because,
- Pull in h5py as transitive dependency (requires HDF5 C library)
- Use Apache Beam 2.53+ with changed metrics API behavior
This is why Python 3.9 still passes (uses older dependency ranges) while 3.10+ fails.