Skip to content

Commit 72cff30

Browse files
authored
Fix package build failure when the compiler types not defined (Fixes #20428) (#20429)
This fixes the install issue #20428 by adding a default value when a compiler type is not defined. While this fix is specifically for z/OS, it should also fix other platforms that have their compiler_type changed in distutils/setuptools such as mingw32. I tested this with installing the librt package. I've added no testcases as there's no new functionality.
1 parent bc47274 commit 72cff30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mypyc/build_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def spawn(self, cmd, **kwargs) -> None: # type: ignore[no-untyped-def]
4848
new_cmd.extend(["-msimd128"])
4949
else:
5050
compiler_type: str = self.compiler_type
51-
extra_options = EXTRA_FLAGS_PER_COMPILER_TYPE_PER_PATH_COMPONENT[compiler_type]
51+
extra_options = EXTRA_FLAGS_PER_COMPILER_TYPE_PER_PATH_COMPONENT.get(compiler_type, None)
5252
new_cmd = list(cmd)
5353
if X86_64 and extra_options is not None:
5454
# filenames are closer to the end of command line

mypyc/lib-rt/build_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def spawn(self, cmd, **kwargs) -> None: # type: ignore[no-untyped-def]
4848
new_cmd.extend(["-msimd128"])
4949
else:
5050
compiler_type: str = self.compiler_type
51-
extra_options = EXTRA_FLAGS_PER_COMPILER_TYPE_PER_PATH_COMPONENT[compiler_type]
51+
extra_options = EXTRA_FLAGS_PER_COMPILER_TYPE_PER_PATH_COMPONENT.get(compiler_type, None)
5252
new_cmd = list(cmd)
5353
if X86_64 and extra_options is not None:
5454
# filenames are closer to the end of command line

0 commit comments

Comments
 (0)