Skip to content

Use external repository rather than git submodule for protobuf dependency #1069

Closed

Description

@davidzchen

Currently, TensorFlow vendors its protobuf dependency using a Git submodule due to the hack that is required for protobuf Python support.

I have made a change (bazelbuild/bazel#702) to add an imports attribute to Bazel's Python rules, which allows us to add directories to the PYTHONPATH and thus allows us to remove the hack in protobuf.

I have a patch to remove the hack for protobuf Python support (see protocolbuffers/protobuf#1230). I am testing this change using a corresponding change to TensorFlow which removes the git submodule and includes the protobuf dependency using a Bazel external repository instead. Once my patch for protocolbuffers/protobuf#1230 has been submitted, I will send out my corresponding patch to TensorFlow for review.

Activity

  1. martinwicke commented on Feb 12, 2016

    @martinwicke
    Member

    This is exciting and if it all works I would love that change.
    On Thu, Feb 11, 2016 at 19:34 David Z. Chen [email protected]
    wrote:

    Currently, TensorFlow vendors its protobuf dependency using a Git
    submodule due to the hack
    https://github.com/google/protobuf/blob/master/BUILD#L487 that is
    required for protobuf Python support.

    I have made a change (bazelbuild/bazel#702
    bazelbuild/bazel#702) to add an imports
    attribute to Bazel's Python rules, which allows us to add directories to
    the PYTHONPATH and thus allows us to remove the hack in protobuf.

    I have a patch to remove the hack for protobuf Python support (see
    protocolbuffers/protobuf#1230 protocolbuffers/protobuf#1230). I
    am testing this change using a corresponding change to TensorFlow which
    removes the git submodule and includes the protobuf dependency using a
    Bazel external repository instead. Once my patch for protocolbuffers/protobuf#1230
    protocolbuffers/protobuf#1230 has been submitted, I
    will send out my corresponding patch to TensorFlow for review.

    —
    Reply to this email directly or view it on GitHub
    #1069.

  2. added a commit that references this issue on Feb 13, 2016
    6224ac7
  3. damienmg commented on Feb 15, 2016

    @damienmg
    Contributor

    We need bazel 0.2 to have this work.

  4. davidzchen commented on Feb 16, 2016

    @davidzchen
    ContributorAuthor

    This will also require the next protobuf release that contains protocolbuffers/protobuf#1233 as well.

  5. added 2 commits that reference this issue on Feb 23, 2016
    cb02560
    8db8a5d
  6. kcgthb commented on Feb 25, 2016

    @kcgthb

    Any update on this? The protobuf git submodule seems to have been removed sometime before v0.7.1 was tagged, but the new external repo doesn't appaear to be there yet.

    Fresh pull:

    $ git clone https://github.com/tensorflow/tensorflow.git
    $ cd tensorflow
    $ git checkout v0.7.1
    $ ./configure
    $ bazel build -c opt --config=cuda --verbose_failures //tensorflow/cc:tutorials_example_trainer
    .......
    ERROR: /share/sw/admin/sources/t/tensorflow/tensorflow/cc/BUILD:63:1: error loading package 'tensorflow/core': Extension file not found. Unable to load package for '//google/protobuf:protobuf.bzl': BUILD file not found on package path and referenced by '//tensorflow/cc:tutorials_example_trainer'.
    ERROR: Loading failed; build aborted.
    INFO: Elapsed time: 1.988s
    

    What's the current way of compiling Tensorflow from source?

  7. added 2 commits that reference this issue on Feb 25, 2016
    fff31d8
    b704b4a
  8. davidzchen commented on Feb 25, 2016

    @davidzchen
    ContributorAuthor

    @kcgthb - I don't think the protobuf Git submodule has been removed yet. Does running git submodule update --init work for you?

    In any case, since my patch to protobuf has been merged (see protocolbuffers/protobuf#1233), I have just opened a PR to switch to an external repository in tensorflow (see #1289).

  9. kcgthb commented on Feb 25, 2016

    @kcgthb

    Ah right, was missing --recursive for the inital clone, sorry for the noise.

  10. added 2 commits that reference this issue on Mar 26, 2016
    a74d275
    dba1a2c
  11. added 2 commits that reference this issue on Apr 8, 2016
    e0a4f4a
    7bee4b8
  12. 6 remaining items

  13. added 3 commits that reference this issue on May 11, 2016
    7bbc430
    15afd8f
    bb91e0f
  14. added 7 commits that reference this issue on May 20, 2016
    1f79cd4
    40ed8d8
    0777da9
    5325424
    fade8b0
    f5a9740
    278cc46
  15. added a commit that references this issue on May 26, 2016
    14ac223
  16. trinity77 commented on Sep 10, 2016

    @trinity77

    Trigger Closed

  17. added a commit that references this issue on May 29, 2023
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions