From a72571cfcf4e810ab5e68fd8af2fdd75cdb2942e Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Sun, 18 Oct 2026 18:09:37 +0200 Subject: [PATCH 1/2] start new dev branch; add audit file --- .audit/oberstet_fix_1985.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .audit/oberstet_fix_1985.md diff --git a/.audit/oberstet_fix_1985.md b/.audit/oberstet_fix_1985.md new file mode 100644 index 000000000..9f91eb37a --- /dev/null +++ b/.audit/oberstet_fix_1985.md @@ -0,0 +1,8 @@ +- [ ] I did **not** use any AI-assistance tools to help create this pull request. +- [x] I **did** use AI-assistance tools to *help* create this pull request. +- [x] I have read, understood and followed the project's AI_POLICY.md when creating code, documentation etc. for this pull request. + +Submitted by: @oberstet +Date: 2026-10-18 +Related issue(s): #1985 +Branch: oberstet:fix_1985 From 09bc41b95c478798057a3fd0a486b6ac260beefd Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Sun, 18 Oct 2026 18:17:06 +0200 Subject: [PATCH 2/2] #1985: build the bundled flatc on all cores (cmake --build --parallel) hatch_build.py built flatc with `cmake --build . --target flatc` and no --parallel, so on one core: about 4 minutes on every wheel build, editable install and `just test-*` run. It now passes `--parallel `. An explicit CMAKE_BUILD_PARALLEL_LEVEL in the environment still wins: then --parallel is given without a count, and cmake reads the variable. The build log names the job count, so a CI log shows which was used. Same change as zlmdb 9e74456 (#174). This is the parallel-build point of #1985 only. The input stamp, skipping an unchanged flatc, and AUTOBAHN_FORCE_FLATC_BUILD stay open. Measured on asgard1 (same configure arguments, out-of-tree build of deps/flatbuffers, flatc 25.12.19): serial 237 s, 16 jobs 25 s. A full `uv build --wheel` (cpy314, CMAKE_BUILD_PARALLEL_LEVEL=16) took 34 s and the wheel contains autobahn/_flatc/bin/flatc. ruff check and just check-typing cpy314 pass. No red/green pair: build speed only, no behaviour change to test. Expected CI result: GREEN - all jobs, with the flatc step of the wheel jobs faster; every wheel still bundles flatc. Note: This work was completed with AI assistance (Claude Code). --- docs/changelog.rst | 1 + hatch_build.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 9e24fdd3a..7da395cf2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,7 @@ Changelog * Adopt the contribution workflow shared by all WAMP projects: ``CONTRIBUTING.md``, the pull request template and ``.audit/README.md`` are now deployed byte-identically from wamp-cicd (GitHub issue first, red → green tests, AI-assistance disclosure) and kept in sync by a CI drift check; everything specific to Autobahn|Python moved to a new ``DEVELOPMENT.md`` (also included in the docs). ``.cicd`` is pinned to wamp-cicd ``38ded6a``, the same commit across the WAMP fleet (#1956) * Remove the opt-in entropy depletion tests (``autobahn/test/test_rng.py``, enabled by ``AUTOBAHN_CI_ENABLE_RNG_DEPLETION_TESTS``, never run in CI): they read ``/proc/sys/kernel/random/entropy_avail``, which has been a constant 256 since Linux 5.18, and ``/dev/random`` no longer blocks since Linux 5.6, so one test passed whatever happened and the other always failed (#1278) * Build the ARM64 Linux wheels natively on GitHub's ``ubuntu-24.04-arm`` runners instead of under QEMU emulation on x86_64 runners, as zlmdb does since #183. Under emulation the builds took around 40 minutes (up to 96) and segfaulted intermittently, so each build had 9 attempts of 120 minutes; the same container images and build script are used, and a build attempt now gets 60 minutes and 3 tries (#1940) +* Build the bundled ``flatc`` on all cores: ``hatch_build.py`` ran ``cmake --build`` without ``--parallel``, so ``flatc`` was compiled on one core in every wheel build, editable install and ``just test-*`` run. It now passes ``--parallel ``; an explicit ``CMAKE_BUILD_PARALLEL_LEVEL`` in the environment still wins. Measured on a 32-core host: 237 s serial, 25 s with 16 jobs. Skipping the build when ``flatc``'s inputs did not change is still open (#1985) * Add an ``import-smoke-lowest`` CI job (``just test-imports-lowest``) that runs the import smoke test on CPython 3.11 with every direct dependency resolved to the lowest version ``pyproject.toml`` allows (``uv --resolution lowest-direct``), so stale version floors are caught. The import smoke test now also covers the Twisted and asyncio bindings, each module imported in a fresh interpreter (#1955) **asyncio** diff --git a/hatch_build.py b/hatch_build.py index 3a2776a18..90dc801da 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -247,8 +247,9 @@ def _build_flatc(self, build_data): print(f"ERROR: cmake configure failed:\n{result.stderr}") return False - # Step 2: Build flatc - print(" -> Building flatc...") + # Step 2: Build flatc, on all cores (#1985). An explicit + # CMAKE_BUILD_PARALLEL_LEVEL in the environment wins: cmake reads it + # itself when --parallel is given without a job count. build_args = [ cmake_path, "--build", @@ -257,7 +258,15 @@ def _build_flatc(self, build_data): "Release", "--target", "flatc", + "--parallel", ] + jobs = os.environ.get("CMAKE_BUILD_PARALLEL_LEVEL") + if jobs: + print(f" -> Building flatc ({jobs} jobs, CMAKE_BUILD_PARALLEL_LEVEL)...") + else: + jobs = str(os.cpu_count() or 1) + build_args.append(jobs) + print(f" -> Building flatc ({jobs} parallel jobs)...") result = subprocess.run( build_args,