rules_python
rules_python copied to clipboard
Problem running (cythonized) packages on MacOS
🐞 bug report
Affected Rule
entry_point
Is this a regression?
unknown
Description
When using packages that are cython-based (eg orjson/uvloop) the packages appear to work fine with a linux host
When running on mac (macOS Big Sur Version 11.6.2) however the packages appear to install but cant import the modules that should be cythonized
🔬 Minimal Reproduction
Add entry_point with orjson and try importing, on a Mac host
🔥 Exception or Error
File "/private/var/tmp/_bazel_faseelak/39573bd1f657e201f66c2197a637acea/execroot/envoy/bazel-out/darwin-fastbuild/bin/tools/dependency/check.runfiles/dev_pip3/pypi__aio_core/aio/core/functional/collections.py", line 7, in
from .utils import maybe_coro, typed
File "/private/var/tmp/_bazel_faseelak/39573bd1f657e201f66c2197a637acea/execroot/envoy/bazel-out/darwin-fastbuild/bin/tools/dependency/check.runfiles/dev_pip3/pypi__aio_core/aio/core/functional/utils.py", line 12, in
import orjson as json
File "/private/var/tmp/_bazel_faseelak/39573bd1f657e201f66c2197a637acea/execroot/envoy/bazel-out/darwin-fastbuild/bin/tools/dependency/check.runfiles/dev_pip3/pypi__orjson/orjson/__init__.py", line 1, in
from .orjson import *
ModuleNotFoundError: No module named 'orjson.orjson'
🌍 Your Environment
Operating System:
macOS Big Sur Version 11.6.2`
Output of bazel version:
bazel 5.0.0
Rules_python version:
0.6.0
Anything else relevant?
also worth mentioning that we have -e deps in the mix, so not sure if that is relevant
from further testing this doesnt seem to be restricted to entry_points and -e doesnt seem to be a factor, so ive updated the title
Can you create a small reproduction repository somewhere? Try a recent version of rules_python as well please.
At $dayjob, we use orjson~=3.6.6 successfully on macos. I am running macOS 11.6.1.
cc @kfaseela who reported the issue to me
we are testing this locally, altho may take a day or two (no macs here im afraid)
when i raised the bug it was failing pretty reliably on every cython lib/artefact that we tested - perhaps its fixed already - but would be good to confirm
Tried testing this again with the test specified in https://github.com/envoyproxy/envoy/pull/22715 and it seems to work now. The issue can be closed. Thanks @phlax