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
This commit is contained in:
Mike Shal 2016-04-29 13:43:25 -04:00
Родитель 4bb82a657d
Коммит 16febf4398
3 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -4,11 +4,15 @@
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)

Просмотреть файл

@ -531,7 +531,7 @@ class RecursiveMakeBackend(CommonBackend):
""".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,

Просмотреть файл

@ -403,9 +403,9 @@ class TestRecursiveMakeBackend(BackendTester):
'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',