Check all targets to find duplicated outputs. Currently, GN doesn't find duplicated outputs between different toolchain target. To fix this, I changed to see all_targets_ instead of default_toolchain_targets_ for duplicated output error. This is to fix error in https://ci.chromium.org/ui/p/chromium/builders/try/ios-catalyst/2510/overview With this CL error for the build config changed from ``` Two or more targets generate the same output: sdk/xcode_links/MacOSX26.0.sdk/usr/include/DarwinBasic.modulemap This is can often be fixed by changing one of the target names, or by setting an output_name on one of them. Collisions: //buildtools/third_party/libc++:copy_sysroot_modulemaps(//build/toolchain/ios:ios_clang_x64) ``` to ``` Two or more targets generate the same output: sdk/xcode_links/MacOSX26.0.sdk/usr/include/DarwinBasic.modulemap This is can often be fixed by changing one of the target names, or by setting an output_name on one of them. Collisions: //buildtools/third_party/libc++:copy_sysroot_modulemaps(//build/toolchain/ios:ios_clang_x64) //buildtools/third_party/libc++:copy_sysroot_modulemaps(//build/toolchain/mac:clang_arm64) ``` Change-Id: I6f95854c54f33c6809afc1cb43715e33f0677555 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/19760 Reviewed-by: Sylvain Defresne <sdefresne@chromium.org> Commit-Queue: Takuto Ikuta <tikuta@google.com>
diff --git a/src/gn/ninja_build_writer.cc b/src/gn/ninja_build_writer.cc index ca8ff17..d8d7c39 100644 --- a/src/gn/ninja_build_writer.cc +++ b/src/gn/ninja_build_writer.cc
@@ -595,7 +595,7 @@ const StringAtom output_string_atom(output_string); if (!written_rules.insert(output_string_atom).second) { - *err = GetDuplicateOutputError(default_toolchain_targets_, output); + *err = GetDuplicateOutputError(all_targets_, output); return false; } }