|
25 | 25 | CPYTHON = TOOLS.parent |
26 | 26 | PYTHON_EXECUTOR_CASES_C_H = CPYTHON / "Python" / "executor_cases.c.h" |
27 | 27 | TOOLS_JIT_TEMPLATE_C = TOOLS_JIT / "template.c" |
| 28 | +ASYNCIO_RUNNER=asyncio.Runner() |
28 | 29 |
|
29 | 30 | _S = typing.TypeVar("_S", _schema.COFFSection, _schema.ELFSection, _schema.MachOSection) |
30 | 31 | _R = typing.TypeVar( |
@@ -222,7 +223,7 @@ def build( |
222 | 223 | and jit_stencils.read_text().startswith(digest) |
223 | 224 | ): |
224 | 225 | return |
225 | | - stencil_groups = asyncio.run(self._build_stencils()) |
| 226 | + stencil_groups = ASYNCIO_RUNNER.run(self._build_stencils()) |
226 | 227 | jit_stencils_new = out / "jit_stencils.h.new" |
227 | 228 | try: |
228 | 229 | with jit_stencils_new.open("w") as file: |
@@ -518,30 +519,30 @@ def get_target(host: str) -> _COFF | _ELF | _MachO: |
518 | 519 | # ghccc currently crashes Clang when combined with musttail on aarch64. :( |
519 | 520 | target: _COFF | _ELF | _MachO |
520 | 521 | if re.fullmatch(r"aarch64-apple-darwin.*", host): |
521 | | - condition = "defined(__aarch64__)" and "defined(__APPLE__)" |
| 522 | + condition = "defined(__aarch64__) && defined(__APPLE__)" |
522 | 523 | target = _MachO(host, condition, alignment=8, prefix="_") |
523 | 524 | elif re.fullmatch(r"aarch64-pc-windows-msvc", host): |
524 | 525 | args = ["-fms-runtime-lib=dll"] |
525 | 526 | condition = "defined(_M_ARM64)" |
526 | 527 | target = _COFF(host, condition, alignment=8, args=args) |
527 | 528 | elif re.fullmatch(r"aarch64-.*-linux-gnu", host): |
528 | 529 | args = ["-fpic"] |
529 | | - condition = "defined(__aarch64__)" and "defined(__linux__)" |
| 530 | + condition = "aarch64__) && defined(__linux__)" |
530 | 531 | target = _ELF(host, condition, alignment=8, args=args) |
531 | 532 | elif re.fullmatch(r"i686-pc-windows-msvc", host): |
532 | 533 | args = ["-DPy_NO_ENABLE_SHARED"] |
533 | 534 | condition = "defined(_M_IX86)" |
534 | 535 | target = _COFF(host, condition, args=args, ghccc=True, prefix="_") |
535 | 536 | elif re.fullmatch(r"x86_64-apple-darwin.*", host): |
536 | | - condition = "defined(__x86_64__)" and "defined(__APPLE__)" |
| 537 | + condition = "defined(__x86_64__) && defined(__APPLE__)" |
537 | 538 | target = _MachO(host, condition, ghccc=True, prefix="_") |
538 | 539 | elif re.fullmatch(r"x86_64-pc-windows-msvc", host): |
539 | 540 | args = ["-fms-runtime-lib=dll"] |
540 | 541 | condition = "defined(_M_X64)" |
541 | 542 | target = _COFF(host, condition, args=args, ghccc=True) |
542 | 543 | elif re.fullmatch(r"x86_64-.*-linux-gnu", host): |
543 | 544 | args = ["-fpic"] |
544 | | - condition = "defined(__x86_64__)" and "defined(__linux__)" |
| 545 | + condition = "defined(__x86_64__) && defined(__linux__)" |
545 | 546 | target = _ELF(host, condition, args=args, ghccc=True) |
546 | 547 | else: |
547 | 548 | raise ValueError(host) |
|
0 commit comments