Bazel client: fix reporting of ignored RC files
(This commit is a roll-forward of commit e9a908560133770614eca89ef64681bdf3f04b3e
that was rolled back by commit 37335187bf31dac48155e77f404bd11008d68ea7. The culprit
of the breakage is fixed in the Google-internal
depot.)
Compute the difference between the read RC files
and the ignored ones based on their canonical
paths, not on the textual value of the path.
This aids for proper reporting of ignored RC
files, while reporting them with a path familiar
to the user (e.g. paths the user passed with flags
rather than the potentially different canonical
version of the same path).
Also: respect $HOME on Windows when Bazel is
running inside of a test, to avoid picking up the
real RC file from the user's home directory. This
fixes //src/test/cpp:rc_file_test on Windows.
Fixes https://github.com/bazelbuild/bazel/issues/6138
Fixes https://github.com/bazelbuild/bazel/issues/6469
Closes #6910.
PiperOrigin-RevId: 225832065
diff --git a/src/main/cpp/option_processor-internal.h b/src/main/cpp/option_processor-internal.h
index b25db9c..e1b9e7d 100644
--- a/src/main/cpp/option_processor-internal.h
+++ b/src/main/cpp/option_processor-internal.h
@@ -26,7 +26,9 @@
namespace internal {
// Returns the deduped set of bazelrc paths (with respect to its canonical form)
-// preserving the original order. The paths that cannot be resolved are
+// preserving the original order.
+// All paths in the result were verified to exist (otherwise their canonical
+// form couldn't have been computed). The paths that cannot be resolved are
// omitted.
std::vector<std::string> DedupeBlazercPaths(
const std::vector<std::string>& paths);