diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index fa5b066d59ab..59cae1cad7ca 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -307,7 +307,7 @@ "moduleExtensions": { "//bazel/cc_toolchains:clang_configuration.bzl%clang_toolchain_extension": { "general": { - "bzlTransitiveDigest": "H3RsK0MbgutDMSlPWTwZq4Vk1U5sjDtgJ5MXQxg7GLU=", + "bzlTransitiveDigest": "zlzuUB95ZT/0gx6Xy5Ercb4YiRyDEn9PzsoEcN6q2gk=", "usagesDigest": "lTxkeAFhR0iBEa3dg5hWvtd2HFCr5zCJx/fl27A+IKA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, diff --git a/bazel/cc_toolchains/clang_configuration.bzl b/bazel/cc_toolchains/clang_configuration.bzl index 1c3d685d28b1..958899ddb607 100644 --- a/bazel/cc_toolchains/clang_configuration.bzl +++ b/bazel/cc_toolchains/clang_configuration.bzl @@ -83,7 +83,11 @@ def _compute_clang_resource_dir(repository_ctx, clang): ).stdout # The only line printed is this path. - return output.splitlines()[0] + dir_path = repository_ctx.path(output.splitlines()[0]) + + # Canonicalize the path to help ensure string matching succeeds + # even with clang installs returning a non-canonical path. + return str(dir_path.realpath) def _compute_mac_os_sysroot(repository_ctx): """Runs `xcrun` to extract the correct sysroot."""