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 caused by the fact that _repo_mapping file is NOT in runfiles object and so it is invisible to the custom Starlark rule 17941. The bugfix implemented in 4e60992432a49dda255eb005544ae8c03b30e243 will not help us to resolve this problem, since it only fixes zip file generating with --build_python_zip.
cd oci_python_image
bazel run hello_world
bazel run hello_world:tarball && docker run --rm gcr.io/oci_python_hello_world:latest
Any other information?
In logs bellow the output of these two command SHOULD be identical. However, the runfiles resolution does not work correctly when running in OCI Container. The problem is with missing _repo_mapping file, so the runfiles._Runfiles._repo_mapping is NOT filled with correct data. This results in fact that runfiles resolution ends up with path /opt/hello_world/hello_world.runfiles/my_workspace/hello_world/data/config.json (note the my_workspace directory in path), where is the real location of the file is in /opt/hello_world/hello_world.runfiles/_main/hello_world/data/config.json (note _main directory in path). See also this comment.
What happened?
Runfiles resolution described in rules_python/python/runfiles does not work with bazel-examples/oci_python_image example.
This is caused by the fact that
_repo_mapping
file is NOT in runfiles object and so it is invisible to the custom Starlark rule 17941. The bugfix implemented in 4e60992432a49dda255eb005544ae8c03b30e243 will not help us to resolve this problem, since it only fixes zip file generating with--build_python_zip
.Version
Development (host) and target OS/architectures:
Output of
bazel --version
:Docker version:
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:Language(s) and/or frameworks involved:
How to reproduce
Check out branch bug/oci_python_image/runfiles from my fork uhlajs/bazel-examples.
Run:
Any other information?
In logs bellow the output of these two command SHOULD be identical. However, the runfiles resolution does not work correctly when running in OCI Container. The problem is with missing
_repo_mapping
file, so therunfiles._Runfiles._repo_mapping
is NOT filled with correct data. This results in fact that runfiles resolution ends up with path/opt/hello_world/hello_world.runfiles/my_workspace/hello_world/data/config.json
(note themy_workspace
directory in path), where is the real location of the file is in/opt/hello_world/hello_world.runfiles/_main/hello_world/data/config.json
(note_main
directory in path). See also this comment.The text was updated successfully, but these errors were encountered: