Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1333826 - Remove SDK_FILES, SDK_LIBRARY, and related is_sdk suppo…
…rt in the build goop, r=mshal

MozReview-Commit-ID: 52vPyDXdFte

--HG--
extra : rebase_source : c3217730bb70eb7319152dd07536b12f49d6a597
  • Loading branch information
bsmedberg committed Jan 30, 2017
1 parent 657dd44 commit ca77995
Show file tree
Hide file tree
Showing 30 changed files with 7 additions and 170 deletions.
3 changes: 0 additions & 3 deletions build/docs/defining-binaries.rst
Expand Up @@ -297,9 +297,6 @@ needs to be prefixed with ``static:`` in ``USE_LIBS``
Miscellaneous
=============

The ``SDK_LIBRARY`` boolean variable defines whether the library in the current
directory is going to be installed in the SDK.

The ``SONAME`` variable declares a "shared object name" for the library. It
defaults to the ``Library`` name or the ``SHARED_LIBRARY_NAME`` if set. When
linking to a library with a ``SONAME``, the resulting library or program will
Expand Down
4 changes: 0 additions & 4 deletions build/unix/moz.build
Expand Up @@ -13,10 +13,6 @@ if CONFIG['USE_ELF_HACK']:
if CONFIG['LLVM_SYMBOLIZER']:
FINAL_TARGET_FILES += ['/' + CONFIG['LLVM_SYMBOLIZER']]

SDK_FILES.bin += [
'run-mozilla.sh',
]

FINAL_TARGET_FILES += [
'run-mozilla.sh',
]
17 changes: 2 additions & 15 deletions config/rules.mk
Expand Up @@ -116,8 +116,8 @@ else
LIBRARY := $(REAL_LIBRARY).$(LIBS_DESC_SUFFIX)
endif
else
# Only build actual library if it is installed in DIST/lib or SDK
ifeq (,$(SDK_LIBRARY)$(DIST_INSTALL)$(NO_EXPAND_LIBS))
# Only build actual library if it is installed in DIST/lib
ifeq (,$(DIST_INSTALL)$(NO_EXPAND_LIBS))
LIBRARY := $(REAL_LIBRARY).$(LIBS_DESC_SUFFIX)
else
ifdef NO_EXPAND_LIBS
Expand Down Expand Up @@ -249,7 +249,6 @@ SIMPLE_PROGRAMS :=
HOST_LIBRARY :=
HOST_PROGRAM :=
HOST_SIMPLE_PROGRAMS :=
SDK_LIBRARY :=
endif

ALL_TRASH = \
Expand Down Expand Up @@ -1198,18 +1197,6 @@ ifneq (,$(DIST_SUBDIR)$(XPI_NAME))
PREF_DIR = defaults/preferences
endif

################################################################################
# SDK

ifneq (,$(SDK_LIBRARY))
ifndef NO_DIST_INSTALL
SDK_LIBRARY_FILES := $(SDK_LIBRARY)
SDK_LIBRARY_DEST := $(SDK_LIB_DIR)
SDK_LIBRARY_TARGET := target
INSTALL_TARGETS += SDK_LIBRARY
endif
endif # SDK_LIBRARY

################################################################################
# CHROME PACKAGING

Expand Down
2 changes: 0 additions & 2 deletions intl/unicharutil/util/moz.build
Expand Up @@ -29,8 +29,6 @@ Library('unicharutil_external_s')

FORCE_STATIC_LIB = True

SDK_LIBRARY = True

USE_STATIC_LIBS = True

