Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated bazel_to_cmake causes trouble #89

Closed
dzenanz opened this issue Mar 31, 2023 · 6 comments
Closed

Updated bazel_to_cmake causes trouble #89

dzenanz opened this issue Mar 31, 2023 · 6 comments

Comments

@dzenanz
Copy link

dzenanz commented Mar 31, 2023

File "D:\a\im\_skbuild\win-amd64-3.8\cmake-build\_deps\tensorstore-src\tools\cmake\bazel_to_cmake\starlark\select.py", line 108, in evaluate
    return self.op(*(_try_evaluate(operand) for operand in self.operands))
TypeError: unsupported operand type(s) for |: 'dict' and 'dict'

as ocurred here.

This happens with c455741. The same CI used to work with b040186.

@jbms
Copy link
Collaborator

jbms commented Mar 31, 2023

Oh, looks like we accidentally broke support for Python 3.8 by relying on that operator. If you use Python 3.9 it will work; I will see if there is a way to make it work with 3.8 though.

@dzenanz
Copy link
Author

dzenanz commented Apr 13, 2023

@dzenanz
Copy link
Author

dzenanz commented Apr 13, 2023

@dzenanz
Copy link
Author

dzenanz commented Apr 13, 2023

In case the link rots, here is the error:

Found Python3: /opt/python/cp38-cp38/bin/python (found version "3.8.15") found components: Interpreter 
-- Found Patch: /usr/bin/patch  
-- [Protobuf] Found ZLIB: zlib  
-- [absl] Performing Test ABSL_INTERNAL_AT_LEAST_CXX17
-- [absl] Performing Test ABSL_INTERNAL_AT_LEAST_CXX17 - Success
Traceback (most recent call last):
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/evaluation.py", line 283, in get_optional_target_info
    rule_info.impl()
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/bazel_skylib.py", line 153, in <lambda>
    lambda: _expand_template_impl(context, target, out_target, **kwargs),
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/bazel_skylib.py", line 191, in _expand_template_impl
    json.dumps(_context.evaluate_configurable(substitutions)).encode("utf-8"))
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/invocation_context.py", line 121, in evaluate_configurable
    cast(Union[Select[T], SelectExpression[T]],
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/select.py", line 108, in evaluate
    return self.op(*(_try_evaluate(operand) for operand in self.operands))
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/select.py", line 108, in <genexpr>
    return self.op(*(_try_evaluate(operand) for operand in self.operands))
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/select.py", line 104, in _try_evaluate
    return t.evaluate(test_condition)
  File "/work/_skbuild/linux-x86_64-3.8/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/select.py", line 108, in evaluate
    return self.op(*(_try_evaluate(operand) for operand in self.operands))
TypeError: unsupported operand type(s) for |: 'NoneType' and 'DictWithUnion'

@jbms jbms reopened this Apr 14, 2023
@jbms
Copy link
Collaborator

jbms commented Apr 14, 2023

Thanks for reporting this --- there was a missing return new here:

And also in our CI system, CMake was finding an unexpected Python version via the Windows registry and therefore this code path wasn't being properly tested.

I will push out a fixed version shortly.

@dzenanz
Copy link
Author

dzenanz commented Apr 17, 2023

I confirm that 2868eab fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants