[DawnLPM] Fix non-deterministic dependency cycle

This CL removes the hacky copies that were required to work around
`get_target_outputs` from a `proto_library` which caused [1].

The dependency cycle could pop up because a cached obj file could reference a protobuf header which could reference that cached obj file:

dawn_lpm_proto.lib ->
dawn_lpm_autogen.pb.obj -> gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_custom_lpm.pb.h -> obj/third_party/dawn/src/dawn/fuzzers/dawn_lpm_proto.lib

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=1455317#c11

Bug: chromium:1455317
Change-Id: Icc092f3d1ba8c53d53f4a3eeb57f8ee733130040
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/152500
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/dawn/fuzzers/BUILD.gn b/src/dawn/fuzzers/BUILD.gn
index a3686c9..07ad2a3 100644
--- a/src/dawn/fuzzers/BUILD.gn
+++ b/src/dawn/fuzzers/BUILD.gn
@@ -127,6 +127,7 @@
     ]
   }
 
+  # Generate the `.proto` files
   dawn_json_lpm_generator("dawn_lpmfuzz_proto") {
     target = "dawn_lpmfuzz_proto"
     outputs = [
@@ -135,43 +136,31 @@
     ]
   }
 
-  copy("copy_dawn_custom_lpms") {
-    # Hardcoded paths because we can't get_target_outputs from a proto_library
-    # TODO(tiszka): crbug.com/1410213
+  # Copy handwritten `.proto` files to build directory
+  copy("copy_dawn_custom_lpm") {
     sources = [ "${dawn_root}/src/dawn/fuzzers/lpmfuzz/dawn_custom_lpm.proto" ]
     outputs = [ "$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_custom_lpm.proto" ]
   }
 
+  # Generate the `.pb.h` and `.pb.cc` files
   proto_library("dawn_lpm_proto") {
     proto_in_dir = "$root_out_dir/gen"
     sources = get_target_outputs(":dawn_lpmfuzz_proto")
-    sources += get_target_outputs(":copy_dawn_custom_lpms")
+    sources += get_target_outputs(":copy_dawn_custom_lpm")
 
+    generate_python = false
     use_protobuf_full = true
     deps = [
-      ":copy_dawn_custom_lpms",
+      ":copy_dawn_custom_lpm",
       ":dawn_lpmfuzz_proto",
       "//third_party/protobuf:protobuf_full",
     ]
   }
 
-  copy("copy_dawn_lpm_proto_outputs") {
-    # Hardcoded paths because we can't get_target_outputs from a proto_library
-    # TODO(tiszka): crbug.com/1410213
-    sources = [
-      "$root_out_dir/gen/$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_custom_lpm.pb.cc",
-      "$root_out_dir/gen/$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_custom_lpm.pb.h",
-      "$root_out_dir/gen/$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_lpm_autogen.pb.cc",
-      "$root_out_dir/gen/$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_lpm_autogen.pb.h",
-      "$root_out_dir/gen/$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_object_types_lpm_autogen.pb.cc",
-      "$root_out_dir/gen/$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/dawn_object_types_lpm_autogen.pb.h",
-    ]
-    outputs = [ "$root_out_dir/gen/third_party/dawn/src/dawn/fuzzers/lpmfuzz/{{source_file_part}}" ]
-    deps = [ ":dawn_lpm_proto" ]
-  }
-
   dawn_fuzzer_test("dawn_lpm_fuzzer_vulkan_backend") {
     sources = get_target_outputs(":dawn_lpmfuzz_cpp")
+    sources += get_target_outputs(":dawn_lpm_proto_gen")
+
     sources += [
       "lpmfuzz/DawnLPMFuzzer.cpp",
       "lpmfuzz/DawnLPMFuzzer.h",
@@ -183,7 +172,7 @@
     ]
 
     deps = [
-      ":copy_dawn_lpm_proto_outputs",
+      ":dawn_lpm_proto",
       ":dawn_lpmfuzz_cpp",
       "${dawn_root}/src/dawn:cpp",
       "${dawn_root}/src/dawn:proc",
@@ -191,7 +180,6 @@
       "${dawn_root}/src/dawn/native:static",
       "${dawn_root}/src/dawn/utils",
       "${dawn_root}/src/dawn/wire:static",
-      "//third_party/dawn/src/dawn/fuzzers:dawn_lpm_proto",
       "//third_party/libprotobuf-mutator",
     ]
   }