diff --git a/config/rules.mk b/config/rules.mk index 0097226f938..701f66f8cbb 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -1170,14 +1170,6 @@ endif #} XPT_NAME ################################################################################ # Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components -ifneq (,$(filter %.js,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS))) -ifeq (,$(filter %.manifest,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS))) -ifndef NO_JS_MANIFEST -$(error .js component without matching .manifest. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0) -endif -endif -endif - ifdef EXTRA_COMPONENTS misc:: $(EXTRA_COMPONENTS) ifndef NO_DIST_INSTALL diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index 7089eebff05..ad2955f468f 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -526,6 +526,17 @@ class TreeMetadataEmitter(LoggingMixin): for obj in self._process_xpidl(context): yield obj + # Check for manifest declarations in EXTRA_{PP_,}COMPONENTS. + extras = context.get('EXTRA_COMPONENTS', []) + context.get('EXTRA_PP_COMPONENTS', []) + if any(e.endswith('.js') for e in extras) and \ + not any(e.endswith('.manifest') for e in extras) and \ + not context.get('NO_JS_MANIFEST', False): + raise SandboxValidationError('A .js component was specified in EXTRA_COMPONENTS ' + 'or EXTRA_PP_COMPONENTS without a matching ' + '.manifest file. See ' + 'https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0 .', + context); + # Proxy some variables as-is until we have richer classes to represent # them. We should aim to keep this set small because it violates the # desired abstraction of the build definition away from makefiles. diff --git a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build index f4f5bf23430..07e51432d80 100644 --- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build +++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build @@ -2,7 +2,7 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ -EXTRA_COMPONENTS = ['bar.js', 'foo.js'] +EXTRA_COMPONENTS = ['bar.js', 'dummy.manifest', 'foo.js'] EXTRA_PP_COMPONENTS = ['bar.pp.js', 'foo.pp.js'] FAIL_ON_WARNINGS = True diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py index cfebc8af0ad..584d8a0128b 100644 --- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py @@ -265,6 +265,7 @@ class TestRecursiveMakeBackend(BackendTester): ], 'EXTRA_COMPONENTS': [ 'EXTRA_COMPONENTS += bar.js', + 'EXTRA_COMPONENTS += dummy.manifest', 'EXTRA_COMPONENTS += foo.js', ], 'EXTRA_PP_COMPONENTS': [ diff --git a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build index b88099196d4..08adfa63660 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build @@ -2,7 +2,7 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ -EXTRA_COMPONENTS=['fans.js', 'tans.js'] +EXTRA_COMPONENTS = ['dummy.manifest', 'fans.js', 'tans.js'] EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js'] FAIL_ON_WARNINGS = True diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py index 825d11abf93..da70952674e 100644 --- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py +++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py @@ -160,7 +160,7 @@ class TestEmitterBasic(unittest.TestCase): wanted = { 'DISABLE_STL_WRAPPING': True, - 'EXTRA_COMPONENTS': ['fans.js', 'tans.js'], + 'EXTRA_COMPONENTS': ['dummy.manifest', 'fans.js', 'tans.js'], 'EXTRA_PP_COMPONENTS': ['fans.pp.js', 'tans.pp.js'], 'FAIL_ON_WARNINGS': True, 'MSVC_ENABLE_PGO': True,