Skip to content

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
masterfrom
test_1019533579
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1019533579

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

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.

…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

No deployments
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.

1 participant