Backed out changeset 8645b620dad4 (bug 1455504) on request of aklotz.
authorarthur.iakab <aiakab@mozilla.com>
Thu, 26 Apr 2018 00:57:35 +0300
changeset 471663 674b3e7dd3dd29c45444df15fba1953346bb27cb
parent 471662 594b7c98700a7c29bd003c37cb839f4f6a231dbe
child 471664 7f1909255cc9b55bae03e7a2ee947af96a066a1c
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1455504
milestone61.0a1
backs out8645b620dad4d104616775593b1a368d16c76721
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 8645b620dad4 (bug 1455504) on request of aklotz.
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -1289,19 +1289,18 @@ class RecursiveMakeBackend(CommonBackend
     def _process_host_library(self, libdef, backend_file):
         backend_file.write('HOST_LIBRARY_NAME = %s\n' % libdef.basename)
 
     def _build_target_for_obj(self, obj):
         return '%s/%s' % (mozpath.relpath(obj.objdir,
             self.environment.topobjdir), obj.KIND)
 
     def _process_linked_libraries(self, obj, backend_file):
-        def pretty_relpath(lib, name):
-            return os.path.normpath(mozpath.join(mozpath.relpath(lib.objdir, obj.objdir),
-                                                 name))
+        def pretty_relpath(lib):
+            return '$(DEPTH)/%s' % mozpath.relpath(lib.objdir, topobjdir)
 
         topobjdir = mozpath.normsep(obj.topobjdir)
         # This will create the node even if there aren't any linked libraries.
         build_target = self._build_target_for_obj(obj)
         self._compile_graph[build_target]
 
         objs, no_pgo_objs, shared_libs, os_libs, static_libs = self._expand_libs(obj)
 
@@ -1362,34 +1361,34 @@ class RecursiveMakeBackend(CommonBackend
                                                              pgo_list_file_path)
                     backend_file.write_once('%s_PGO_OBJS := %s\n' %
                                             (obj.name, pgo_list_file_ref))
                     backend_file.write_once('%s: %s\n' % (obj_target,
                                                           pgo_list_file_path))
                 write_obj_deps(obj_target, objs_ref, pgo_objs_ref)
 
         for lib in shared_libs:
-            backend_file.write_once('SHARED_LIBS += %s\n' %
-                                    pretty_relpath(lib, lib.import_name))
+            backend_file.write_once('SHARED_LIBS += %s/%s\n' %
+                                    (pretty_relpath(lib), lib.import_name))
         for lib in static_libs:
-            backend_file.write_once('STATIC_LIBS += %s\n' %
-                                    pretty_relpath(lib, lib.import_name))
+            backend_file.write_once('STATIC_LIBS += %s/%s\n' %
+                                    (pretty_relpath(lib), lib.import_name))
         for lib in os_libs:
             if obj.KIND == 'target':
                 backend_file.write_once('OS_LIBS += %s\n' % lib)
             else:
                 backend_file.write_once('HOST_EXTRA_LIBS += %s\n' % lib)
 
         for lib in obj.linked_libraries:
             if not isinstance(lib, ExternalLibrary):
                 self._compile_graph[build_target].add(
                     self._build_target_for_obj(lib))
             if isinstance(lib, (HostLibrary, HostRustLibrary)):
-                backend_file.write_once('HOST_LIBS += %s\n' %
-                                        pretty_relpath(lib, lib.import_name))
+                backend_file.write_once('HOST_LIBS += %s/%s\n' %
+                                        (pretty_relpath(lib), lib.import_name))
 
         # We have to link any Rust libraries after all intermediate static
         # libraries have been listed to ensure that the Rust libraries are
         # searched after the C/C++ objects that might reference Rust symbols.
         if isinstance(obj, SharedLibrary):
             self._process_rust_libraries(obj, backend_file, pretty_relpath)
 
         # Process library-based defines
@@ -1404,18 +1403,18 @@ class RecursiveMakeBackend(CommonBackend
             return
 
         # We should have already checked this in Linkable.link_library.
         assert len(direct_linked) == 1
 
         # TODO: see bug 1310063 for checking dependencies are set up correctly.
 
         direct_linked = direct_linked[0]
-        backend_file.write('RUST_STATIC_LIB_FOR_SHARED_LIB := %s\n' %
-                           pretty_relpath(direct_linked, direct_linked.import_name))
+        backend_file.write('RUST_STATIC_LIB_FOR_SHARED_LIB := %s/%s\n' %
+                           (pretty_relpath(direct_linked), direct_linked.import_name))
 
     def _process_final_target_files(self, obj, files, backend_file):
         target = obj.install_target
         path = mozpath.basedir(target, (
             'dist/bin',
             'dist/xpi-stage',
             '_tests',
             'dist/include',
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -1048,34 +1048,34 @@ class TestRecursiveMakeBackend(BackendTe
 
             for line in lines:
                 self.assertNotIn('LIB_IS_C_ONLY', line)
 
     def test_linkage(self):
         env = self._consume('linkage', RecursiveMakeBackend)
         expected_linkage = {
             'prog': {
-                'SHARED_LIBS': ['qux/qux.so',
-                                '../shared/baz.so'],
-                'STATIC_LIBS': ['../real/foo.a'],
+                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so',
+                                '$(DEPTH)/shared/baz.so'],
+                'STATIC_LIBS': ['$(DEPTH)/real/foo.a'],
                 'OS_LIBS': ['-lfoo', '-lbaz', '-lbar'],
             },
             'shared': {
                 'OS_LIBS': ['-lfoo'],
-                'SHARED_LIBS': ['../prog/qux/qux.so'],
+                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so'],
                 'STATIC_LIBS': [],
             },
             'static': {
-                'STATIC_LIBS': ['../real/foo.a'],
+                'STATIC_LIBS': ['$(DEPTH)/real/foo.a'],
                 'OS_LIBS': ['-lbar'],
-                'SHARED_LIBS': ['../prog/qux/qux.so'],
+                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so'],
             },
             'real': {
                 'STATIC_LIBS': [],
-                'SHARED_LIBS': ['../prog/qux/qux.so'],
+                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so'],
                 'OS_LIBS': ['-lbaz'],
             }
         }
         actual_linkage = {}
         for name in expected_linkage.keys():
             with open(os.path.join(env.topobjdir, name, 'backend.mk'), 'rb') as fh:
                 actual_linkage[name] = [line.rstrip() for line in fh.readlines()]
         for name in expected_linkage: