Fix cross-platform builds, PyPI upload, and Beam 2.53+ compatibility#97
Fix cross-platform builds, PyPI upload, and Beam 2.53+ compatibility#97czgdp1807 wants to merge 8 commits intotensorflow:masterfrom
Conversation
This commit addresses several build failures specific to macOS with Xcode Command Line Tools clang 17: - Disable ThinLTO on macOS to avoid libLTO.dylib mismatch errors between Bazel and conda-provided compilers - Pin tensorflow-serving-api to version 2.17.1 - Update zlib to 1.3.1 and define HAVE_UNISTD_H to prevent fdopen macro conflicts with macOS SDK headers - Remove deprecated Python 2 module initialization symbols (init_*), keeping only PyInit_* for Python 3 compatibility These changes enable successful builds on macOS arm64 systems using conda environments without requiring Apple's native toolchain. Tested on: macOS arm64, Python 3.12, Bazel 6.5.0
8c7599c to
f88fb1f
Compare
|
@vkarampudi @aktech This is ready to go. Please feel free to merge or let me know any changes needed in this PR. |
Minor error I guess. Will fix it after I am free from |
|
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
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
We hit this concretely in GiGL (Snap's open-source GNN training/inference library), where TFT and tfx-bsl This PR's A v1.17.2 (or v1.18.0) cut with this PR + the (Note: #100 makes the same Happy to dogfood a release candidate against our Dataflow integration suite if that helps land it. |
Problem
Building and publishing tfx-bsl fails on both Linux and macOS due to multiple issues:
libLTO.dylib, causing failures with conda-provided compilersdillnot explicitly listed despite being requiredabsl/strings/str_cat.hheader causes build failurepypi.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,
This is why Python 3.9 still passes (uses older dependency ranges) while 3.10+ fails.