Skip to content

Commit

Permalink
tools: fix Python 3 issues in gyp/generator/make.py
Browse files Browse the repository at this point in the history
PR-URL: #29214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
cclauss authored and BridgeAR committed Sep 3, 2019
1 parent aeafb91 commit eceebd3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/gyp/pylib/gyp/generator/make.py
Expand Up @@ -929,7 +929,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs,
'%s%s' '%s%s'
% (name, cd_action, command)) % (name, cd_action, command))
self.WriteLn() self.WriteLn()
outputs = map(self.Absolutify, outputs) outputs = [self.Absolutify(o) for o in outputs]
# The makefile rules are all relative to the top dir, but the gyp actions # The makefile rules are all relative to the top dir, but the gyp actions
# are defined relative to their containing dir. This replaces the obj # are defined relative to their containing dir. This replaces the obj
# variable for the action rule with an absolute version so that the output # variable for the action rule with an absolute version so that the output
Expand Down Expand Up @@ -1019,7 +1019,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs]
inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs]


outputs = map(self.Absolutify, outputs) outputs = [self.Absolutify(o) for o in outputs]
all_outputs += outputs all_outputs += outputs
# Only write the 'obj' and 'builddir' rules for the "primary" output # Only write the 'obj' and 'builddir' rules for the "primary" output
# (:1); it's superfluous for the "extra outputs", and this avoids # (:1); it's superfluous for the "extra outputs", and this avoids
Expand Down Expand Up @@ -1725,8 +1725,8 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
output is just a name to run the rule output is just a name to run the rule
command: (optional) command name to generate unambiguous labels command: (optional) command name to generate unambiguous labels
""" """
outputs = map(QuoteSpaces, outputs) outputs = [QuoteSpaces(o) for o in outputs]
inputs = map(QuoteSpaces, inputs) inputs = [QuoteSpaces(i) for i in inputs]


if comment: if comment:
self.WriteLn('# ' + comment) self.WriteLn('# ' + comment)
Expand Down Expand Up @@ -1755,7 +1755,7 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
# - The multi-output rule will have an do-nothing recipe. # - The multi-output rule will have an do-nothing recipe.


# Hash the target name to avoid generating overlong filenames. # Hash the target name to avoid generating overlong filenames.
cmddigest = hashlib.sha1(command if command else self.target).hexdigest() cmddigest = hashlib.sha1((command or self.target).encode("utf-8")).hexdigest()
intermediate = "%s.intermediate" % (cmddigest) intermediate = "%s.intermediate" % (cmddigest)
self.WriteLn('%s: %s' % (' '.join(outputs), intermediate)) self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))
self.WriteLn('\t%s' % '@:') self.WriteLn('\t%s' % '@:')
Expand Down

0 comments on commit eceebd3

Please sign in to comment.