Fix broken clang coverage tests when new Swift version is installed on Ubuntu 16.04
@@ -130,3 +130,11 @@ ENV PATH "${PATH}:${GO_HOME}/bin"
### Install Swift toolchain (required by rules_swift).
ENV SWIFT_HOME "/opt/swift-5.2.5-RELEASE-ubuntu16.04"
ENV PATH "${PATH}:${SWIFT_HOME}/usr/bin"
+
+### Fix missing symlink.
+# This is missing in Ubuntu 16.04 and was added in later versions.
+# Because recent Swift versions also ship the llvm-profdata binary, Bazel's test
+# //src/test/shell/bazel:bazel_coverage_cc_head_test_llvm will accidentally pick
+# that one, which isn't compatible with the rest of the system-provided clang,
+# causing the test to fail. Installing this symlink fixes the issue.
+RUN ln -s /usr/lib/llvm-3.8/bin/llvm-profdata /usr/bin/llvm-profdata
