From dab2520ed8d19c5070340452ba6e3f0ceace1403 Mon Sep 17 00:00:00 2001 From: Roman Kashitsyn Date: Tue, 23 Aug 2022 22:06:41 +0200 Subject: [PATCH] fix rustdoc compilation --- rust/private/rustc.bzl | 3 ++- rust/private/rustdoc.bzl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl index 1c6b9e7cb6..98037c19c9 100644 --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl @@ -713,6 +713,7 @@ def construct_arguments( force_all_deps_direct = False, force_link = False, stamp = False, + remap_path_prefix = True, use_json_output = False, build_metadata = False, force_depend_on_objects = False): @@ -877,7 +878,7 @@ def construct_arguments( rustc_flags.add("--codegen=debuginfo=" + compilation_mode.debug_info) # For determinism to help with build distribution and such - if hasattr(ctx.attr, "_source_path_prefix"): + if remap_path_prefix and hasattr(ctx.attr, "_source_path_prefix"): rustc_flags.add("--remap-path-prefix=${{pwd}}={}".format(ctx.attr._source_path_prefix[SourcePathPrefixInfo].source_path_prefix)) if emit: diff --git a/rust/private/rustdoc.bzl b/rust/private/rustdoc.bzl index ba3a12cec7..b9699f0c29 100644 --- a/rust/private/rustdoc.bzl +++ b/rust/private/rustdoc.bzl @@ -120,7 +120,7 @@ def rustdoc_compile_action( build_env_files = build_env_files, build_flags_files = build_flags_files, emit = [], - remap_path_prefix = None, + remap_path_prefix = False, force_link = True, force_depend_on_objects = is_test, )