deps: float gyp patch for long filenames · nodejs/node@5111e78

Original file line numberDiff line numberDiff line change

@@ -31,6 +31,8 @@

3131

from gyp.common import GetEnvironFallback

3232

from gyp.common import GypError

3333
34+

import hashlib

35+
3436

generator_default_variables = {

3537

'EXECUTABLE_PREFIX': '',

3638

'EXECUTABLE_SUFFIX': '',

@@ -1743,7 +1745,10 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,

17431745

# actual command.

17441746

# - The intermediate recipe will 'touch' the intermediate file.

17451747

# - The multi-output rule will have an do-nothing recipe.

1746-

intermediate = "%s.intermediate" % (command if command else self.target)

1748+
1749+

# Hash the target name to avoid generating overlong filenames.

1750+

cmddigest = hashlib.sha1(command if command else self.target).hexdigest()

1751+

intermediate = "%s.intermediate" % cmddigest

17471752

self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))

17481753

self.WriteLn('\t%s' % '@:');

17491754

self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate))