Skip to content

Commit

Permalink
Backed out changeset 80f21c20d24d (bug 1840537) for causing problems …
Browse files Browse the repository at this point in the history
…when running e.g. mach lint CLOSED TREE

UltraBlame original commit: eed85d208f786cc6a0762dae67f1c7aa69e574f8
  • Loading branch information
marco-c committed Jul 1, 2023
1 parent c852757 commit 8a6fda5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
4 changes: 2 additions & 2 deletions build/moz.configure/init.configure
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,8 @@ def target_variables(target):
os_arch = target.kernel

return namespace(
OS_TARGET=str(os_target),
OS_ARCH=str(os_arch),
OS_TARGET=os_target,
OS_ARCH=os_arch,
INTEL_ARCHITECTURE=target.cpu in ("x86", "x86_64") or None,
)

Expand Down
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ def normalize(obj):
return [normalize(o) for o in obj]
return obj

sanitized_config = normalize(sanitized_config)




Expand All @@ -246,7 +248,6 @@ def normalize(obj):
"""\
#!%(python)s
# coding=utf-8
from mozbuild.configure.constants import *
"""
)
% {"python": config["PYTHON3"]}
Expand All @@ -271,7 +272,6 @@ def normalize(obj):
)

partial_config = PartialConfigEnvironment(config["TOPOBJDIR"])
sanitized_config = normalize(sanitized_config)
partial_config.write_vars(sanitized_config)


Expand Down
2 changes: 1 addition & 1 deletion media/libpng/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if CONFIG['INTEL_ARCHITECTURE']:
'intel/intel_init.c'
]

if CONFIG['CPU_ARCH'] in ('mips32', 'mips64'):
if CONFIG['CPU_ARCH'] == 'mips':
DEFINES['MOZ_PNG_USE_MIPS_MSA'] = True
UNIFIED_SOURCES += [
'mips/filter_msa_intrinsics.c',
Expand Down
14 changes: 7 additions & 7 deletions python/mozbuild/mozbuild/configure/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

from mozbuild.util import EnumString

CompilerType = EnumString.subclass("CompilerType")(
CompilerType = EnumString.subclass(
"clang",
"clang-cl",
"gcc",
"msvc",
)

OS = EnumString.subclass("OS")(
OS = EnumString.subclass(
"Android",
"DragonFly",
"FreeBSD",
Expand All @@ -26,7 +26,7 @@
"WASI",
)

Kernel = EnumString.subclass("Kernel")(
Kernel = EnumString.subclass(
"Darwin",
"DragonFly",
"FreeBSD",
Expand Down Expand Up @@ -62,19 +62,19 @@
"wasm32": 32,
}

CPU = EnumString.subclass("CPU")(*CPU_bitness.keys())
CPU = EnumString.subclass(*CPU_bitness.keys())

Endianness = EnumString.subclass("Endianness")(
Endianness = EnumString.subclass(
"big",
"little",
)

WindowsBinaryType = EnumString.subclass("WindowsBinaryType")(
WindowsBinaryType = EnumString.subclass(
"win32",
"win64",
)

Abi = EnumString.subclass("Abi")(
Abi = EnumString.subclass(
"msvc",
"mingw",
)
Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def test_expand_variables(self):

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

type = CompilerType("gcc")
self.assertEqual(type, "gcc")
Expand Down
15 changes: 4 additions & 11 deletions python/mozbuild/mozbuild/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,19 +1326,12 @@ def __ne__(self, other):
def __hash__(self):
return super(EnumString, self).__hash__()

def __repr__(self):
return f"{self.__class__.__name__}({str(self)!r})"

@staticmethod
def subclass(name):
def create_subclass(*possible_values):
class EnumStringSubclass(EnumString):
POSSIBLE_VALUES = possible_values

EnumStringSubclass.__name__ = name
return EnumStringSubclass
def subclass(*possible_values):
class EnumStringSubclass(EnumString):
POSSIBLE_VALUES = possible_values

return create_subclass
return EnumStringSubclass


def _escape_char(c):
Expand Down

0 comments on commit 8a6fda5

Please sign in to comment.