Skip to content

Commit b397d8d

Browse files
kaloianmEvergreen Agent
authored andcommitted
Revert "SERVER-50376 Ninja should rebuild on compiler and tool changes"
This reverts commit 58fd67f.
1 parent 36618db commit b397d8d

File tree

3 files changed

+11
-33
lines changed

3 files changed

+11
-33
lines changed

SConstruct

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,15 +4100,9 @@ if get_option('ninja') != 'disabled':
41004100
)
41014101

41024102
def get_idlc_command(env, node, action, targets, sources, executor=None):
4103-
if get_option('build-tools') == 'next' or get_option('ninja') == 'next':
4104-
_, variables, _ = env.NinjaGetGenericShellCommand(node, action, targets, sources, executor=executor)
4105-
else:
4106-
_, variables = env.NinjaGetShellCommand(node, action, targets, sources, executor=executor)
4103+
_, variables = env.NinjaGetShellCommand(node, action, targets, sources, executor=executor)
41074104
variables["msvc_deps_prefix"] = "import file:"
4108-
if get_option('build-tools') == 'next' or get_option('ninja') == 'next':
4109-
return "IDLC", variables, env.subst(env['IDLC']).split()
4110-
else:
4111-
return "IDLC", variables
4105+
return "IDLC", variables
41124106

41134107
env.NinjaRuleMapping("$IDLCCOM", get_idlc_command)
41144108
env.NinjaRuleMapping(env["IDLCCOM"], get_idlc_command)

site_scons/site_tools/next/icecream.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def generate(env):
283283
)
284284
))
285285

286-
# We can't allow these to interact with the cache because the
286+
# We can't allow these to interact with the cache beacuse the
287287
# second action produces a file unknown to SCons. If caching were
288288
# permitted, the other two files could be retrieved from cache but
289289
# the file produced by the second action could not (and would not)
@@ -368,14 +368,6 @@ def icecc_version_string_generator(source, target, env, for_signature):
368368
# This dependency is necessary so that we build into this
369369
# string before we create the file.
370370
icecc_version_string_value,
371-
372-
# TODO: SERVER-50587 We need to make explicit depends here because of NINJA_SKIP. Any
373-
# dependencies in the nodes created in setupEnv with NINJA_SKIP would have
374-
# that dependency chain hidden from ninja, so they won't be rebuilt unless
375-
# added as dependencies here on this node that has NINJA_SKIP=False.
376-
'$CC',
377-
'$CXX',
378-
icecc_version_file,
379371
],
380372
)
381373

site_scons/site_tools/next/ninja.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

11461138
def 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

Comments
 (0)