diff --git a/toolchain/internal/configure.bzl b/toolchain/internal/configure.bzl index 16afd5f8..acc5135e 100644 --- a/toolchain/internal/configure.bzl +++ b/toolchain/internal/configure.bzl @@ -314,7 +314,7 @@ def _cc_toolchain_str( # visible via the "built_in_include_directories" attribute of CcToolchainInfo as well as to keep # them in sync with the directories included in the system module map generated for the stricter # "layering_check" feature. - toolchain_path_prefix = toolchain_info.llvm_dist_path_prefix + toolchain_path_prefix = "%workspace%/" + toolchain_info.llvm_dist_path_prefix llvm_version = toolchain_info.llvm_version major_llvm_version = int(llvm_version.split(".")[0]) target_system_name = { diff --git a/toolchain/internal/system_module_map.bzl b/toolchain/internal/system_module_map.bzl index 992952e4..92571fd9 100644 --- a/toolchain/internal/system_module_map.bzl +++ b/toolchain/internal/system_module_map.bzl @@ -37,6 +37,8 @@ def _system_module_map(ctx): for include_dir in ctx.attr.cxx_builtin_include_directories: if ctx.attr.sysroot_path and include_dir.startswith("%sysroot%"): include_dir = ctx.attr.sysroot_path + include_dir[len("%sysroot%"):] + if include_dir.startswith("%workspace%/"): + include_dir = include_dir.removeprefix("%workspace%/") include_dir = paths.normalize(include_dir).replace("//", "/") if include_dir.startswith("/"): absolute_path_dirs.append(include_dir)