1313 "struct_omit_none" ,
1414 "to_artifact_location" ,
1515)
16- load (":cc_info.bzl" , "CC_USE_GET_TOOL_FOR_ACTION" )
16+ load (":cc_info.bzl" , "CC_USE_GET_TOOL_FOR_ACTION" , "CcInfoCompat" , "cc_common_compat" )
1717load (":code_generator_info.bzl" , "CODE_GENERATOR_RULE_NAMES" )
1818load (
1919 ":make_variables.bzl" ,
@@ -151,7 +151,7 @@ def _is_language_specific_proto_library(ctx, target, semantics):
151151 """Returns True if the target is a proto library with attached language-specific aspect."""
152152 if ctx .rule .kind != "proto_library" :
153153 return False
154- if CcInfo in target :
154+ if CcInfoCompat in target :
155155 return True
156156 return False
157157
@@ -328,16 +328,16 @@ def collect_cc_rule_context(ctx):
328328 )
329329
330330def collect_cc_compilation_context (ctx , target ):
331- """Collect information from the compilation context provided by the CcInfo provider."""
331+ """Collect information from the compilation context provided by the CcInfoCompat provider."""
332332
333- compilation_context = target [CcInfo ].compilation_context
333+ compilation_context = target [CcInfoCompat ].compilation_context
334334
335335 # merge current compilation context with context of implementation dependencies
336336 if ctx .rule .kind .startswith ("cc_" ) and hasattr (ctx .rule .attr , "implementation_deps" ):
337337 impl_deps = ctx .rule .attr .implementation_deps
338338
339- compilation_context = cc_common .merge_compilation_contexts (
340- compilation_contexts = [compilation_context ] + [it [CcInfo ].compilation_context for it in impl_deps ],
339+ compilation_context = cc_common_compat .merge_compilation_contexts (
340+ compilation_contexts = [compilation_context ] + [it [CcInfoCompat ].compilation_context for it in impl_deps ],
341341 )
342342
343343 # external_includes available since bazel 7
@@ -355,22 +355,22 @@ def collect_cc_compilation_context(ctx, target):
355355def collect_cpp_info (target , ctx , semantics , ide_info , ide_info_file , output_groups ):
356356 """Updates C++-specific output groups, returns false if not a C++ target."""
357357
358- if CcInfo not in target :
358+ if CcInfoCompat not in target :
359359 return False
360360
361361 # ignore cc_proto_library, attach to proto_library with aspect attached instead
362362 if ctx .rule .kind == "cc_proto_library" :
363363 return False
364364
365- # Go targets always provide CcInfo . Usually it's empty, but even if it isn't we don't handle it
365+ # Go targets always provide CcInfoCompat . Usually it's empty, but even if it isn't we don't handle it
366366 if ctx .rule .kind .startswith ("go_" ):
367367 return False
368368
369369 ide_info ["c_ide_info" ] = struct (
370370 rule_context = collect_cc_rule_context (ctx ),
371371 compilation_context = collect_cc_compilation_context (ctx , target ),
372372 )
373- resolve_files = target [CcInfo ].compilation_context .headers
373+ resolve_files = target [CcInfoCompat ].compilation_context .headers
374374
375375 # TODO(brendandouglas): target to cpp files only
376376 compile_files = target [OutputGroupInfo ].compilation_outputs if hasattr (target [OutputGroupInfo ], "compilation_outputs" ) else depset ([])
@@ -391,11 +391,11 @@ def collect_c_toolchain_info(target, ctx, semantics, ide_info, ide_info_file, ou
391391 # to generic platforms and toolchains.
392392 if ctx .rule .kind != "cc_toolchain" and ctx .rule .kind != "cc_toolchain_suite" and ctx .rule .kind != "cc_toolchain_alias" :
393393 return False
394- if cc_common .CcToolchainInfo not in target :
394+ if cc_common_compat .CcToolchainInfo not in target :
395395 return False
396396
397397 # cc toolchain to access compiler flags
398- cpp_toolchain = target [cc_common .CcToolchainInfo ]
398+ cpp_toolchain = target [cc_common_compat .CcToolchainInfo ]
399399
400400 # cpp fragment to access bazel options
401401 cpp_fragment = ctx .fragments .cpp
@@ -404,39 +404,39 @@ def collect_c_toolchain_info(target, ctx, semantics, ide_info, ide_info_file, ou
404404 cxxopts = cpp_fragment .cxxopts
405405 conlyopts = cpp_fragment .conlyopts
406406
407- feature_configuration = cc_common .configure_features (
407+ feature_configuration = cc_common_compat .configure_features (
408408 ctx = ctx ,
409409 cc_toolchain = cpp_toolchain ,
410410 requested_features = ctx .features ,
411411 unsupported_features = ctx .disabled_features + UNSUPPORTED_FEATURES ,
412412 )
413- c_variables = cc_common .create_compile_variables (
413+ c_variables = cc_common_compat .create_compile_variables (
414414 feature_configuration = feature_configuration ,
415415 cc_toolchain = cpp_toolchain ,
416416 user_compile_flags = copts + conlyopts ,
417417 )
418- cpp_variables = cc_common .create_compile_variables (
418+ cpp_variables = cc_common_compat .create_compile_variables (
419419 feature_configuration = feature_configuration ,
420420 cc_toolchain = cpp_toolchain ,
421421 user_compile_flags = copts + cxxopts ,
422422 )
423- c_options = cc_common .get_memory_inefficient_command_line (
423+ c_options = cc_common_compat .get_memory_inefficient_command_line (
424424 feature_configuration = feature_configuration ,
425425 action_name = ACTION_NAMES .c_compile ,
426426 variables = c_variables ,
427427 )
428- cpp_options = cc_common .get_memory_inefficient_command_line (
428+ cpp_options = cc_common_compat .get_memory_inefficient_command_line (
429429 feature_configuration = feature_configuration ,
430430 action_name = ACTION_NAMES .cpp_compile ,
431431 variables = cpp_variables ,
432432 )
433433
434434 if CC_USE_GET_TOOL_FOR_ACTION :
435- c_compiler = cc_common .get_tool_for_action (
435+ c_compiler = cc_common_compat .get_tool_for_action (
436436 feature_configuration = feature_configuration ,
437437 action_name = ACTION_NAMES .c_compile ,
438438 )
439- cpp_compiler = cc_common .get_tool_for_action (
439+ cpp_compiler = cc_common_compat .get_tool_for_action (
440440 feature_configuration = feature_configuration ,
441441 action_name = ACTION_NAMES .cpp_compile ,
442442 )
@@ -649,7 +649,7 @@ def make_intellij_info_aspect(aspect_impl, semantics, **kwargs):
649649 attr_aspects = attr_aspects ,
650650 attrs = attrs ,
651651 fragments = ["cpp" ],
652- required_aspect_providers = [[CcInfo ]] + semantics .extra_required_aspect_providers ,
652+ required_aspect_providers = [[CcInfoCompat ]] + semantics .extra_required_aspect_providers ,
653653 implementation = aspect_impl ,
654654 ** kwargs
655655 )
0 commit comments