Bug 1319227 - Support ObjdirFiles in tup; r=chmanchester
authorMike Shal <mshal@mozilla.com>
Tue, 06 Dec 2016 19:39:01 -0500
changeset 325364 2c698b01dfe8a2639cb825fdb138baa7fe44c113
parent 325363 6b3b26d63719ceeb45c0219f6fb1eb58af3b49d3
child 325365 d6ea2ff84db75b21a18e97267e1acbc8ed11ebcc
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerschmanchester
bugs1319227
milestone53.0a1
Bug 1319227 - Support ObjdirFiles in tup; r=chmanchester MozReview-Commit-ID: 5AXDZUzlg4t
python/mozbuild/mozbuild/backend/tup.py
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -15,17 +15,17 @@ from mozbuild.shellutil import quote as 
 from .common import CommonBackend
 from ..frontend.data import (
     ContextDerived,
     Defines,
     FinalTargetFiles,
     FinalTargetPreprocessedFiles,
     GeneratedFile,
     HostDefines,
-    ObjdirPreprocessedFiles,
+    ObjdirFiles,
 )
 from ..util import (
     FileAvoidWrite,
 )
 from ..frontend.context import (
     AbsolutePath,
     RenamedSourcePath,
     ObjDirPath,
@@ -182,18 +182,16 @@ class TupOnly(CommonBackend, PartialBack
         elif isinstance(obj, Defines):
             self._process_defines(backend_file, obj)
         elif isinstance(obj, HostDefines):
             self._process_defines(backend_file, obj, host=True)
         elif isinstance(obj, FinalTargetFiles):
             self._process_final_target_files(obj)
         elif isinstance(obj, FinalTargetPreprocessedFiles):
             self._process_final_target_pp_files(obj, backend_file)
-        elif isinstance(obj, ObjdirPreprocessedFiles):
-            self._process_final_target_pp_files(obj, backend_file)
 
         return True
 
     def consume_finished(self):
         CommonBackend.consume_finished(self)
 
         for objdir, backend_file in sorted(self._backend_files.items()):
             for obj in backend_file.delayed_generated_files:
@@ -263,34 +261,32 @@ class TupOnly(CommonBackend, PartialBack
         if defines:
             if host:
                 backend_file.host_defines = defines
             else:
                 backend_file.defines = defines
 
     def _process_final_target_files(self, obj):
         target = obj.install_target
-        path = mozpath.basedir(target, (
-            'dist/bin',
-            'dist/xpi-stage',
-            '_tests',
-            'dist/include',
-            'dist/branding',
-            'dist/sdk',
-        ))
-        if not path:
-            raise Exception("Cannot install to " + target)
-
-        reltarget = mozpath.relpath(target, path)
+        if not isinstance(obj, ObjdirFiles):
+            path = mozpath.basedir(target, (
+                'dist/bin',
+                'dist/xpi-stage',
+                '_tests',
+                'dist/include',
+                'dist/branding',
+                'dist/sdk',
+            ))
+            if not path:
+                raise Exception("Cannot install to " + target)
 
         for path, files in obj.files.walk():
             backend_file = self._get_backend_file(mozpath.join(target, path))
             for f in files:
                 assert not isinstance(f, RenamedSourcePath)
-                dest = mozpath.join(reltarget, path, f.target_basename)
                 if not isinstance(f, ObjDirPath):
                     if '*' in f:
                         if f.startswith('/') or isinstance(f, AbsolutePath):
                             basepath, wild = os.path.split(f.full_path)
                             if '*' in basepath:
                                 raise Exception("Wildcards are only supported in the filename part of "
                                                 "srcdir-relative or absolute paths.")