Skip to content

"no declaration matches 'tsl::Future" when building pjrt helpers #40031

@joelberkeley

Description

@joelberkeley

I'm seeing a compilation error

external/xla/xla/tsl/concurrency/future.h:1277:1: error: no declaration matches 'tsl::Future<typename tsl::internal::FutureType<typename U::value_type>::type> tsl::Future<T>::Flatten() const &'
 1277 | Future<T>::Flatten() const& {
      | ^~~~~~~~~

when I build pjrt_c_api_helpers on commit cf0c61a.

How to reproduce

Put the following in the same directory

.bazelrc

build --noenable_bzlmod
build --action_env=BAZEL_CXXOPTS="-std=c++17"
build --nobuild_runfile_links
build --nolegacy_external_runfiles
build --experimental_repo_remote_exec

.bazelversion

7.7.0

BUILD

cc_binary(
    name = "test",
    deps = [
        "@xla//xla/pjrt/c:pjrt_c_api_helpers",
    ],
)

requirements_lock_3_11.txt

(i.e. empty)

WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

commit = "30ef4a9096f9490e8f198faa5ce5bbddd1b72fdb"
http_archive(
    name = "rules_ml_toolchain",
    strip_prefix = "rules_ml_toolchain-" + commit,
    urls = ["https://github.com/google-ml-infra/rules_ml_toolchain/archive/{commit}.tar.gz".format(commit = commit)],
)

local_repository(name = "xla", path = "xla")

load("@xla//:workspace4.bzl", "xla_workspace4")
xla_workspace4()

load("@xla//:workspace3.bzl", "xla_workspace3")
xla_workspace3()

load("@rules_ml_toolchain//cc/deps:cc_toolchain_deps.bzl", "cc_toolchain_deps")
cc_toolchain_deps()

load("@xla//third_party/py:python_init_rules.bzl", "python_init_rules")
python_init_rules()

load("@xla//third_party/py:python_init_repositories.bzl", "python_init_repositories")

python_init_repositories(
    requirements = {
        "3.11": "//requirements_lock_3_11.txt",
    },
)

load("@xla//:workspace2.bzl", "xla_workspace2")
xla_workspace2()

load("@xla//:workspace1.bzl", "xla_workspace1")
xla_workspace1()

load("@xla//:workspace0.bzl", "xla_workspace0")
xla_workspace0()

load(
    "@rules_ml_toolchain//gpu/cuda:cuda_json_init_repository.bzl",
    "cuda_json_init_repository",
)
cuda_json_init_repository()

load(
    "@cuda_redist_json//:distributions.bzl",
    "CUDA_REDISTRIBUTIONS",
    "CUDNN_REDISTRIBUTIONS",
)
load(
    "@rules_ml_toolchain//gpu/cuda:cuda_redist_init_repositories.bzl",
    "cuda_redist_init_repositories",
    "cudnn_redist_init_repository",
)
load(
    "@rules_ml_toolchain//gpu/cuda:cuda_redist_versions.bzl",
    "REDIST_VERSIONS_TO_BUILD_TEMPLATES",
)
load("@xla//third_party/cccl:workspace.bzl", "CCCL_3_2_0_DIST_DICT", "CCCL_GITHUB_VERSIONS_TO_BUILD_TEMPLATES")

cuda_redist_init_repositories(
    cuda_redistributions = CUDA_REDISTRIBUTIONS | CCCL_3_2_0_DIST_DICT,
    redist_versions_to_build_templates = REDIST_VERSIONS_TO_BUILD_TEMPLATES | CCCL_GITHUB_VERSIONS_TO_BUILD_TEMPLATES,
)

cudnn_redist_init_repository(
    cudnn_redistributions = CUDNN_REDISTRIBUTIONS,
)

load(
    "@rules_ml_toolchain//gpu/cuda:cuda_configure.bzl",
    "cuda_configure",
)

cuda_configure(name = "local_config_cuda")

Reproduce in Docker

Dockerfile

FROM ubuntu:24.04

RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone

RUN apt-get update && apt-get install -y git curl python3 clang lld build-essential
RUN curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-amd64.deb
RUN dpkg -i bazelisk-amd64.deb && rm bazelisk-amd64.deb

WORKDIR /test

RUN git clone https://github.com/openxla/xla
RUN cd xla && git checkout cf0c61a5b9060c2e280fee62e927a65dbc75f276 && ./configure.py --backend=cpu

COPY . /test

CMD ["bazel", "build", "test"]

Run

docker build -t test .
docker run -it test

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions