Merge mozilla-central to mozilla-inbound

This commit is contained in:
Dorel Luca
2018-06-20 01:06:23 +03:00
49 changed files with 697 additions and 213 deletions

View File

@@ -633,7 +633,7 @@ class RecursiveMakeBackend(CommonBackend):
self._no_skip['syms'].add(backend_file.relobjdir)
elif isinstance(obj, HostProgram):
self._process_host_program(obj.program, backend_file)
self._process_host_program(obj, backend_file)
self._process_linked_libraries(obj, backend_file)
elif isinstance(obj, SimpleProgram):
@@ -1106,7 +1106,8 @@ class RecursiveMakeBackend(CommonBackend):
backend_file.write('PROG_IS_C_ONLY_%s := 1\n' % obj.program)
def _process_host_program(self, program, backend_file):
backend_file.write('HOST_PROGRAM = %s\n' % program)
backend_file.write('HOST_PROGRAM = %s\n' %
self._pretty_path(program.output_path, backend_file))
def _process_rust_program_base(self, obj, backend_file,
target_variable,

View File

@@ -463,7 +463,12 @@ class TupBackend(CommonBackend):
def _gen_host_program(self, backend_file, prog):
_, _, _, extra_libs, _ = self._expand_libs(prog)
objs = prog.objs
outputs = [prog.program]
if isinstance(prog, HostSimpleProgram):
outputs = [prog.name]
else:
outputs = [mozpath.relpath(prog.output_path.full_path,
backend_file.objdir)]
host_libs = []
for lib in prog.linked_libraries:
if isinstance(lib, HostLibrary):

View File

@@ -512,6 +512,10 @@ class HostProgram(HostMixin, BaseProgram):
SUFFIX_VAR = 'HOST_BIN_SUFFIX'
KIND = 'host'
@property
def install_target(self):
return 'dist/host/bin'
class SimpleProgram(BaseProgram):
"""Context derived container object for each program in SIMPLE_PROGRAMS"""

View File

@@ -0,0 +1,5 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
FINAL_TARGET = 'final/target'
HostProgram('final-target')

View File

@@ -0,0 +1,4 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
HostProgram('dist-host-bin')

View File

@@ -0,0 +1,12 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
@template
def HostProgram(name):
HOST_PROGRAM = name
DIRS += [
'final-target',
'installed',
'not-installed',
]

View File

@@ -0,0 +1,5 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
DIST_INSTALL = False
HostProgram('not-installed')

View File

@@ -24,6 +24,7 @@ from mozbuild.frontend.data import (
GeneratedFile,
GeneratedSources,
HostDefines,
HostProgram,
HostRustLibrary,
HostRustProgram,
HostSources,
@@ -75,6 +76,7 @@ class TestEmitterBasic(unittest.TestCase):
substs = dict(
ENABLE_TESTS='1' if enable_tests else '',
BIN_SUFFIX='.prog',
HOST_BIN_SUFFIX='.hostprog',
OS_TARGET='WINNT',
COMPILE_ENVIRONMENT='1',
STL_FLAGS=['-I/path/to/topobjdir/dist/stl_wrappers'],
@@ -699,6 +701,18 @@ class TestEmitterBasic(unittest.TestCase):
'!not-installed.prog',
])
def test_host_program_paths(self):
"""The destination of a HOST_PROGRAM (almost always dist/host/bin)
should be accurately reflected in Program.output_path."""
reader = self.reader('host-program-paths')
objs = self.read_topsrcdir(reader)
prog_paths = [o.output_path for o in objs if isinstance(o, HostProgram)]
self.assertEqual(prog_paths, [
'!/dist/host/bin/final-target.hostprog',
'!/dist/host/bin/dist-host-bin.hostprog',
'!not-installed.hostprog',
])
def test_test_manifest_missing_manifest(self):
"""A missing manifest file should result in an error."""
reader = self.reader('test-manifest-missing-manifest')