Bug 1269787 - Use _pretty_path instead of full path for inputs; r?glandium draft
authorMike Shal <mshal@mozilla.com>
Fri, 29 Apr 2016 13:43:25 -0400
changeset 362962 566f5c6fa2c9ae13addbf90b13d8f15a02b410f7
parent 362961 26d457bff416011e7f349c8158b580e64a1eb976
child 362963 edb37110a26f1f824665eadc75f4561b40a7da74
push id17070
push userbmo:mshal@mozilla.com
push dateTue, 03 May 2016 16:57:06 +0000
reviewersglandium
bugs1269787
milestone49.0a1
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
layout/style/test/gen-css-properties.py
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
--- 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)