Fix builds for "download_stripped" targets

We were seeing this:

    bazel run -c opt --config=roborio //y2020:download_stripped -- 971
    ERROR: Target //y2020:download_stripped is incompatible and cannot be built, but was explicitly requested.
    Dependency chain:
        //y2020:download_stripped
        //aos:prime_start_binaries_stripped
        //aos/events/logging:logger_main
        //aos/events/logging:logger
        //aos/events/logging:logfile_utils
        //aos/events/logging:lzma_encoder
        //third_party:lzma
        //third_party:unavailable   <-- target platform didn't satisfy constraint @platforms//:incompatible
    INFO: Elapsed time: 31.343s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (127 packages loaded, 31974 targets configured)
    FAILED: Build did NOT complete successfully (127 packages loaded, 31974 targets configured)

I accidentally removed some logic I shouldn't have. This patch should
make the invocation work again.

Change-Id: Ia77e403baedcb1d130936ed3c5b51903ed8389c4
diff --git a/aos/events/logging/BUILD b/aos/events/logging/BUILD
index 40e6626..eac61cb 100644
--- a/aos/events/logging/BUILD
+++ b/aos/events/logging/BUILD
@@ -28,7 +28,6 @@
         ":buffer_encoder",
         ":uuid",
         ":logger_fbs",
-        ":lzma_encoder",
         "//aos:configuration",
         "//aos:flatbuffer_merge",
         "//aos:flatbuffers",
@@ -39,7 +38,12 @@
         "@com_github_google_flatbuffers//:flatbuffers",
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/types:span",
-    ],
+    ] + select({
+        "//tools:cpu_k8": [":lzma_encoder"],
+        "//tools:cpu_aarch64": [":lzma_encoder"],
+        "//conditions:default": [],
+    }),
+
 )
 
 cc_binary(
diff --git a/debian/python.BUILD b/debian/python.BUILD
index 7abcf1f..c840a19 100644
--- a/debian/python.BUILD
+++ b/debian/python.BUILD
@@ -10,6 +10,7 @@
         "usr/include/",
         "usr/include/python3.5m/",
     ],
+    target_compatible_with = ["@platforms//cpu:x86_64"],
     visibility = ["//visibility:public"],
 )
 
@@ -47,6 +48,7 @@
         "usr/include/",
         "usr/include/python2.7/",
     ],
+    target_compatible_with = ["@platforms//cpu:x86_64"],
     visibility = ["//visibility:public"],
 )
 
diff --git a/third_party/matplotlib-cpp/BUILD b/third_party/matplotlib-cpp/BUILD
index 4f1f004..1071824 100644
--- a/third_party/matplotlib-cpp/BUILD
+++ b/third_party/matplotlib-cpp/BUILD
@@ -9,7 +9,9 @@
         "@matplotlib_repo//:matplotlib3",
         "@python_repo//:all_files",
     ],
-    target_compatible_with = ["@platforms//os:linux"],
+    # While this is technically compatible with "linux", the
+    # "@python_repo//:all_files" has x86 binaries in it.
+    target_compatible_with = ["@platforms//cpu:x86_64"],
     visibility = ["//visibility:public"],
     deps = [
         "@python_repo//:python3.5_lib",