1"""Test transitions to test extra_exec_rustc_flags.""" 2 3def _extra_exec_rustc_flags_transition_impl(_settings, attr): 4 return { 5 "//:extra_exec_rustc_flag": attr.extra_exec_rustc_flag, 6 "//:extra_exec_rustc_flags": attr.extra_exec_rustc_flags, 7 } 8 9_extra_exec_rustc_flags_transition = transition( 10 implementation = _extra_exec_rustc_flags_transition_impl, 11 inputs = [], 12 outputs = ["//:extra_exec_rustc_flags", "//:extra_exec_rustc_flag"], 13) 14 15def _with_extra_exec_rustc_flags_cfg_impl(ctx): 16 return [DefaultInfo(files = depset(ctx.files.srcs))] 17 18with_extra_exec_rustc_flags_cfg = rule( 19 implementation = _with_extra_exec_rustc_flags_cfg_impl, 20 attrs = { 21 "extra_exec_rustc_flag": attr.string_list( 22 mandatory = True, 23 ), 24 "extra_exec_rustc_flags": attr.string_list( 25 mandatory = True, 26 ), 27 "srcs": attr.label_list( 28 allow_files = True, 29 cfg = _extra_exec_rustc_flags_transition, 30 ), 31 "_allowlist_function_transition": attr.label( 32 default = Label("//tools/allowlists/function_transition_allowlist"), 33 ), 34 }, 35) 36 37def _with_exec_cfg_impl(ctx): 38 return [DefaultInfo(files = depset(ctx.files.srcs))] 39 40with_exec_cfg = rule( 41 implementation = _with_exec_cfg_impl, 42 attrs = { 43 "srcs": attr.label_list( 44 allow_files = True, 45 cfg = "exec", 46 ), 47 }, 48) 49