if CONFIG['_MSC_VER']:
Expand Down
1 change: 0 additions & 1 deletion js/src/moz.build
Expand Up @@ -649,7 +649,6 @@ jsautokw.inputs += [
if CONFIG['JS_SHARED_LIBRARY']:
GeckoSharedLibrary('js', linkage=None)
SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME']
SDK_LIBRARY = True
else:
Library('js')

Expand Down
5 changes: 0 additions & 5 deletions js/xpconnect/shell/moz.build
Expand Up @@ -6,11 +6,6 @@

GeckoProgram('xpcshell', linkage='dependent')

if CONFIG['COMPILE_ENVIRONMENT']:
SDK_FILES.bin += [
'!xpcshell%s' % CONFIG['BIN_SUFFIX'],
]

SOURCES += [
'xpcshell.cpp',
]
Expand Down
1 change: 0 additions & 1 deletion memory/build/moz.build
Expand Up @@ -48,7 +48,6 @@ if CONFIG['OS_TARGET'] == 'Darwin' and (CONFIG['MOZ_REPLACE_MALLOC'] or
Library('memory')

if CONFIG['MOZ_GLUE_IN_PROGRAM']:
SDK_LIBRARY = True
DIST_INSTALL = True

# Keep jemalloc separated when mozglue is statically linked
Expand Down
1 change: 0 additions & 1 deletion memory/jemalloc/moz.build
Expand Up @@ -55,7 +55,6 @@ else:
FINAL_LIBRARY = 'replace_jemalloc'

if CONFIG['MOZ_GLUE_IN_PROGRAM']:
SDK_LIBRARY = True
DIST_INSTALL = True

if CONFIG['_MSC_VER']:
Expand Down
2 changes: 0 additions & 2 deletions mozglue/build/moz.build
Expand Up @@ -11,8 +11,6 @@ if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
else:
Library('mozglue')

SDK_LIBRARY = True

if CONFIG['OS_TARGET'] == 'Android':
SOURCES += [
'BionicGlue.cpp',
Expand Down
8 changes: 0 additions & 8 deletions python/mozbuild/mozbuild/backend/recursivemake.py
Expand Up @@ -125,8 +125,6 @@
b'PREF_JS_EXPORTS',
b'PROGRAM',
b'RESOURCE_FILES',
b'SDK_HEADERS',
b'SDK_LIBRARY',
b'SHARED_LIBRARY_LIBS',
b'SHARED_LIBRARY_NAME',
b'SIMPLE_PROGRAMS',
Expand Down Expand Up @@ -395,7 +393,6 @@ def _init(self):
# used for a "magic" rm -rf.
self._install_manifests['dist_public']
self._install_manifests['dist_private']
self._install_manifests['dist_sdk']

self._traversal = RecursiveMakeTraversal()
self._compile_graph = OrderedDefaultDict(set)
Expand Down Expand Up @@ -1189,8 +1186,6 @@ def _process_shared_library(self, libdef, backend_file):
backend_file.write('IS_COMPONENT := 1\n')
if libdef.soname:
backend_file.write('DSO_SONAME := %s\n' % libdef.soname)
if libdef.is_sdk:
backend_file.write('SDK_LIBRARY := %s\n' % libdef.import_name)
if libdef.symbols_file:
backend_file.write('SYMBOLS_FILE := %s\n' % libdef.symbols_file)
if not libdef.cxx_link:
Expand All @@ -1200,8 +1195,6 @@ def _process_static_library(self, libdef, backend_file):
backend_file.write_once('LIBRARY_NAME := %s\n' % libdef.basename)
backend_file.write('FORCE_STATIC_LIB := 1\n')
backend_file.write('REAL_LIBRARY := %s\n' % libdef.lib_name)
if libdef.is_sdk:
backend_file.write('SDK_LIBRARY := %s\n' % libdef.import_name)
if libdef.no_expand_lib:
backend_file.write('NO_EXPAND_LIBS := 1\n')

Expand Down Expand Up @@ -1315,7 +1308,6 @@ def _process_final_target_files(self, obj, files, backend_file):
'_tests',
'dist/include',
'dist/branding',
'dist/sdk',
))
if not path:
raise Exception("Cannot install to " + target)
Expand Down
20 changes: 0 additions & 20 deletions python/mozbuild/mozbuild/frontend/context.py
Expand Up @@ -1307,26 +1307,6 @@ def aggregate(files):
BRANDING_FILES.images.subdir += ['bar.png']
"""),

'SDK_FILES': (ContextDerivedTypedHierarchicalStringList(Path), list,
"""List of files to be installed into the sdk directory.
``SDK_FILES`` will copy (or symlink, if the platform supports it)
the contents of its files to the ``dist/sdk`` directory. Files that
are destined for a subdirectory can be specified by accessing a field.
For example, to export ``foo.py`` to the top-level directory and
``bar.py`` to the directory ``subdir``, append to
``SDK_FILES`` like so::
SDK_FILES += ['foo.py']
SDK_FILES.subdir += ['bar.py']
"""),

'SDK_LIBRARY': (bool, bool,
"""Whether the library built in the directory is part of the SDK.
The library will be copied into ``SDK_LIB_DIR`` (``$DIST/sdk/lib``).
"""),

'SIMPLE_PROGRAMS': (StrictOrderingOnAppendList, list,
"""Compile a list of executable names.
Expand Down
25 changes: 5 additions & 20 deletions python/mozbuild/mozbuild/frontend/data.py
Expand Up @@ -494,13 +494,11 @@ class Library(BaseLibrary):
"""Context derived container object for a library"""
KIND = 'target'
__slots__ = (
'is_sdk',
)

def __init__(self, context, basename, real_name=None, is_sdk=False):
def __init__(self, context, basename, real_name=None):
BaseLibrary.__init__(self, context, real_name or basename)
self.basename = basename
self.is_sdk = is_sdk


class StaticLibrary(Library):
Expand All @@ -510,9 +508,9 @@ class StaticLibrary(Library):
'no_expand_lib',
)

