Fix cross-platform builds, PyPI upload, and Beam 2.53+ compatibility#97
Open
czgdp1807 wants to merge 7 commits intotensorflow:masterfrom
Open
Fix cross-platform builds, PyPI upload, and Beam 2.53+ compatibility#97czgdp1807 wants to merge 7 commits intotensorflow:masterfrom
czgdp1807 wants to merge 7 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
Author
|
@vkarampudi @aktech This is ready to go. Please feel free to merge or let me know any changes needed in this PR. |
czgdp1807
commented
Feb 5, 2026
Author
Minor error I guess. Will fix it after I am free from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.