You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is to show how the current oci_python_image example does not work when building on macos.
cd oci_python_image
bazel run //hello_world:tarball
docker run --rm gcr.io/oci_python_hello_world:latest
Traceback (most recent call last):
File "/hello_world/hello_world.runfiles/_main/hello_world/__main__.py", line 1, in <module>
from hello_world.app import Cow
File "/hello_world/hello_world.runfiles/_main/hello_world/app.py", line 2, in <module>
from pydantic import BaseModel
File "/hello_world/hello_world.runfiles/.hello_world.venv/lib/python3.9/site-packages/pydantic/__init__.py", line 404, in __getattr__
module = import_module(module_name, package=package)
File "/hello_world/hello_world.runfiles/rules_python~~python~python_3_9_aarch64-unknown-linux-gnu/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/hello_world/hello_world.runfiles/.hello_world.venv/lib/python3.9/site-packages/pydantic/main.py", line 27, in <module>
import pydantic_core
File "/hello_world/hello_world.runfiles/.hello_world.venv/lib/python3.9/site-packages/pydantic_core/__init__.py", line 6, in <module>
from ._pydantic_core import (
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
This is because pydantic_core's prebuilt is copied from host (macos), not for target. See the following output having darwin, not linux.
docker run --rm gcr.io/oci_python_hello_world:latest ls /hello_world/hello_world.runfiles/rules_python~~pip~pip_39_pydantic_core/site-packages/pydantic_core/
What happened?
See https://github.com/aspect-build/bazel-examples/compare/main...chulkilee:bazel-examples:oci-py-target?expand=1
This is to show how the current oci_python_image example does not work when building on macos.
cd oci_python_image bazel run //hello_world:tarball docker run --rm gcr.io/oci_python_hello_world:latest
This is because pydantic_core's prebuilt is copied from host (macos), not for target. See the following output having darwin, not linux.
Output:
Interestingly, it actually did use the right python
Output:
See
aarch64-unknown-linux-gnu
there.Version
Development (host) and target OS/architectures:
Output of
bazel --version
: 7.3.0Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file: did not change from oci_python_imageLanguage(s) and/or frameworks involved: python
How to reproduce
See https://github.com/aspect-build/bazel-examples/compare/main...chulkilee:bazel-examples:oci-py-target?expand=1
Any other information?
It doesn't fail the test since apparently tests are running on linux machine.
The text was updated successfully, but these errors were encountered: