Fix matplotlib sandboxing
This appears to fix plotting with matplotlib in python3. This lets
things like //y2020/control_loops/python:finisher --plot work.
Change-Id: I8ff1c91cf078e3aa8b4d5660881c22c8de66f051
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/debian/matplotlib.bzl b/debian/matplotlib.bzl
index d94efd9..3ae0786 100644
--- a/debian/matplotlib.bzl
+++ b/debian/matplotlib.bzl
@@ -185,11 +185,19 @@
name = "matplotlib" + version,
srcs = _src_copied + [
version + "/matplotlib/__init__.py",
- ],
+ ] + native.glob(
+ include = ["usr/lib/python" + tkinter_py_version + "/**/*.py"],
+ ),
data = _data_files + _builtin_so_copied + _system_so_copied + [
":usr/share/matplotlib/mpl-data/matplotlibrc",
- ] + native.glob(["etc/**"]),
- imports = ["usr/lib/python" + version + "/dist-packages", version, "."],
+ ] + native.glob(["etc/**", "usr/share/fonts/**"]),
+ imports = [
+ "rpathed3/usr/lib/python" + version + "/dist-packages",
+ "rpathed3/usr/lib/python" + version + ".7/lib-dynload",
+ version,
+ ".",
+ "usr/lib/python" + tkinter_py_version,
+ ],
target_compatible_with = ["@platforms//cpu:x86_64"],
visibility = ["//visibility:public"],
)