aspect-build / aspect-build/bazel-examples

[Bug]: py_layers.bzl's interpreter layer also fetches dependencies

Open
#311 1 comment 2 reactions 1 assignee Claimed by @thesayyn View on GitHub
bug
Dominant language
Starlark
Stars
149
Forks
87
PR merge metrics
No merged PRs in 30d

Description

### What happened?

While adopting `rules_oci` for python using the macro `py_oci_image`, I noticed non-interpreter files in the interpreter layer. Some of the site-packages have compiled modules for `cpython-*`, which pass the regex for interpreter (screenshot attached).

`.../bazel-bin/services/services_image.interpreter_tar_manifest.spec`:
```
services/service_name/service.runfiles/pip_parse_name_sqlalchemy/site-packages/sqlalchemy/cimmutabledict.cpython-39-x86_64-linux-gnu.so uid=0 gid=0 time=1672560000 mode=0755 type=file content=external/pip_parse_name_sqlalchemy/site-packages/sqlalchemy/cimmutabledict.cpython-39-x86_64-linux-gnu.so
```
----

image

----

Should be a simple fix:
```
cmd = "grep '{}' $< | grep -v '{}' >$@".format(PY_INTERPRETER_REGEX, SITE_PACKAGES_REGEX),
```

Happy to open a PR!

### Version

Development (host) and target OS/architectures:

Output of `bazel --version`:

Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:

Language(s) and/or frameworks involved:

### How to reproduce

_No response_

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.