BLD Display package build time in logs (#1509)

This commit is contained in:
Roman Yurchak 2021-04-20 22:57:13 +02:00 committed by GitHub
parent 8b1a4978d9
commit c66c866451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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)