Commit
* Fix reference to six in //:protobuf_python rule * Add six to protobuf_deps.bzl * Use six archive directly as repo @six
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,11 @@ def protobuf_deps(): | |
strip_prefix = "zlib-1.2.11", | ||
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"], | ||
) | ||
|
||
if "six" not in native.existing_rules(): | ||
http_archive( | ||
name = "six", | ||
build_file = "@//:six.BUILD", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aaliddell
Author
Contributor
|
||
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a", | ||
urls = ["https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55"], | ||
) |
6 comments
on commit a74c43b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this commit breaks //:py_generator_test
on Linux with Bazel 0.28.0
At this commit:
$ bazel --version
bazel 0.28.0
$ bazel test //:py_generator_test --test_output=errors
(...)
INFO: From Testing //:py_generator_test:
==================== Test output for //:py_generator_test:
Traceback (most recent call last):
File "/usr/local/google/home/laszlocsomor/.cache/bazel/_bazel_laszlocsomor/01c7a16cdc16c48290b25e928dfd648e/sandbox/linux-sandbox/264/execroot/com_google_protobuf/bazel-out/k8-fastbuild/bin/py_generator_test.runfiles/com_google_protobuf/python/google/protobuf/internal/generator_test.py", line 49, in <module>
from google.protobuf.internal import test_bad_identifiers_pb2
File "/usr/local/google/home/laszlocsomor/.cache/bazel/_bazel_laszlocsomor/01c7a16cdc16c48290b25e928dfd648e/sandbox/linux-sandbox/264/execroot/com_google_protobuf/bazel-out/k8-fastbuild/bin/py_generator_test.runfiles/com_google_protobuf/python/google/protobuf/internal/test_bad_identifiers_pb2.py", line 7, in <module>
from google.protobuf import descriptor as _descriptor
File "/usr/local/google/home/laszlocsomor/.cache/bazel/_bazel_laszlocsomor/01c7a16cdc16c48290b25e928dfd648e/sandbox/linux-sandbox/264/execroot/com_google_protobuf/bazel-out/k8-fastbuild/bin/py_generator_test.runfiles/com_google_protobuf/python/google/protobuf/descriptor.py", line 94, in <module>
class DescriptorBase(six.with_metaclass(DescriptorMetaclass)):
AttributeError: module 'six' has no attribute 'with_metaclass'
================================================================================
At parent commit (f2cfe2c), this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is with_metaclass
a function that is only in newer releases of six? If so, perhaps the current 1.10.0
should be bumped to 1.12.0
, provided it's not going to cause issues elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM, but I don't know.
(I'm also not a Protobuf maintainer.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's curious this wasn't picked up by CI, but perhaps that target isn't used. Seeing as comments on commits tend to get lost in the abyss, it might be worth creating an issue instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so it's not the version that's the problem, it's because of the old-favourite legacy_create_init flag. Sorting a PR now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #6391
Shouldn't this be
@com_google_protobuf//:six.BUILD
? This file is meant to be used in consumer WORKSPACE files as well.For example, this fails for me: