red-postman-3638
01/11/2022, 3:05 PMred-postman-3638
01/11/2022, 3:07 PMfrom bcc import BPF.
Note, that this is not to be confused with the physics module regarding the BCC lattice, which must not be installed simultaniously.
With venv there is an option --system-site-packages to allow such packages to be used.
How would I be able to use this system installed package with Pants?red-postman-3638
01/11/2022, 3:08 PMpython_requirement(
name="bcc",
requirements=[
"bcc @ file:///usr/lib/python3.10/site-packages/bcc/",
],
)enough-analyst-54434
01/11/2022, 3:38 PMenough-analyst-54434
01/11/2022, 3:38 PMenough-analyst-54434
01/11/2022, 3:52 PM$ ls -l bcc/build/src/python/bcc-python3/dist/
total 44
-rw-r--r-- 1 jsirois jsirois 42837 Jan 11 07:47 bcc-0.23.0-23a21423.tar.gz
That sdist can be then placed on an internal repo and you can configure Pants to use that repo (or just use a direct reference url which sounds like its doing the trick for your investigation.enough-analyst-54434
01/11/2022, 3:53 PMenough-analyst-54434
01/11/2022, 3:56 PM$ head -23 bcc/src/python/bcc/libbcc.py | tail -9
import ctypes as ct
lib = ct.CDLL("libbcc.so.0", use_errno=True)
# needed for perf_event_attr() ctype
from .perf import Perf
# keep in sync with bcc_common.h
lib.bpf_module_create_c.restype = ct.c_void_pred-postman-3638
01/11/2022, 3:57 PM/usr/lib/python3.10/site-packages/bcc$ tree
.
โโโ containers.py
โโโ disassembler.py
โโโ __init__.py
โโโ libbcc.py
โโโ perf.py
โโโ __pycache__
โย ย โโโ containers.cpython-310.pyc
โย ย โโโ disassembler.cpython-310.pyc
โย ย โโโ __init__.cpython-310.pyc
โย ย โโโ libbcc.cpython-310.pyc
โย ย โโโ perf.cpython-310.pyc
โย ย โโโ syscall.cpython-310.pyc
โย ย โโโ table.cpython-310.pyc
โย ย โโโ tcp.cpython-310.pyc
โย ย โโโ usdt.cpython-310.pyc
โย ย โโโ utils.cpython-310.pyc
โย ย โโโ version.cpython-310.pyc
โโโ syscall.py
โโโ table.py
โโโ tcp.py
โโโ usdt.py
โโโ utils.py
โโโ version.py
1 directory, 22 filesenough-analyst-54434
01/11/2022, 3:58 PMred-postman-3638
01/11/2022, 3:59 PMred-postman-3638
01/11/2022, 4:02 PMred-postman-3638
01/11/2022, 4:05 PM