Skip to content

Commit 40bd048

Browse files
author
Sandor Molnar
committed
Backed out changeset 80f21c20d24d (bug 1840537) for causing problems when running e.g. mach lint CLOSED TREE
1 parent 7f2bd0d commit 40bd048

File tree

6 files changed

+17
-24
lines changed

6 files changed

+17
-24
lines changed

build/moz.configure/init.configure

+2-2
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ def target_variables(target):
811811
os_arch = target.kernel
812812

813813
return namespace(
814-
OS_TARGET=str(os_target),
815-
OS_ARCH=str(os_arch),
814+
OS_TARGET=os_target,
815+
OS_ARCH=os_arch,
816816
INTEL_ARCHITECTURE=target.cpu in ("x86", "x86_64") or None,
817817
)
818818

configure.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ def normalize(obj):
237237
return [normalize(o) for o in obj]
238238
return obj
239239

240+
sanitized_config = normalize(sanitized_config)
241+
240242
# Create config.status. Eventually, we'll want to just do the work it does
241243
# here, when we're able to skip configure tests/use cached results/not rely
242244
# on autoconf.
@@ -246,7 +248,6 @@ def normalize(obj):
246248
"""\
247249
#!%(python)s
248250
# coding=utf-8
249-
from mozbuild.configure.constants import *
250251
"""
251252
)
252253
% {"python": config["PYTHON3"]}
@@ -271,7 +272,6 @@ def normalize(obj):
271272
)
272273

273274
partial_config = PartialConfigEnvironment(config["TOPOBJDIR"])
274-
sanitized_config = normalize(sanitized_config)
275275
partial_config.write_vars(sanitized_config)
276276

277277
# Write out a file so the build backend knows to re-run configure when

media/libpng/moz.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if CONFIG['INTEL_ARCHITECTURE']:
5050
'intel/intel_init.c'
5151
]
5252

53-
if CONFIG['CPU_ARCH'] in ('mips32', 'mips64'):
53+
if CONFIG['CPU_ARCH'] == 'mips':
5454
DEFINES['MOZ_PNG_USE_MIPS_MSA'] = True
5555
UNIFIED_SOURCES += [
5656
'mips/filter_msa_intrinsics.c',

python/mozbuild/mozbuild/configure/constants.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
from mozbuild.util import EnumString
88

9-
CompilerType = EnumString.subclass("CompilerType")(
9+
CompilerType = EnumString.subclass(
1010
"clang",
1111
"clang-cl",
1212
"gcc",
1313
"msvc",
1414
)
1515

16-
OS = EnumString.subclass("OS")(
16+
OS = EnumString.subclass(
1717
"Android",
1818
"DragonFly",
1919
"FreeBSD",
@@ -26,7 +26,7 @@
2626
"WASI",
2727
)
2828

29-
Kernel = EnumString.subclass("Kernel")(
29+
Kernel = EnumString.subclass(
3030
"Darwin",
3131
"DragonFly",
3232
"FreeBSD",
@@ -62,19 +62,19 @@
6262
"wasm32": 32,
6363
}
6464

65-
CPU = EnumString.subclass("CPU")(*CPU_bitness.keys())
65+
CPU = EnumString.subclass(*CPU_bitness.keys())
6666

67-
Endianness = EnumString.subclass("Endianness")(
67+
Endianness = EnumString.subclass(
6868
"big",
6969
"little",
7070
)
7171

72-
WindowsBinaryType = EnumString.subclass("WindowsBinaryType")(
72+
WindowsBinaryType = EnumString.subclass(
7373
"win32",
7474
"win64",
7575
)
7676

77-
Abi = EnumString.subclass("Abi")(
77+
Abi = EnumString.subclass(
7878
"msvc",
7979
"mingw",
8080
)

python/mozbuild/mozbuild/test/test_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ def test_expand_variables(self):
824824

825825
class TestEnumString(unittest.TestCase):
826826
def test_string(self):
827-
CompilerType = EnumString.subclass("Test")("gcc", "clang", "clang-cl")
827+
CompilerType = EnumString.subclass("gcc", "clang", "clang-cl")
828828

829829
type = CompilerType("gcc")
830830
self.assertEqual(type, "gcc")

python/mozbuild/mozbuild/util.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -1326,19 +1326,12 @@ def __ne__(self, other):
13261326
def __hash__(self):
13271327
return super(EnumString, self).__hash__()
13281328

1329-
def __repr__(self):
1330-
return f"{self.__class__.__name__}({str(self)!r})"
1331-
13321329
@staticmethod
1333-
def subclass(name):
1334-
def create_subclass(*possible_values):
1335-
class EnumStringSubclass(EnumString):
1336-
POSSIBLE_VALUES = possible_values
1337-
1338-
EnumStringSubclass.__name__ = name
1339-
return EnumStringSubclass
1330+
def subclass(*possible_values):
1331+
class EnumStringSubclass(EnumString):
1332+
POSSIBLE_VALUES = possible_values
13401333

1341-
return create_subclass
1334+
return EnumStringSubclass
13421335

13431336

13441337
def _escape_char(c):

0 commit comments

Comments
 (0)