From c66c8664510a1cb5740eff347be55f856d7a6762 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Tue, 20 Apr 2021 22:57:13 +0200 Subject: [PATCH] BLD Display package build time in logs (#1509) --- .circleci/config.yml | 5 +++-- packages/Makefile | 2 +- pyodide_build/buildall.py | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f5283390..b7be249b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/packages/Makefile b/packages/Makefile index ea1db68f5..5a78c3182 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -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: diff --git a/pyodide_build/buildall.py b/pyodide_build/buildall.py index c2a55c441..ceb61e374 100755 --- a/pyodide_build/buildall.py +++ b/pyodide_build/buildall.py @@ -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)