@@ -266,6 +266,11 @@ def _cxx_python_extension_attrs():
266
266
})
267
267
return res
268
268
269
+ def _constraint_overrides_attr ():
270
+ return {
271
+ "constraint_overrides" : attrs .list (attrs .string (), default = []),
272
+ }
273
+
269
274
# Attrs common between python binary/test
270
275
def _python_executable_attrs ():
271
276
cxx_binary_attrs = {k : v for k , v in cxx_rules .cxx_binary .attrs .items ()}
@@ -279,14 +284,15 @@ def _python_executable_attrs():
279
284
if key not in python_executable_attrs
280
285
}
281
286
287
+ updated_attrs .update (_constraint_overrides_attr ())
288
+
282
289
# allow non-default value for the args below
283
290
updated_attrs .update ({
284
291
"anonymous_link_groups" : attrs .bool (default = False ),
285
292
"binary_linker_flags" : attrs .list (attrs .arg (anon_target_compatible = True ), default = []),
286
293
"bolt_flags" : attrs .list (attrs .arg (), default = []),
287
294
"bolt_profile" : attrs .option (attrs .source (), default = None ),
288
295
"compiler_flags" : attrs .list (attrs .arg (), default = []),
289
- "constraint_overrides" : attrs .list (attrs .string (), default = []),
290
296
"cxx_main" : attrs .source (default = "prelude//python/tools:embedded_main.cpp" ),
291
297
"distributed_thinlto_partial_split_dwarf" : attrs .bool (default = False ),
292
298
"enable_distributed_thinlto" : attrs .bool (default = False ),
@@ -356,7 +362,7 @@ def _python_test_attrs():
356
362
return test_attrs
357
363
358
364
def _cxx_binary_and_test_attrs ():
359
- return {
365
+ ret = {
360
366
"anonymous_link_groups" : attrs .bool (default = False ),
361
367
"auto_link_groups" : attrs .bool (default = False ),
362
368
# Linker flags that only apply to the executable link, used for link
@@ -365,7 +371,6 @@ def _cxx_binary_and_test_attrs():
365
371
"binary_linker_flags" : attrs .list (attrs .arg (anon_target_compatible = True ), default = []),
366
372
"bolt_flags" : attrs .list (attrs .arg (), default = []),
367
373
"bolt_profile" : attrs .option (attrs .source (), default = None ),
368
- "constraint_overrides" : attrs .list (attrs .string (), default = []),
369
374
# These flags will only be used to instrument a target
370
375
# when coverage for that target is enabled by a header
371
376
# selected for coverage either in the target or in one
@@ -385,6 +390,8 @@ def _cxx_binary_and_test_attrs():
385
390
"_cxx_hacks" : attrs .dep (default = "prelude//cxx/tools:cxx_hacks" ),
386
391
"_cxx_toolchain" : toolchains_common .cxx (),
387
392
}
393
+ ret .update (_constraint_overrides_attr ())
394
+ return ret
388
395
389
396
NativeLinkStrategy = ["separate" , "native" , "merged" ]
390
397
StripLibparStrategy = ["full" , "extract" , "none" ]
@@ -641,7 +648,7 @@ inlined_extra_attributes = {
641
648
"_unzip_tool" : attrs .default_only (attrs .exec_dep (providers = [RunInfo ], default = "prelude//zip_file/tools:unzip" )),
642
649
},
643
650
"rust_test" : {},
644
- "sh_test" : {} ,
651
+ "sh_test" : _constraint_overrides_attr () ,
645
652
"windows_resource" : {
646
653
"_cxx_toolchain" : toolchains_common .cxx (),
647
654
},
@@ -681,6 +688,7 @@ transitions = {
681
688
"go_test" : go_test_transition ,
682
689
"python_binary" : constraint_overrides_transition ,
683
690
"python_test" : constraint_overrides_transition ,
691
+ "sh_test" : constraint_overrides_transition ,
684
692
}
685
693
686
694
toolchain_rule_names = [
0 commit comments