Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
efd5863
First draft of supporting fat builds on macOS with the experimental JIT
ronaldoussoren Feb 20, 2024
4f493cd
merge conflict
savannahostrowski Sep 25, 2024
a55268e
fix up merge
savannahostrowski Sep 25, 2024
bce7980
add fix for CI?;
savannahostrowski Sep 25, 2024
b606b48
Fix up to make generic
savannahostrowski Sep 25, 2024
a382a44
Fix up conditions
savannahostrowski Sep 27, 2024
ff3d363
Save state before merge
savannahostrowski Mar 26, 2025
3bc2820
Merge main and fix conflicts
savannahostrowski Mar 26, 2025
348f2b6
Fix event loop binding error for _CORES in FAT builds
savannahostrowski Mar 26, 2025
4b31a30
📜🤖 Added by blurb_it.
blurb-it[bot] Mar 26, 2025
4564bc4
Try using weakref?
savannahostrowski Mar 26, 2025
2d381ca
Merge branch 'og_fat_build' of https://github.com/savannahostrowski/c…
savannahostrowski Mar 26, 2025
49f86a1
Remove weakref and lazily instantiate cores
savannahostrowski Mar 27, 2025
467ffe1
use Runner
savannahostrowski Apr 3, 2025
fd858bc
Merge branch 'main' into og_fat_build
savannahostrowski Apr 3, 2025
58649ff
Remove conditional and fix indentation in stencils
savannahostrowski Apr 11, 2025
182612c
Merge branch 'og_fat_build' of https://github.com/savannahostrowski/c…
savannahostrowski Apr 11, 2025
30a4d99
Merge branch 'main' into og_fat_build
savannahostrowski Apr 11, 2025
b172a41
CI updates
savannahostrowski Apr 11, 2025
18e77f2
Merge branch 'og_fat_build' of https://github.com/savannahostrowski/c…
savannahostrowski Apr 11, 2025
de3f896
Remove extra space
savannahostrowski Apr 11, 2025
7c22761
Fix condition typo
savannahostrowski Apr 11, 2025
c54250b
undo
savannahostrowski Apr 11, 2025
c21573f
Update jit.yml
savannahostrowski Apr 11, 2025
4332f10
Merge branch 'main' into og_fat_build
savannahostrowski Apr 16, 2025
dd5f196
Merge branch 'main' into og_fat_build
brandtbucher Apr 28, 2025
cdc4bfb
Merge branch 'main' into og_fat_build
savannahostrowski Apr 30, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use Runner
  • Loading branch information
savannahostrowski committed Apr 3, 2025
commit 467ffe17493fbe9e923f0a2068cbbe70ea2b2613
11 changes: 2 additions & 9 deletions Tools/jit/_llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,12 @@ async def wrapper(
return wrapper


_CORES: asyncio.BoundedSemaphore | None = None


def _get_cores() -> asyncio.BoundedSemaphore:
global _CORES
if _CORES is None:
_CORES = asyncio.BoundedSemaphore(os.cpu_count() or 1)
return _CORES
_CORES = asyncio.BoundedSemaphore(os.cpu_count() or 1)


async def _run(tool: str, args: typing.Iterable[str], echo: bool = False) -> str | None:
command = [tool, *args]
async with _get_cores():
async with _CORES:
if echo:
print(shlex.join(command))
try:
Expand Down
3 changes: 2 additions & 1 deletion Tools/jit/_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
CPYTHON = TOOLS.parent
PYTHON_EXECUTOR_CASES_C_H = CPYTHON / "Python" / "executor_cases.c.h"
TOOLS_JIT_TEMPLATE_C = TOOLS_JIT / "template.c"
ASYNCIO_RUNNER = asyncio.Runner()

_S = typing.TypeVar("_S", _schema.COFFSection, _schema.ELFSection, _schema.MachOSection)
_R = typing.TypeVar(
Expand Down Expand Up @@ -199,7 +200,7 @@ def build(
and jit_stencils.read_text().startswith(digest)
):
return
stencil_groups = asyncio.run(self._build_stencils())
stencil_groups = ASYNCIO_RUNNER.run(self._build_stencils())
jit_stencils_new = out / "jit_stencils.h.new"
try:
with jit_stencils_new.open("w") as file:
Expand Down
Loading