Repository navigation
Closed
Description
There is a common CI issue on macOS/x86-64 about pkgutil. ImpImporter triggered by 'rules_python"
ERROR: An error occurred during the fetch of repository 'fuzzing_py_deps':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_runner/f7b5b126cb65bf12475e[29](https://github.com/proxy-wasm/proxy-wasm-cpp-host/actions/runs/8042165716/job/21962477785#step:9:30)2acf07553d/external/rules_python/python/pip_install/pip_repository.bzl", line 171, column 13, in _pip_repository_impl
fail("rules_python failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: rules_python failed: (Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen runpy>", line 148, in _get_module_details
File "<frozen runpy>", line 112, in _get_module_details
File "/private/var/tmp/_bazel_runner/f7b5b126cb65bf12[47](https://github.com/proxy-wasm/proxy-wasm-cpp-host/actions/runs/8042165716/job/21962477785#step:9:48)5e292acf07553d/external/rules_python/python/pip_install/extract_wheels/__init__.py", line 15, in <module>
from python.pip_install.extract_wheels.lib import arguments, bazel, requirements
File "/private/var/tmp/_bazel_runner/f7b5b126cb65bf12475e292acf07553d/external/rules_python/python/pip_install/extract_wheels/lib/bazel.py", line 9, in <module>
from python.pip_install.extract_wheels.lib import namespace_pkgs, purelib, wheel
File "/private/var/tmp/_bazel_runner/f7b5b126cb65bf12475e292acf07553d/external/rules_python/python/pip_install/extract_wheels/lib/purelib.py", line 6, in <module>
from python.pip_install.extract_wheels.lib import wheel
File "/private/var/tmp/_bazel_runner/f7b5b126cb65bf12475e292acf07553d/external/rules_python/python/pip_install/extract_wheels/lib/wheel.py", line 9, in <module>
import pkg_resources
File "/private/var/tmp/_bazel_runner/f7b5b126cb65bf12475e292acf07553d/external/pypi__setuptools/pkg_resources/__init__.py", line 2158, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
It turns out that pkgutil.ImpImporter, as a long-deprecated class, has been removed from python 3.12. A proper way of fixing is upgrade rules_python.
But if using the latest rules_python 0.31, another error will be meet.
ERROR: /root/.cache/bazel/_bazel_root/adb5dd13720c6f98da219c2f1ac0ff1a/external/rules_python/python/private/common/py_executable.bzl:840:12: name 'RunEnvironmentInfo' is not defined
It is because RunEnvironmentInfo is not exposed in Bazel < 5.3. Currently, proxy-wasm-cpp-host is using Build label: 5.2.0.
So I am kind of stuck here, shall I ?
- try with another version of rules_python
- just upgrade bazel environment
- something else
Metadata
Metadata
Assignees
Labels
No labels
Activity
PiotrSikora commentedon Feb 26, 2024
Updating Bazel to 7.x and rules_python seems like a way to go. Thanks!
lum1n0us commentedon Apr 17, 2024
Sorry for delayed response.
The new rules_python provides a different way for
pip_install()and it beats me. Hope #389 can resolve it.[-]About the CI issue "AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?"[/-][+]CI for macOS: "AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?"[/+][-]CI for macOS: "AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?"[/-][+][CI] macOS builds: "AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?"[/+]fix: Move from unavailable macos-11 to macos-13
martijneken commentedon Aug 3, 2024
Early finding: I can upgrade to Bazel 6.5.0 but with Bazel 7 (turning off bzlmod) I get wasm build errors. I may proceed with 6.5.0 for now (which matches Envoy).
Build errors seem to generally relate to toolchains + transitions:
--cxxoptgets lost in C++ wasm transition, leading tono type named 'string_view' in namespace 'std'--action_env=BAZEL_CXXOPTS="-std=c++17"fix: Move from unavailable macos-11 to macos-13 (proxy-wasm#401)
PiotrSikora commentedon Aug 3, 2024
Drive-by comment, but
copts = ["-std=c++17"]should be added to all Bazel C++ targets in C++ Host, since Bazel workspaces that depend on it won't use our.bazelrc, and instead need to force this flag themselves.This works in Envoy right now, because it's also forcing C++17, but this should be fixed sooner, rather than later.
feat: add knob to customise on{Request,Response}Headers StopIteration…