[build][assembly] Restrict visiblity of sbase binaries and remove unused targets

Now that the sbase tools are added via assembly, remove unnecessary
targets and restrict the visibility of all targets down to those that
need to add the sbase tools to specific packages.

Bug: b/332905857
Change-Id: I1d6f484cdaf33fc5bc4dc603c8f4ce0c802d233b
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/sbase/+/1031099
Reviewed-by: John Wittrock <wittrock@google.com>
Fuchsia-Auto-Submit: Aaron Wood <aaronwood@google.com>
Commit-Queue: Aaron Wood <aaronwood@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 7219df7..b83a2fc 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -6,8 +6,11 @@
 import("binaries.gni")
 
 group("bins") {
-  deps = []
+  # This group exists to provide shell command binaries for includes in the
+  # debug-dash-launcher package.
+  visibility = [ "//src/sys/tools/debug-dash-launcher:*" ]
 
+  deps = []
   foreach(bin, sbase_binaries) {
     deps += [ ":${bin}_bin" ]
   }
@@ -27,6 +30,16 @@
 
 foreach(bin, sbase_binaries) {
   executable("${bin}_bin") {
+    visibility = [ ":*" ]
+
+    if (bin == "cat") {
+      # the 'cat' binary is also used by these tests
+      visibility += [
+        "//src/connectivity/network/tests/socket:*",
+        "//src/lib/zxdump:*",
+      ]
+    }
+
     output_name = bin
 
     sources = [ "$bin.c" ]
@@ -42,14 +55,8 @@
   }
 
   fuchsia_package("${bin}_pkg") {
+    visibility = [ "//bundles/assembly:*" ]
     package_name = bin
     deps = [ ":${bin}_bin" ]
   }
 }
-
-group("sbase-pkgs") {
-  deps = []
-  foreach(bin, sbase_binaries) {
-    deps += [ ":${bin}_pkg" ]
-  }
-}