Bug 1319227 - Support ObjdirFiles in tup; r?chmanchester draft
authorMike Shal <mshal@mozilla.com>
Tue, 06 Dec 2016 19:39:01 -0500
changeset 447670 cd0bc6f21c5f4ad68d14a3ae8e2e81d708c649b3
parent 447669 972196e7b3be4a7cdeb5c4629f7ca85f5eb5b313
child 539079 4bf1e9cd530d9f8780ebc5f4691a0e0637769bf5
push id38114
push userbmo:mshal@mozilla.com
push dateWed, 07 Dec 2016 03:17:51 +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.")