@@ -996,7 +996,7 @@ def get_response_file_command(env, node, action, targets, sources, executor=None
996996 variables [rule ] = cmd
997997 if use_command_env :
998998 variables ["env" ] = get_command_env (env )
999- return rule , variables , [ tool_command ]
999+ return rule , variables
10001000
10011001 return get_response_file_command
10021002
@@ -1026,21 +1026,13 @@ def generate_command(env, node, action, targets, sources, executor=None):
10261026 return cmd .replace ("$" , "$$" )
10271027
10281028
1029- def get_generic_shell_command (env , node , action , targets , sources , executor = None ):
1029+ def get_shell_command (env , node , action , targets , sources , executor = None ):
10301030 return (
10311031 "CMD" ,
10321032 {
10331033 "cmd" : generate_command (env , node , action , targets , sources , executor = None ),
10341034 "env" : get_command_env (env ),
10351035 },
1036- # Since this function is a rule mapping provider, it must return a list of dependencies,
1037- # and usually this would be the path to a tool, such as a compiler, used for this rule.
1038- # However this function is to generic to be able to reliably extract such deps
1039- # from the command, so we return a placeholder empty list. It should be noted that
1040- # generally this function will not be used soley and is more like a template to generate
1041- # the basics for a custom provider which may have more specific options for a provier
1042- # function for a custom NinjaRuleMapping.
1043- []
10441036 )
10451037
10461038
@@ -1076,12 +1068,12 @@ def get_command(env, node, action): # pylint: disable=too-many-branches
10761068 if not comstr :
10771069 return None
10781070
1079- provider = __NINJA_RULE_MAPPING .get (comstr , get_generic_shell_command )
1080- rule , variables , provider_deps = provider (sub_env , node , action , tlist , slist , executor = executor )
1071+ provider = __NINJA_RULE_MAPPING .get (comstr , get_shell_command )
1072+ rule , variables = provider (sub_env , node , action , tlist , slist , executor = executor )
10811073
10821074 # Get the dependencies for all targets
10831075 implicit = list ({dep for tgt in tlist for dep in get_dependencies (tgt )})
1084- implicit . extend ( provider_deps )
1076+
10851077 ninja_build = {
10861078 "order_only" : get_order_only (node ),
10871079 "outputs" : get_outputs (node ),
@@ -1144,7 +1136,7 @@ def register_custom_handler(env, name, handler):
11441136
11451137
11461138def register_custom_rule_mapping (env , pre_subst_string , rule ):
1147- """Register a function to call for a given rule ."""
1139+ """Register a custom handler for SCons function actions ."""
11481140 global __NINJA_RULE_MAPPING
11491141 __NINJA_RULE_MAPPING [pre_subst_string ] = rule
11501142
@@ -1157,7 +1149,7 @@ def register_custom_rule(env, rule, command, description="", deps=None, pool=Non
11571149 }
11581150
11591151 if use_depfile :
1160- rule_obj ["depfile" ] = os .path .join (get_path (env ['NINJA_BUILDDIR' ]), '$out.depfile' )
1152+ rule_obj ["depfile" ] = os .path .join (get_path (env ['NINJA_BUILDDIR' ]),'$out.depfile' )
11611153
11621154 if deps is not None :
11631155 rule_obj ["deps" ] = deps
@@ -1352,7 +1344,7 @@ def ninja_generate_deps(env):
13521344
13531345 # Provide a way for custom rule authors to easily access command
13541346 # generation.
1355- env .AddMethod (get_generic_shell_command , "NinjaGetGenericShellCommand " )
1347+ env .AddMethod (get_shell_command , "NinjaGetShellCommand " )
13561348 env .AddMethod (gen_get_response_file_command , "NinjaGenResponseFileProvider" )
13571349
13581350 # Provides a way for users to handle custom FunctionActions they
0 commit comments