def __init__(self, context, basename, real_name=None, is_sdk=False,
def __init__(self, context, basename, real_name=None,
link_into=None, no_expand_lib=False):
Library.__init__(self, context, basename, real_name, is_sdk)
Library.__init__(self, context, basename, real_name)
self.link_into = link_into
self.no_expand_lib = no_expand_lib

Expand Down Expand Up @@ -571,10 +569,10 @@ class SharedLibrary(Library):
COMPONENT = 2
MAX_VARIANT = 3

def __init__(self, context, basename, real_name=None, is_sdk=False,
def __init__(self, context, basename, real_name=None,
soname=None, variant=None, symbols_file=False):
assert(variant in range(1, self.MAX_VARIANT) or variant is None)
Library.__init__(self, context, basename, real_name, is_sdk)
Library.__init__(self, context, basename, real_name)
self.variant = variant
self.lib_name = real_name or basename
assert self.lib_name
Expand Down Expand Up @@ -992,19 +990,6 @@ def install_target(self):
return 'dist/branding'


class SdkFiles(FinalTargetFiles):
"""Sandbox container object for SDK_FILES, which is a
HierarchicalStringList.
We need an object derived from ContextDerived for use in the backend, so
this object fills that role. It just has a reference to the underlying
HierarchicalStringList, which is created when parsing SDK_FILES.
"""
@property
def install_target(self):
return 'dist/sdk'


class GeneratedFile(ContextDerived):
"""Represents a generated file."""

Expand Down
10 changes: 0 additions & 10 deletions python/mozbuild/mozbuild/frontend/emitter.py
Expand Up @@ -65,7 +65,6 @@
RustLibrary,
HostRustLibrary,
RustProgram,
SdkFiles,
SharedLibrary,
SimpleProgram,
Sources,
Expand Down Expand Up @@ -647,14 +646,6 @@ def check_unique_binary(program, kind):
'SONAME requires FORCE_SHARED_LIB', context)
shared_args['soname'] = soname

# If both a shared and a static library are created, only the
# shared library is meant to be a SDK library.
if context.get('SDK_LIBRARY'):
if shared_lib:
shared_args['is_sdk'] = True
elif static_lib:
static_args['is_sdk'] = True

if context.get('NO_EXPAND_LIBS'):
if not static_lib:
raise SandboxValidationError(
Expand Down Expand Up @@ -1014,7 +1005,6 @@ def emit_from_context(self, context):
('FINAL_TARGET_PP_FILES', FinalTargetPreprocessedFiles),
('OBJDIR_FILES', ObjdirFiles),
('OBJDIR_PP_FILES', ObjdirPreprocessedFiles),
('SDK_FILES', SdkFiles),
('TEST_HARNESS_FILES', TestHarnessFiles),
):
all_files = context.get(var)
Expand Down
Empty file.
Empty file.
11 changes: 0 additions & 11 deletions python/mozbuild/mozbuild/test/backend/data/sdk-files/moz.build

This file was deleted.

Empty file.
12 changes: 0 additions & 12 deletions python/mozbuild/mozbuild/test/backend/test_recursivemake.py
Expand Up @@ -495,18 +495,6 @@ def test_branding_files(self):
self.assertIn('quux.png', m)
self.assertIn('icons/foo.ico', m)

def test_sdk_files(self):
"""Ensure SDK_FILES is handled properly."""
env = self._consume('sdk-files', RecursiveMakeBackend)

#SDK_FILES should appear in the dist_sdk install manifest.
m = InstallManifest(path=os.path.join(env.topobjdir,
'_build_manifests', 'install', 'dist_sdk'))
self.assertEqual(len(m), 3)
self.assertIn('bar.ico', m)
self.assertIn('quux.png', m)
self.assertIn('icons/foo.ico', m)

def test_test_manifests_files_written(self):
"""Ensure test manifests get turned into files."""
env = self._consume('test-manifests-written', RecursiveMakeBackend)
Expand Down
Empty file.
Empty file.
Empty file.
12 changes: 0 additions & 12 deletions python/mozbuild/mozbuild/test/frontend/data/sdk-files/moz.build

This file was deleted.

Empty file.
17 changes: 0 additions & 17 deletions python/mozbuild/mozbuild/test/frontend/test_emitter.py
Expand Up @@ -35,7 +35,6 @@
Program,
RustLibrary,
RustProgram,
SdkFiles,
SharedLibrary,
SimpleProgram,
Sources,
Expand Down Expand Up @@ -383,22 +382,6 @@ def test_branding_files(self):

self.assertEqual(icons._strings, ['quux.icns'])

def test_sdk_files(self):
reader = self.reader('sdk-files')
objs = self.read_topsrcdir(reader)

self.assertEqual(len(objs), 1)
self.assertIsInstance(objs[0], SdkFiles)

files = objs[0].files

self.assertEqual(files._strings, ['bar.ico', 'baz.png', 'foo.xpm'])

self.assertIn('icons', files._children)
icons = files._children['icons']

self.assertEqual(icons._strings, ['quux.icns'])

def test_program(self):
reader = self.reader('program')
objs = self.read_topsrcdir(reader)
Expand Down
2 changes: 0 additions & 2 deletions security/moz.build
Expand Up @@ -14,8 +14,6 @@ else:
# TODO: The library name can be changed when bug 845217 is fixed.
SHARED_LIBRARY_NAME = 'nss3'

SDK_LIBRARY = True

USE_LIBS += [
'nspr4',
'nss3_static',
Expand Down
2 changes: 0 additions & 2 deletions toolkit/library/moz.build
Expand Up @@ -72,8 +72,6 @@ def Libxul(name):

Libxul('xul')

SDK_LIBRARY = True

FORCE_STATIC_LIB = True

STATIC_LIBRARY_NAME = 'xul_s'
Expand Down
2 changes: 0 additions & 2 deletions xpcom/glue/standalone/moz.build
Expand Up @@ -16,8 +16,6 @@ SOURCES += [

Library('xpcomglue')

SDK_LIBRARY = True

FORCE_STATIC_LIB = True

if CONFIG['_MSC_VER']:
Expand Down
2 changes: 0 additions & 2 deletions xpcom/glue/standalone/staticruntime/moz.build
Expand Up @@ -11,8 +11,6 @@ SOURCES += [

Library('xpcomglue_staticruntime')

SDK_LIBRARY = True

# create a static lib
FORCE_STATIC_LIB = True

Expand Down

0 comments on commit ca77995

Please sign in to comment.