Bug 991983 - Emit absolute paths for UnifiedSources. r=gps

This helps upcoming changes, and relieves backends from path resolution.
This has the side effect of chaning the order of some unified sources,
which consequently breaks nsTextFormatter because it declares snprintf
methods after nsStringAPI #defines it.
This commit is contained in:
Mike Hommey 2015-05-14 15:40:21 +09:00
parent fc645ba14f
commit 188ce081ec
3 changed files with 11 additions and 2 deletions

View File

@ -779,6 +779,9 @@ class TreeMetadataEmitter(LoggingMixin):
# Now sort the files to let groupby work. # Now sort the files to let groupby work.
sorted_files = sorted(context[variable], key=canonical_suffix_for_file) sorted_files = sorted(context[variable], key=canonical_suffix_for_file)
for canonical_suffix, files in itertools.groupby(sorted_files, canonical_suffix_for_file): for canonical_suffix, files in itertools.groupby(sorted_files, canonical_suffix_for_file):
if variable.startswith('UNIFIED_'):
files = [mozpath.normpath(mozpath.join(context.srcdir, f))
for f in files]
arglist = [context, list(files), canonical_suffix] arglist = [context, list(files), canonical_suffix]
if variable.startswith('UNIFIED_') and 'FILES_PER_UNIFIED_FILE' in context: if variable.startswith('UNIFIED_') and 'FILES_PER_UNIFIED_FILE' in context:
arglist.append(context['FILES_PER_UNIFIED_FILE']) arglist.append(context['FILES_PER_UNIFIED_FILE'])

View File

@ -818,7 +818,9 @@ class TestEmitterBasic(unittest.TestCase):
} }
for suffix, files in expected.items(): for suffix, files in expected.items():
sources = suffix_map[suffix] sources = suffix_map[suffix]
self.assertEqual(sources.files, files) self.assertEqual(
sources.files,
[mozpath.join(reader.config.topsrcdir, f) for f in files])
self.assertTrue(sources.have_unified_mapping) self.assertTrue(sources.have_unified_mapping)
def test_unified_sources_non_unified(self): def test_unified_sources_non_unified(self):
@ -840,7 +842,9 @@ class TestEmitterBasic(unittest.TestCase):
} }
for suffix, files in expected.items(): for suffix, files in expected.items():
sources = suffix_map[suffix] sources = suffix_map[suffix]
self.assertEqual(sources.files, files) self.assertEqual(
sources.files,
[mozpath.join(reader.config.topsrcdir, f) for f in files])
self.assertFalse(sources.have_unified_mapping) self.assertFalse(sources.have_unified_mapping)
def test_dist_files(self): def test_dist_files(self):

View File

@ -1308,3 +1308,5 @@ ParseString(const nsACString& aSource, char aDelimiter,
return true; return true;
} }
#undef snprintf