Hey, I wanted to give zetasql a try, but I have been running into issues getting it to build.
A fresh clone of the repo and bazel test //... fails on linux (fedora35). There are a confluence of problems that I have attempted but failed to work around.
My System
I am using bazelisk for my bazel installation which looks like it correctly picks bazel4 to build zetasql.
> uname -a
Linux phobos 5.17.4-200.fc35.x86_64 #1 SMP PREEMPT Wed Apr 20 15:37:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Problem
When building a fresh clone I get the following error.
> git clone https://github.com/google/zetasql.git
...
> bazel test //...
...
ERROR: /tmp/x/zetasql/zetasql/resolved_ast/BUILD:38:23: Executing genrule //zetasql/resolved_ast:run_gen_resolved_ast_proto failed: (Exit 1): bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)
...
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
----------------
Note: The failure of target //zetasql/resolved_ast:gen_resolved_ast (with exit code 1) may have been caused by the fact that it is running under Python 3 instead of Python 2...
...
What I Tried
I am not interested in adding python2 to any of my environments given its eol status, so I have attempted the patching route.
I wrote a patch to bump jinja and markupsave to bump their versions to a version that is no longer using the removed api. This eliminated those errors. I also modified the gen_resolved_ast py_binary rule to force python3.
Those modifications clear up the above errors, but I am not out of the woods yet.
I am currently stuck on an issue with the generated protos that are used by resolved_ast_enums_pb2.py. There seems to be some error with the DESCRIPTOR value. When digging through /bazel-bin its defined, and not none.
ERROR: /tmp/zetasql/java/com/google/zetasql/resolvedast/BUILD:26:23: Executing genrule //java/com/google/zetasql/resolvedast:run_gen_resolved_ast_java failed: (Exit 1): bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
File "/home/<username>/.cache/bazel/_bazel_<username>/7732d869f91304b104183878d18da881/sandbox/linux-sandbox/445/execroot/com_google_zetasql/bazel-out/host/bin/zetasql/resolved_ast/gen_resolved_ast.runfiles/com_google_zetasql/zetasql/resolved_ast/gen_resolved_ast.py", line 54, in <module>
from zetasql.resolved_ast import resolved_ast_enums_pb2
File "/home/<username>/.cache/bazel/_bazel_<username>/7732d869f91304b104183878d18da881/sandbox/linux-sandbox/445/execroot/com_google_zetasql/bazel-out/host/bin/zetasql/resolved_ast/gen_resolved_ast.runfiles/com_google_zetasql/zetasql/resolved_ast/resolved_ast_enums_pb2.py", line 21, in <module>
_RESOLVEDSUBQUERYEXPRENUMS = DESCRIPTOR.message_types_by_name['ResolvedSubqueryExprEnums']
AttributeError: 'NoneType' object has no attribute 'message_types_by_name'
Patch
Here is the patch I am currently working with. The changes to arena_allocator.h are because I ultimately want to use this in cpp20, and it is using an api that has been removed.
How can I resolve the issue with this generated protobuf source? Its not super clear to me why the issue is happening. I would really appreciate some guidance on how I could adjust my patch to resolve the problems with this generator.
Hey, I wanted to give zetasql a try, but I have been running into issues getting it to build.
A fresh clone of the repo and
bazel test //...
fails on linux (fedora35). There are a confluence of problems that I have attempted but failed to work around.My System
I am using bazelisk for my bazel installation which looks like it correctly picks bazel4 to build zetasql.
Problem
When building a fresh clone I get the following error.
What I Tried
I am not interested in adding python2 to any of my environments given its eol status, so I have attempted the patching route.
I wrote a patch to bump jinja and markupsave to bump their versions to a version that is no longer using the removed api. This eliminated those errors. I also modified the
gen_resolved_ast
py_binary rule to force python3.Those modifications clear up the above errors, but I am not out of the woods yet.
I am currently stuck on an issue with the generated protos that are used by
resolved_ast_enums_pb2.py
. There seems to be some error with theDESCRIPTOR
value. When digging through/bazel-bin
its defined, and not none.Patch
Here is the patch I am currently working with. The changes to
arena_allocator.h
are because I ultimately want to use this in cpp20, and it is using an api that has been removed.Question
How can I resolve the issue with this generated protobuf source? Its not super clear to me why the issue is happening. I would really appreciate some guidance on how I could adjust my patch to resolve the problems with this generator.
Thanks!