Repository navigation
Build TF.Text nightlies with libc++ and C++20 on Linux to match tf-nightly. - #1581
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
…ghtly.
Since TensorFlow commit cc213229b92c ("Switch Linux builds from libstdc++
(C++17) to statically linked libc++ (C++20)"), tf-nightly (2.23.0.dev20261105
and later) builds Linux with libc++, so libtensorflow_framework.so.2 exports
libc++-mangled symbols, for example
_ZNK10tensorflow8OpKernel11TraceStringERKNS_15OpKernelContextEb instead of
_ZNK10tensorflow8OpKernel11TraceStringB5cxx11ERKNS_15OpKernelContextEb.
TF.Text nightlies use the .bazelrc of the TF release, which still uses
libstdc++, so the Linux x86_64 and arm64 nightly CI and nightly release builds
fail: C++ tests fail to link (undefined symbol tsl::ReadFileToString), and the
op libraries fail to load (undefined symbol tensorflow::OpKernel::TraceString).
macOS is unaffected because it already uses libc++.
For nightly builds, write the Linux toolchain flags of TensorFlow master
(LLVM 22, statically linked libc++, C++20) to .bazelrc in configure.sh. Release
builds keep the toolchain of the TF release (2.22 uses libstdc++).
This, not the CI Docker image, is the root cause of the failures that
cl/1019523431 attributed to the CI Docker images.
PiperOrigin-RevId: 1019533579
This branch has not been deployed
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.
Build TF.Text nightlies with libc++ and C++20 on Linux to match tf-nightly.
Since TensorFlow commit cc213229b92c ("Switch Linux builds from libstdc++
(C++17) to statically linked libc++ (C++20)"), tf-nightly (2.23.0.dev20261105
and later) builds Linux with libc++, so libtensorflow_framework.so.2 exports
libc++-mangled symbols, for example
_ZNK10tensorflow8OpKernel11TraceStringERKNS_15OpKernelContextEb instead of
_ZNK10tensorflow8OpKernel11TraceStringB5cxx11ERKNS_15OpKernelContextEb.
TF.Text nightlies use the .bazelrc of the TF release, which still uses
libstdc++, so the Linux x86_64 and arm64 nightly CI and nightly release builds
fail: C++ tests fail to link (undefined symbol tsl::ReadFileToString), and the
op libraries fail to load (undefined symbol tensorflow::OpKernel::TraceString).
macOS is unaffected because it already uses libc++.
For nightly builds, write the Linux toolchain flags of TensorFlow master
(LLVM 22, statically linked libc++, C++20) to .bazelrc in configure.sh. Release
builds keep the toolchain of the TF release (2.22 uses libstdc++).
This, not the CI Docker image, is the root cause of the failures that
cl/1019523431 attributed to the CI Docker images.