mirror of https://github.com/pyodide/pyodide.git
BLD Display package build time in logs (#1509)
This commit is contained in:
parent
8b1a4978d9
commit
c66c866451
|
@ -5,8 +5,9 @@ defaults: &defaults
|
|||
docker:
|
||||
- image: pyodide/pyodide-env:15
|
||||
environment:
|
||||
- EMSDK_NUM_CORES: 4
|
||||
EMCC_CORES: 4
|
||||
- EMSDK_NUM_CORES: 3
|
||||
EMCC_CORES: 3
|
||||
PYODIDE_JOBS: 3
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
|
|
@ -10,7 +10,7 @@ endif
|
|||
all:
|
||||
mkdir -p $(PYODIDE_LIBRARIES)
|
||||
PYTHONPATH=$(PYODIDE_LIBRARIES)/lib/python ../bin/pyodide buildall . ../build \
|
||||
--target=$(TARGETPYTHONROOT) $(ONLY_PACKAGES) --install-dir $(PYODIDE_LIBRARIES)
|
||||
--target=$(TARGETPYTHONROOT) $(ONLY_PACKAGES) --install-dir $(PYODIDE_LIBRARIES) --n-jobs $${PYODIDE_JOBS:-4}
|
||||
|
||||
|
||||
update-all:
|
||||
|
|
|
@ -13,7 +13,7 @@ import shutil
|
|||
import subprocess
|
||||
import sys
|
||||
from threading import Thread
|
||||
from time import sleep
|
||||
from time import sleep, perf_counter
|
||||
from typing import Dict, Set, Optional, List
|
||||
|
||||
from . import common
|
||||
|
@ -178,13 +178,14 @@ def build_from_graph(pkg_map: Dict[str, Package], outputdir: Path, args) -> None
|
|||
while True:
|
||||
pkg = build_queue.get()
|
||||
print(f"Thread {n} building {pkg.name}")
|
||||
t0 = perf_counter()
|
||||
try:
|
||||
pkg.build(outputdir, args)
|
||||
except Exception as e:
|
||||
built_queue.put(e)
|
||||
return
|
||||
|
||||
print(f"Thread {n} built {pkg.name}")
|
||||
print(f"Thread {n} built {pkg.name} in {perf_counter() - t0:.1f} s")
|
||||
built_queue.put(pkg)
|
||||
# Release the GIL so new packages get queued
|
||||
sleep(0.01)
|
||||
|
|
Loading…
Reference in New Issue