Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: pylib/gyp/generator/make.py

Issue 2019133002: Hash intermediate file name to avoid ENAMETOOLONG (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Hash intermediate file name to avoid ENAMETOOLONG Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/make.py
diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py
index b7da768fb33f5a8e12ec6ffa4c20e2fc6c1434e8..0db84292047bab4aa4003e055567216e6c6f78ff 100644
--- a/pylib/gyp/generator/make.py
+++ b/pylib/gyp/generator/make.py
@@ -31,6 +31,8 @@ import gyp.xcode_emulation
from gyp.common import GetEnvironFallback
from gyp.common import GypError
+import hashlib
+
generator_default_variables = {
'EXECUTABLE_PREFIX': '',
'EXECUTABLE_SUFFIX': '',
@@ -1743,7 +1745,10 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
# actual command.
# - The intermediate recipe will 'touch' the intermediate file.
# - The multi-output rule will have an do-nothing recipe.
- intermediate = "%s.intermediate" % (command if command else self.target)
+
+ # Hash the target name to avoid generating overlong filenames.
+ cmddigest = hashlib.sha1(command if command else self.target).hexdigest()
+ intermediate = "%s.intermediate" % (cmddigest)
Nico 2016/10/13 13:25:11 (nit: no need for the parens here)
self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))
self.WriteLn('\t%s' % '@:');
self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698