Skip to content

Call for help: build failure: tensorflow #250245

Closed

Description

@tjni

Tensorflow is not failing on unstable yet, but it is on staging-next, and we need your help to fix it. The gist is that protobuf and abseil were updated in #244539, and a good amount of effort (#248231, #248306, #248532, #248536, #249420, #249692, #249752, #249883, #249995, #250193, d90b1cd) has gone into either fixing or pinning protobuf to fix various packages. A couple of us have tried with tensorflow (pinning and fixing) and have not been successful.

Build log

/nix/store/1z4w76wz18jajq9r8p18li7ixq4y3ggk-protobuf-3.23.4/include/google/protobuf/port_def.inc:219:15: error: static assertion failed: Protobuf only supports Abseil version 20230125.3 and newer.
  219 | static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
      |               ^~~~~~~~~~~~~~~~~

https://hydra.nixos.org/build/231981394/nixlog/1
https://hydra.nixos.org/build/231934096/nixlog/2

Additional context

Some ideas:

  1. Update tensorflow to the latest version and hope it fixes this or gets closer to it?
  2. Pin protobuf somehow? (How do we make sure nothing else in the closure brings in a newer version?)
  3. Update abseil somehow? (tensorflow/tensorflow@ad938db is a template though that change is confusing, and I don't think it updates it enough, Update Abseil to fix MSVC compile error tensorflow/tensorflow#61582 looks incomplete)

Notify maintainers

Looking for someone who is invested and more knowledgeable about this package to please help out. Tagging a couple of folks who I've seen involved with tensorflow on GitHub or Discourse: @abbradar @samuela @risicle @Minnozz @SomeoneSerge @NixOS/cuda-maintainers

Activity

  1. added
    0.kind: build failure
    on Aug 19, 2023
  2. changed the title [-]Build failure: tensorflow[/-] [+]Call for help: build failure: tensorflow[/+] on Aug 19, 2023
  3. nixos-discourse commented on Aug 19, 2023

    @nixos-discourse
  4. vcunat commented on Aug 20, 2023

    @vcunat
    Member

    Our current (lib)tensorflow version has some security issues as well, by a quick glance at https://github.com/tensorflow/tensorflow/releases

  5. zeuner commented on Aug 28, 2023

    @zeuner
    Contributor

    FYI, Tensorflow compiles fine when the reverse dependencies of abseil (its Python wrapper, grpc(io) and its Python wrapper, protobuf) aren't taken from the system anymore (example build script patch: zeuner@bcc36f9).

    I would prefer using more system packages, but this might require help from someone who knows more about Tensorflow's build process. In particular, I think it would be better if abseil-cpp could also be taken from the system. com_google_absl is even among Tensorflow's VALID_LIBS that allow using the system version, but actually doing so seems non-trivial. The way it's currently done, protobuf is taken from the system and thereby pulls in the system abseil-cpp, while Tensorflow adds its own abseil-cpp library.

    Also, are there any details regarding the vulnerability warning? The available information about the CVE (e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33976) is not very informative. Will it help to just upgrade Tensorflow?

  6. vcunat commented on Aug 29, 2023

    @vcunat
    Member
  7. zeuner commented on Aug 29, 2023

    @zeuner
    Contributor

    @vcunat Great, thanks. Looking at this information, I guess CVE-2023-33976 could be fixed by either upgrading to https://github.com/tensorflow/tensorflow/tree/v2.13.0, or possibly by backporting tensorflow/tensorflow@915884f.

  8. vcunat commented on Aug 29, 2023

    @vcunat
    Member

    There are many vulnerabilities on that link after the release we have now, so patching everything might be lots of work.

  9. kevinmehall commented on Sep 1, 2023

    @kevinmehall
    Contributor

    I attempted to update tensorflow to 2.13.

    First ran into tensorflow/tensorflow#60667 for which I found a patch from Conda's packaging of 2.12.1 at https://github.com/conda-forge/tensorflow-feedstock/blob/main/recipe/patches/0002-fix-genproto.patch, and also found that another of their patches resolved a subsequent error. It's now failing with:

    ERROR: /build/output/external/pybind11_protobuf/pybind11_protobuf/BUILD:46:15: no such target '@com_google_protobuf//:proto_api': target 'proto_api' not declared in package '' (did you mean 'protobuf'?) defined by /build/output/external/com_google_protobuf/BUILD.bazel and referenced by '@pybind11_protobuf//pybind11_protobuf:proto_cast_util'
    

    which looks like it's new in 2.13, and is being worked on by the Conda packagers at conda-forge/tensorflow-feedstock#329 but I wasn't able to solve it by adapting their patch.

    Pushed my changes to master...kevinmehall:nixpkgs:tensorflow. Hoping someone who knows Bazel can pick up where I left off.

  10. zeuner commented on Sep 1, 2023

    @zeuner
    Contributor

    I have a working build of 2.13.0 here (https://github.com/zeuner/nixpkgs/tree/tensorflow-build-test-2-13), again relying less on compatible system packages. Maybe it can help to better understand how the build can succeed, also when going back to integrating with the dependencies as system packages.

  11. nixos-discourse commented on Sep 17, 2023

    @nixos-discourse
  12. zeuner commented on Sep 19, 2023

    @zeuner
    Contributor

    I made some progress and re-added abseil and protobuf. Since I'm on the way to achieving parity with the previous build with respect to system library integration, I'll start to roll this into a PR: #255998

  13. zeuner commented on Sep 27, 2023

    @zeuner
    Contributor

    Help from someone experienced with x86_64-darwin would also be great. There was quite some progress here (#255998) on Linux platforms, but a Darwin developer might know something about undeclared DISPATCH_APPLY_AUTO identifiers (see https://logs.ofborg.org/?key=nixos/nixpkgs.255998&attempt_id=1b644ce1-ba04-4473-9e1a-94937ca086fd), which, telling from the manpage (https://www.mankier.com/3/dispatch_apply), would be expected to be there when including dispatch/dispatch.h, but is not anyway.

  14. samuela commented on Sep 27, 2023

    @samuela
    Member

    Can we drop x86_64-darwin support? There are fewer and fewer contributors and users with x86_64-darwin machines, making support increasingly onerous

  15. zeuner commented on Oct 19, 2023

    @zeuner
    Contributor

    aarch64-darwin could also use someone knowledgeable to fix compilation: https://github.com/NixOS/nixpkgs/runs/17702324156 . Might also related to clang (see also #254362 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: build failure

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions