Bug 1269787 - Use _pretty_path instead of full path for inputs; r?glandium
We use _pretty_path when specifying the targets of generated files, so
we need to use _pretty_path for the inputs as well. Otherwise make won't
know that they refer to the same file, and result in "No rule to make
target" errors.
MozReview-Commit-ID: JTdLFbkX1J0
--- a/layout/style/test/gen-css-properties.py
+++ b/layout/style/test/gen-css-properties.py
@@ -1,17 +1,19 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
+import os
import sys
import subprocess
def main(output, css_properties, exe):
- data = subprocess.check_output([exe])
+ run_exe = exe if os.path.isabs(exe) else './%s' % exe
+ data = subprocess.check_output([run_exe])
with open(css_properties) as f:
data += f.read()
output.write(data)
if __name__ == '__main__':
main(sys.stdout, *sys.argv[1:])
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -526,17 +526,17 @@ class RecursiveMakeBackend(CommonBackend
backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
if obj.script:
backend_file.write("""{output}: {script}{inputs}{backend}
\t$(REPORT_BUILD)
\t$(call py_action,file_generate,{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs}{flags})
""".format(output=first_output,
dep_file=dep_file,
- inputs=' ' + ' '.join([f.full_path for f in obj.inputs]) if obj.inputs else '',
+ inputs=' ' + ' '.join([self._pretty_path(f, backend_file) for f in obj.inputs]) if obj.inputs else '',
flags=' ' + ' '.join(obj.flags) if obj.flags else '',
backend=' backend.mk' if obj.flags else '',
script=obj.script,
method=obj.method))
elif isinstance(obj, JARManifest):
self._no_skip['libs'].add(backend_file.relobjdir)
backend_file.write('JAR_MANIFEST := %s\n' % obj.path.full_path)
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -398,19 +398,19 @@ class TestRecursiveMakeBackend(BackendTe
'EXTRA_MDDEPEND_FILES += bar.c.pp',
'bar.c: %s/generate-bar.py' % env.topsrcdir,
'$(REPORT_BUILD)',
'$(call py_action,file_generate,%s/generate-bar.py baz bar.c $(MDDEPDIR)/bar.c.pp)' % env.topsrcdir,
'',
'export:: foo.c',
'GARBAGE += foo.c',
'EXTRA_MDDEPEND_FILES += foo.c.pp',
- 'foo.c: %s/generate-foo.py %s/foo-data' % (env.topsrcdir, env.topsrcdir),
+ 'foo.c: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
'$(REPORT_BUILD)',
- '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp %s/foo-data)' % (env.topsrcdir, env.topsrcdir),
+ '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(srcdir)/foo-data)' % (env.topsrcdir),
'',
'export:: quux.c',
'GARBAGE += quux.c',
'EXTRA_MDDEPEND_FILES += quux.c.pp',
]
self.maxDiff = None
self.assertEqual(lines, expected)