Bug 1233282 - Add generated FinalTargetFiles as optional_exists in install manifests. r=gps

Otherwise there's a possibility of race condition in some cases.
This commit is contained in:
Mike Hommey 2015-12-18 17:17:33 +09:00
parent b4711809b2
commit 94ca4440a6
2 changed files with 8 additions and 2 deletions

View File

@ -1304,10 +1304,12 @@ INSTALL_TARGETS += %(prefix)s
if path else target).replace('/', '_')
have_objdir_files = False
for f in files:
dest = mozpath.join(reltarget, path,
mozpath.basename(f.full_path))
if not isinstance(f, ObjDirPath):
dest = mozpath.join(reltarget, path, mozpath.basename(f))
install_manifest.add_symlink(f.full_path, dest)
else:
install_manifest.add_optional_exists(dest)
backend_file.write('%s_FILES += %s\n' % (
target_var, self._pretty_path(f, backend_file)))
have_objdir_files = True

View File

@ -401,11 +401,15 @@ class TestRecursiveMakeBackend(BackendTester):
# EXPORTS files should appear in the dist_include install manifest.
m = InstallManifest(path=mozpath.join(env.topobjdir,
'_build_manifests', 'install', 'dist_include'))
self.assertEqual(len(m), 4)
self.assertEqual(len(m), 8)
self.assertIn('foo.h', m)
self.assertIn('mozilla/mozilla1.h', m)
self.assertIn('mozilla/dom/dom1.h', m)
self.assertIn('gfx/gfx.h', m)
self.assertIn('bar.h', m)
self.assertIn('mozilla/mozilla2.h', m)
self.assertIn('mozilla/dom/dom2.h', m)
self.assertIn('mozilla/dom/dom3.h', m)
# EXPORTS files that are also GENERATED_FILES should be handled as
# INSTALL_TARGETS.
backend_path = mozpath.join(env.topobjdir, 'backend.mk')