C++,runfiles: avoid collision with @bazel_tools Rename outputs of //tools/cpp/runfiles:srcs_for_embedded_tools so that none of the targets in //tools/cpp/runfiles package are called runfiles.cc or runfiles.h . This is necessary to avoid the C++ compiler picking up the wrong header file when a target depends on @bazel_tools//tools/cpp/runfiles and its source file includes "tools/cpp/runfiles/runfiles.h", but the same file is also available under bazel-genfiles (from a past build of :srcs_for_embedded_tools). Closes #6049. Change-Id: I8fb0d25ed1877087dfa94f00f2c4b0e46134aba9 PiperOrigin-RevId: 211344517
diff --git a/src/create_embedded_tools.py b/src/create_embedded_tools.py index 3041f6a..aaf5753 100644 --- a/src/create_embedded_tools.py +++ b/src/create_embedded_tools.py
@@ -31,8 +31,8 @@ ('*tools/jdk/BUILD*', lambda x: 'tools/jdk/BUILD'), ('*tools/platforms/platforms.BUILD', lambda x: 'platforms/BUILD'), ('*tools/platforms/*', lambda x: 'platforms/' + os.path.basename(x)), - ('*tools/cpp/runfiles/*', - lambda x: 'tools/cpp/runfiles/' + os.path.basename(x)), + ('*tools/cpp/runfiles/generated_*', + lambda x: 'tools/cpp/runfiles/' + os.path.basename(x)[len('generated_'):]), ('*JavaBuilder*_deploy.jar', lambda x: 'tools/jdk/' + os.path.basename(x)), ('*JacocoCoverage*_deploy.jar', lambda x: 'tools/jdk/JacocoCoverage_deploy.jar'), @@ -104,6 +104,7 @@ def copy_jdk_into_archive(output_zip, archive_file, input_file): + """Extract the JDK and adds it to the archive under jdk/*.""" def _replace_dirname(filename): # Rename the first folder to 'jdk', because Bazel looks for a