From 1d5891d5a8231717bbc760671ccf75b8b0042b3d Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Mon, 9 Oct 2023 18:33:36 +0000 Subject: [PATCH] Remove create_crate_info_dict_callback --- rust/private/rust.bzl | 2 -- rust/private/rustc.bzl | 12 ++++-------- rust/private/utils.bzl | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/rust/private/rust.bzl b/rust/private/rust.bzl index f160d96fea..0f2b9a07f8 100644 --- a/rust/private/rust.bzl +++ b/rust/private/rust.bzl @@ -182,7 +182,6 @@ def _rust_library_common(ctx, crate_type): toolchain = toolchain, output_hash = output_hash, crate_type = crate_type, - create_crate_info_callback = create_crate_info_dict, rust_metadata = rust_metadata, output_file = rust_lib, ) @@ -206,7 +205,6 @@ def _rust_binary_impl(ctx): attr = ctx.attr, toolchain = toolchain, crate_type = ctx.attr.crate_type, - create_crate_info_callback = create_crate_info_dict, output_file = output, ) diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl index ff887dd89e..e45b2749b8 100644 --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl @@ -37,6 +37,7 @@ load( "is_exec_configuration", "make_static_lib_symlink", "relativize", + "create_crate_info_dict", ) BuildInfo = _BuildInfo @@ -1091,10 +1092,6 @@ def rustc_compile_action( force_all_deps_direct = False, rust_metadata = None, output_file = None, - # TODO: Remove create_crate_info_callback and skip_expanding_rustc_env attributes - # after all CrateInfo structs are constructed in rustc_compile_action - create_crate_info_callback = None, - crate_info_dict = None, skip_expanding_rustc_env = False): """Create and run a rustc compile action based on the current rule's attributes @@ -1121,14 +1118,13 @@ def rustc_compile_action( # removing CrateInfo construction before `rust_compile_action crate_info_dict = None - if create_crate_info_callback: - if ctx == None or toolchain == None or crate_type == None or crate_info != None: + if crate_info == None: + if ctx == None or toolchain == None or crate_type == None: fail("FAIL", ctx, toolchain, crate_type) - crate_info_dict = create_crate_info_callback( + crate_info_dict = create_crate_info_dict( ctx = ctx, toolchain = toolchain, crate_type = crate_type, - output_hash = output_hash, rust_metadata = rust_metadata, output_file = output_file, ) diff --git a/rust/private/utils.bzl b/rust/private/utils.bzl index 3c8d3784f6..f9358b5c87 100644 --- a/rust/private/utils.bzl +++ b/rust/private/utils.bzl @@ -850,7 +850,7 @@ def _symlink_for_non_generated_source(ctx, src_file, package_root): else: return src_file -def create_crate_info_dict(ctx, toolchain, crate_type, output_hash, rust_metadata, output_file): +def create_crate_info_dict(ctx, toolchain, crate_type, rust_metadata, output_file): """Creates a mutable dict() representing CrateInfo provider create_crate_info_dict is a *temporary* solution until create_crate_info is completely moved into