|
@@ -2,7 +2,7 @@
|
|
|
# User Justin Wood <Callek@gmail.com>
|
|
|
# Date 1559053320 0
|
|
|
# Node ID 41e1409393169e979098e02645f3dfe190b19ef2
|
|
|
-# Parent c863d15a29f92ea376ce8b7026e22fdb63f6c8ba
|
|
|
+# Parent f1a51a7f4a383fa7fd820273410a3048234164cb
|
|
|
Bug 1542963 - run './mach lint ... --fix' on mozbuild/mozbuild, undoes some black changes. r=glandium
|
|
|
|
|
|
Lint python/mozbuild/{mozbuild,mozpack}.
|
|
@@ -733,17 +733,11 @@ diff --git a/python/mozbuild/mozbuild/action/xpccheck.py b/python/mozbuild/mozbu
|
|
|
+ name = os.path.basename(f)
|
|
|
+ if name.endswith('.in'):
|
|
|
+ name = name[:-3]
|
|
|
-+
|
|
|
-+ if not name.endswith('.js'):
|
|
|
-+ continue
|
|
|
|
|
|
- if not name.endswith('.js'):
|
|
|
- continue
|
|
|
-+ found = False
|
|
|
-+ for test in initests:
|
|
|
-+ if os.path.join(os.path.abspath(directory), name) == test['path']:
|
|
|
-+ found = True
|
|
|
-+ break
|
|
|
++ if not name.endswith('.js'):
|
|
|
++ continue
|
|
|
|
|
|
- found = False
|
|
|
- for test in initests:
|
|
@@ -754,6 +748,12 @@ diff --git a/python/mozbuild/mozbuild/action/xpccheck.py b/python/mozbuild/mozbu
|
|
|
- if not found:
|
|
|
- print >>sys.stderr, "TEST-UNEXPECTED-FAIL | xpccheck | test %s is missing from test manifest %s!" % (name, os.path.join(directory, 'xpcshell.ini'))
|
|
|
- sys.exit(1)
|
|
|
++ found = False
|
|
|
++ for test in initests:
|
|
|
++ if os.path.join(os.path.abspath(directory), name) == test['path']:
|
|
|
++ found = True
|
|
|
++ break
|
|
|
++
|
|
|
+ if not found:
|
|
|
+ print >>sys.stderr, "TEST-UNEXPECTED-FAIL | xpccheck | test %s is missing from test manifest %s!" % (
|
|
|
+ name, os.path.join(directory, 'xpcshell.ini'))
|
|
@@ -1681,9 +1681,10 @@ diff --git a/python/mozbuild/mozbuild/backend/cpp_eclipse.py b/python/mozbuild/m
|
|
|
+ workspace_settings_dir, 'org.eclipse.core.resources.prefs')
|
|
|
with open(core_resources_prefs_path, 'wb') as fh:
|
|
|
- fh.write(STATIC_CORE_RESOURCES_PREFS);
|
|
|
-+ fh.write(STATIC_CORE_RESOURCES_PREFS)
|
|
|
-
|
|
|
+-
|
|
|
- core_runtime_prefs_path = os.path.join(workspace_settings_dir, 'org.eclipse.core.runtime.prefs')
|
|
|
++ fh.write(STATIC_CORE_RESOURCES_PREFS)
|
|
|
++
|
|
|
+ core_runtime_prefs_path = os.path.join(
|
|
|
+ workspace_settings_dir, 'org.eclipse.core.runtime.prefs')
|
|
|
with open(core_runtime_prefs_path, 'wb') as fh:
|
|
@@ -1721,9 +1722,10 @@ diff --git a/python/mozbuild/mozbuild/backend/cpp_eclipse.py b/python/mozbuild/m
|
|
|
# so we need add those now:
|
|
|
cdt_core_prefs += FORMATTER_SETTINGS
|
|
|
- fh.write(cdt_core_prefs);
|
|
|
-+ fh.write(cdt_core_prefs)
|
|
|
-
|
|
|
+-
|
|
|
- editor_prefs_path = os.path.join(workspace_settings_dir, "org.eclipse.ui.editors.prefs");
|
|
|
++ fh.write(cdt_core_prefs)
|
|
|
++
|
|
|
+ editor_prefs_path = os.path.join(workspace_settings_dir, "org.eclipse.ui.editors.prefs")
|
|
|
with open(editor_prefs_path, 'wb') as fh:
|
|
|
- fh.write(EDITOR_SETTINGS);
|
|
@@ -5814,7 +5816,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
|
|
|
files are elsehwere (jar.mn, for instance) and this state of affairs
|
|
|
is OK.
|
|
|
"""),
|
|
|
-@@ -2021,196 +2033,196 @@ VARIABLES = {
|
|
|
+@@ -2021,204 +2033,204 @@ VARIABLES = {
|
|
|
- non_unified_sources, a list containing sources files, relative to
|
|
|
the current moz.build, that should be excluded from source file
|
|
|
unification.
|
|
@@ -6018,6 +6020,15 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
|
|
|
If yasm is not available on this system, or does not support the
|
|
|
current target architecture, an error will be raised.
|
|
|
"""),
|
|
|
+
|
|
|
+ 'USE_INTEGRATED_CLANGCL_AS': (bool, bool,
|
|
|
+- """Use the integrated clang-cl assembler to assemble assembly files from SOURCES.
|
|
|
++ """Use the integrated clang-cl assembler to assemble assembly files from SOURCES.
|
|
|
+
|
|
|
+ This allows using clang-cl to assemble assembly files which is useful
|
|
|
+ on platforms like aarch64 where the alternative is to have to run a
|
|
|
+ pre-processor to generate files with suitable syntax.
|
|
|
+ """),
|
|
|
}
|
|
|
|
|
|
# Sanity check: we don't want any variable above to have a list as storage type.
|
|
@@ -6034,7 +6045,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
|
|
|
'HOST_PROGRAM',
|
|
|
'HOST_LIBRARY_NAME',
|
|
|
'HOST_SIMPLE_PROGRAMS',
|
|
|
-@@ -2219,34 +2231,34 @@ TEMPLATE_VARIABLES = {
|
|
|
+@@ -2227,34 +2239,34 @@ TEMPLATE_VARIABLES = {
|
|
|
'PROGRAM',
|
|
|
'SIMPLE_PROGRAMS',
|
|
|
}
|
|
@@ -6071,7 +6082,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
|
|
|
If a relative path is given, it is evaluated as relative to the file
|
|
|
currently being processed. If there is a chain of multiple include(),
|
|
|
the relative path computation is from the most recent/active file.
|
|
|
-@@ -2263,17 +2275,17 @@ FUNCTIONS = {
|
|
|
+@@ -2271,17 +2283,17 @@ FUNCTIONS = {
|
|
|
include('sibling.build')
|
|
|
|
|
|
Include ``foo.build`` from a path within the top source directory::
|
|
@@ -6090,7 +6101,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
|
|
|
|
|
|
The value used for the variable is the final value at the end of the
|
|
|
moz.build file, so it is possible (but not recommended style) to place
|
|
|
-@@ -2290,31 +2302,31 @@ FUNCTIONS = {
|
|
|
+@@ -2298,31 +2310,31 @@ FUNCTIONS = {
|
|
|
|
|
|
To make all children directories install as the given extension::
|
|
|
|
|
@@ -6125,7 +6136,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
|
|
|
Contrary to traditional python functions:
|
|
|
- return values from template functions are ignored,
|
|
|
- template functions don't have access to the global scope.
|
|
|
-@@ -2363,48 +2375,48 @@ TestDirsPlaceHolder = List()
|
|
|
+@@ -2371,48 +2383,48 @@ TestDirsPlaceHolder = List()
|
|
|
# Special variables. These complement VARIABLES.
|
|
|
#
|
|
|
# Each entry is a tuple of:
|
|
@@ -6179,7 +6190,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
|
|
|
lambda key: context.config.substs_unicode.get(key)), dict,
|
|
|
"""Dictionary containing the current configuration variables.
|
|
|
|
|
|
-@@ -2413,92 +2425,92 @@ SPECIAL_VARIABLES = {
|
|
|
+@@ -2421,92 +2433,92 @@ SPECIAL_VARIABLES = {
|
|
|
|
|
|
Values in this container are read-only. Attempts at changing values
|
|
|
will result in a run-time error.
|
|
@@ -7079,7 +7090,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
|
|
|
('FINAL_TARGET_PP_FILES', FinalTargetPreprocessedFiles),
|
|
|
('LOCALIZED_FILES', LocalizedFiles),
|
|
|
('LOCALIZED_PP_FILES', LocalizedPreprocessedFiles),
|
|
|
-@@ -1331,17 +1335,16 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
+@@ -1341,17 +1345,16 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
yield computed_link_flags
|
|
|
|
|
|
if context.objdir in self._asm_compile_dirs:
|
|
@@ -7097,7 +7108,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
|
|
|
|
|
|
return sub
|
|
|
|
|
|
-@@ -1349,21 +1352,21 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
+@@ -1359,21 +1362,21 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
# XPIDL source files get processed and turned into .h and .xpt files.
|
|
|
# If there are multiple XPIDL files in a directory, they get linked
|
|
|
# together into a final .xpt, which has the name defined by
|
|
@@ -7121,7 +7132,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
|
|
|
|
|
|
for idl in context['XPIDL_SOURCES']:
|
|
|
yield XPIDLFile(context, mozpath.join(context.srcdir, idl),
|
|
|
-@@ -1432,43 +1435,43 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
+@@ -1442,43 +1445,43 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
yield obj
|
|
|
|
|
|
def _process_test_manifest(self, context, info, manifest_path, mpmanifest):
|
|
@@ -7173,7 +7184,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
|
|
|
obj.manifest_obj_relpath = mozpath.join(manifest_reldir,
|
|
|
defaults['install-to-subdir'],
|
|
|
mozpath.basename(path))
|
|
|
-@@ -1482,29 +1485,29 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
+@@ -1492,29 +1495,29 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
obj.installs[source] = (dest, False)
|
|
|
obj.external_installs |= install_info.external_installs
|
|
|
for install_path in install_info.deferred_installs:
|
|
@@ -7206,7 +7217,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
|
|
|
for path, m_defaults in mpmanifest.manifest_defaults.items():
|
|
|
process_support_files(m_defaults)
|
|
|
|
|
|
-@@ -1521,38 +1524,38 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
+@@ -1531,38 +1534,38 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
# FUTURE we should be able to detect autogenerated files from
|
|
|
# other build metadata. Once we do that, we can get rid of this.
|
|
|
for f in defaults.get('generated-files', '').split():
|
|
@@ -7254,7 +7265,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
|
|
|
'manifest': source_manifest,
|
|
|
'name': mozpath.basename(test),
|
|
|
'head': '',
|
|
|
-@@ -1561,33 +1564,33 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
+@@ -1571,33 +1574,33 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
})
|
|
|
|
|
|
yield obj
|
|
@@ -10302,9 +10313,6 @@ diff --git a/python/mozbuild/mozbuild/test/action/test_buildlist.py b/python/moz
|
|
|
- rmtree(self.tmpdir)
|
|
|
+ def setUp(self):
|
|
|
+ self.tmpdir = mkdtemp()
|
|
|
-+
|
|
|
-+ def tearDown(self):
|
|
|
-+ rmtree(self.tmpdir)
|
|
|
|
|
|
- # utility methods for tests
|
|
|
- def touch(self, file, dir=None):
|
|
@@ -10313,13 +10321,8 @@ diff --git a/python/mozbuild/mozbuild/test/action/test_buildlist.py b/python/moz
|
|
|
- f = os.path.join(dir, file)
|
|
|
- open(f, 'w').close()
|
|
|
- return f
|
|
|
-+ # utility methods for tests
|
|
|
-+ def touch(self, file, dir=None):
|
|
|
-+ if dir is None:
|
|
|
-+ dir = self.tmpdir
|
|
|
-+ f = os.path.join(dir, file)
|
|
|
-+ open(f, 'w').close()
|
|
|
-+ return f
|
|
|
++ def tearDown(self):
|
|
|
++ rmtree(self.tmpdir)
|
|
|
|
|
|
- def assertFileContains(self, filename, l):
|
|
|
- """Assert that the lines in the file |filename| are equal
|
|
@@ -10336,6 +10339,23 @@ diff --git a/python/mozbuild/mozbuild/test/action/test_buildlist.py b/python/moz
|
|
|
- self.assert_(len(l) == 0,
|
|
|
- "not enough lines in file! (expected '{0}',"
|
|
|
- " got '{1}'".format(l, lines))
|
|
|
++ # utility methods for tests
|
|
|
++ def touch(self, file, dir=None):
|
|
|
++ if dir is None:
|
|
|
++ dir = self.tmpdir
|
|
|
++ f = os.path.join(dir, file)
|
|
|
++ open(f, 'w').close()
|
|
|
++ return f
|
|
|
+
|
|
|
+- def test_basic(self):
|
|
|
+- "Test that addEntriesToListFile works when file doesn't exist."
|
|
|
+- testfile = os.path.join(self.tmpdir, "test.list")
|
|
|
+- l = ["a", "b", "c"]
|
|
|
+- addEntriesToListFile(testfile, l)
|
|
|
+- self.assertFileContains(testfile, l)
|
|
|
+- # ensure that attempting to add the same entries again doesn't change it
|
|
|
+- addEntriesToListFile(testfile, l)
|
|
|
+- self.assertFileContains(testfile, l)
|
|
|
+ def assertFileContains(self, filename, l):
|
|
|
+ """Assert that the lines in the file |filename| are equal
|
|
|
+ to the contents of the list |l|, in order."""
|
|
@@ -10352,14 +10372,15 @@ diff --git a/python/mozbuild/mozbuild/test/action/test_buildlist.py b/python/moz
|
|
|
+ "not enough lines in file! (expected '{0}',"
|
|
|
+ " got '{1}'".format(l, lines))
|
|
|
|
|
|
-- def test_basic(self):
|
|
|
-- "Test that addEntriesToListFile works when file doesn't exist."
|
|
|
+- def test_append(self):
|
|
|
+- "Test adding new entries."
|
|
|
- testfile = os.path.join(self.tmpdir, "test.list")
|
|
|
- l = ["a", "b", "c"]
|
|
|
- addEntriesToListFile(testfile, l)
|
|
|
- self.assertFileContains(testfile, l)
|
|
|
-- # ensure that attempting to add the same entries again doesn't change it
|
|
|
-- addEntriesToListFile(testfile, l)
|
|
|
+- l2 = ["x","y","z"]
|
|
|
+- addEntriesToListFile(testfile, l2)
|
|
|
+- l.extend(l2)
|
|
|
- self.assertFileContains(testfile, l)
|
|
|
+ def test_basic(self):
|
|
|
+ "Test that addEntriesToListFile works when file doesn't exist."
|
|
@@ -10371,16 +10392,14 @@ diff --git a/python/mozbuild/mozbuild/test/action/test_buildlist.py b/python/moz
|
|
|
+ addEntriesToListFile(testfile, l)
|
|
|
+ self.assertFileContains(testfile, l)
|
|
|
|
|
|
-- def test_append(self):
|
|
|
-- "Test adding new entries."
|
|
|
+- def test_append_some(self):
|
|
|
+- "Test adding new entries mixed with existing entries."
|
|
|
- testfile = os.path.join(self.tmpdir, "test.list")
|
|
|
- l = ["a", "b", "c"]
|
|
|
- addEntriesToListFile(testfile, l)
|
|
|
- self.assertFileContains(testfile, l)
|
|
|
-- l2 = ["x","y","z"]
|
|
|
-- addEntriesToListFile(testfile, l2)
|
|
|
-- l.extend(l2)
|
|
|
-- self.assertFileContains(testfile, l)
|
|
|
+- addEntriesToListFile(testfile, ["a", "x", "c", "z"])
|
|
|
+- self.assertFileContains(testfile, ["a", "b", "c", "x", "z"])
|
|
|
+ def test_append(self):
|
|
|
+ "Test adding new entries."
|
|
|
+ testfile = os.path.join(self.tmpdir, "test.list")
|
|
@@ -10392,14 +10411,14 @@ diff --git a/python/mozbuild/mozbuild/test/action/test_buildlist.py b/python/moz
|
|
|
+ l.extend(l2)
|
|
|
+ self.assertFileContains(testfile, l)
|
|
|
|
|
|
-- def test_append_some(self):
|
|
|
-- "Test adding new entries mixed with existing entries."
|
|
|
+- def test_add_multiple(self):
|
|
|
+- """Test that attempting to add the same entry multiple times results in
|
|
|
+- only one entry being added."""
|
|
|
- testfile = os.path.join(self.tmpdir, "test.list")
|
|
|
-- l = ["a", "b", "c"]
|
|
|
-- addEntriesToListFile(testfile, l)
|
|
|
-- self.assertFileContains(testfile, l)
|
|
|
-- addEntriesToListFile(testfile, ["a", "x", "c", "z"])
|
|
|
-- self.assertFileContains(testfile, ["a", "b", "c", "x", "z"])
|
|
|
+- addEntriesToListFile(testfile, ["a","b","a","a","b"])
|
|
|
+- self.assertFileContains(testfile, ["a","b"])
|
|
|
+- addEntriesToListFile(testfile, ["c","a","c","b","c"])
|
|
|
+- self.assertFileContains(testfile, ["a","b","c"])
|
|
|
+ def test_append_some(self):
|
|
|
+ "Test adding new entries mixed with existing entries."
|
|
|
+ testfile = os.path.join(self.tmpdir, "test.list")
|
|
@@ -10408,15 +10427,7 @@ diff --git a/python/mozbuild/mozbuild/test/action/test_buildlist.py b/python/moz
|
|
|
+ self.assertFileContains(testfile, l)
|
|
|
+ addEntriesToListFile(testfile, ["a", "x", "c", "z"])
|
|
|
+ self.assertFileContains(testfile, ["a", "b", "c", "x", "z"])
|
|
|
-
|
|
|
-- def test_add_multiple(self):
|
|
|
-- """Test that attempting to add the same entry multiple times results in
|
|
|
-- only one entry being added."""
|
|
|
-- testfile = os.path.join(self.tmpdir, "test.list")
|
|
|
-- addEntriesToListFile(testfile, ["a","b","a","a","b"])
|
|
|
-- self.assertFileContains(testfile, ["a","b"])
|
|
|
-- addEntriesToListFile(testfile, ["c","a","c","b","c"])
|
|
|
-- self.assertFileContains(testfile, ["a","b","c"])
|
|
|
++
|
|
|
+ def test_add_multiple(self):
|
|
|
+ """Test that attempting to add the same entry multiple times results in
|
|
|
+ only one entry being added."""
|
|
@@ -13215,10 +13226,12 @@ diff --git a/python/mozbuild/mozbuild/test/test_containers.py b/python/mozbuild/
|
|
|
self.assertEqual(test['foo'], 1)
|
|
|
|
|
|
- self.assertEqual(test.keys(), ['foo', 'bar' ])
|
|
|
-+ self.assertEqual(test.keys(), ['foo', 'bar'])
|
|
|
-
|
|
|
- def test_defaults(self):
|
|
|
+-
|
|
|
+- def test_defaults(self):
|
|
|
- test = OrderedDefaultDict(bool, {'foo': 1 })
|
|
|
++ self.assertEqual(test.keys(), ['foo', 'bar'])
|
|
|
++
|
|
|
++ def test_defaults(self):
|
|
|
+ test = OrderedDefaultDict(bool, {'foo': 1})
|
|
|
|
|
|
self.assertEqual(test['foo'], 1)
|
|
@@ -13938,18 +13951,13 @@ diff --git a/python/mozbuild/mozbuild/test/test_line_endings.py b/python/mozbuil
|
|
|
+ for line, ending in zip(['a', '#literal b', 'c'], lineendings):
|
|
|
+ f.write(line+ending)
|
|
|
+ f.close()
|
|
|
-+
|
|
|
-+ def testMac(self):
|
|
|
-+ self.createFile(['\x0D']*3)
|
|
|
-+ self.pp.do_include(self.tempnam)
|
|
|
-+ self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')
|
|
|
|
|
|
- def testMac(self):
|
|
|
- self.createFile(['\x0D']*3)
|
|
|
- self.pp.do_include(self.tempnam)
|
|
|
- self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')
|
|
|
-+ def testUnix(self):
|
|
|
-+ self.createFile(['\x0A']*3)
|
|
|
++ def testMac(self):
|
|
|
++ self.createFile(['\x0D']*3)
|
|
|
+ self.pp.do_include(self.tempnam)
|
|
|
+ self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')
|
|
|
|
|
@@ -13957,8 +13965,8 @@ diff --git a/python/mozbuild/mozbuild/test/test_line_endings.py b/python/mozbuil
|
|
|
- self.createFile(['\x0A']*3)
|
|
|
- self.pp.do_include(self.tempnam)
|
|
|
- self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')
|
|
|
-+ def testWindows(self):
|
|
|
-+ self.createFile(['\x0D\x0A']*3)
|
|
|
++ def testUnix(self):
|
|
|
++ self.createFile(['\x0A']*3)
|
|
|
+ self.pp.do_include(self.tempnam)
|
|
|
+ self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')
|
|
|
|
|
@@ -13966,6 +13974,11 @@ diff --git a/python/mozbuild/mozbuild/test/test_line_endings.py b/python/mozbuil
|
|
|
- self.createFile(['\x0D\x0A']*3)
|
|
|
- self.pp.do_include(self.tempnam)
|
|
|
- self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')
|
|
|
++ def testWindows(self):
|
|
|
++ self.createFile(['\x0D\x0A']*3)
|
|
|
++ self.pp.do_include(self.tempnam)
|
|
|
++ self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')
|
|
|
++
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- mozunit.main()
|