Bug 1269787 - Use _pretty_path instead of full path for inputs; r=glandium
authorMike Shal <mshal@mozilla.com>
Fri, 29 Apr 2016 13:43:25 -0400
changeset 296328 436ce820c291a0e2f4491be4863b9fa204a172a8
parent 296327 5022b4e0ae892727ac232f3d87304750d6ba0112
child 296329 5c0ca5b6fd4133a9aa2cb66b2765209debb53d1d
push id30236
push usercbook@mozilla.com
push dateFri, 06 May 2016 12:19:04 +0000
treeherdermozilla-central@19a1743ceb2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1269787
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,21 @@
 # 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])
+    # moz.build passes in the exe name without any path, so to run it we need to
+    # prepend the './'
+    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)