test(install): serialise the second wheel builder with an inline lock (#4603)

#4664 locked the test_wheel_packaging builder but not _build_wheel_names in
test_install_references, which also runs python -m build against the shared
build/ dir. Add an inline per-checkout flock (same mechanism) so two concurrent
runs on one checkout cannot collide; a cross-module import does not resolve
under pytest's import mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
safishamsiandClaude Opus 4.8 committed 2026-11-05 13:02:18 +00:00
1 parent c051a96ff3
commit 16218bfc80
2 files changed
+31 -8

No files matched your search

+9 -2
View File
@@ -2,7 +2,14 @@
Full release notes with details on each version: [GitHub Releases](https://github.com/Graphify-Labs/graphify/releases)
## 0.9.103 (2026-11-04)
## 0.9.103 (2026-11-05)
- Fix: **markdown** a code span written as a backslash namespace (`\Foo\Bar`) or a type-qualified member (`Type::member`) is recognised as a symbol mention and resolves to the real node when one exists, instead of being silently dropped; an absent chain mints nothing (#4610, #4695, thanks @viwe-monai).
- Fix: **detect** `extract` warns loudly when a large share of the corpus has no supported extractor (a 20-file floor and a 20% threshold), instead of only printing a bare unclassified count; a normal mixed project stays silent (#2942, #4646, thanks @ayushcodes10).
- Fix: **thread-safety** the ambient scan root is held in a `ContextVar` instead of a module global, so concurrent library/async callers extracting different roots no longer clobber each other's root; the single-threaded CLI is unchanged (#4602, #4694, thanks @WyattAu).
- Feat: **tree** `graphify export tree` caps how many children a directory lists (`--max-children`, default 200) while `total_count` still reports the full count, so a directory with thousands of entries no longer renders them all (#4766, #4768, thanks @oleksii-tumanov).
- Fix: **install** the Pi project skill is written to `.pi/skills`, where Pi reads it, instead of a `.pi/agent/skills` path it never looks at; uninstall is symmetric (#5011, #5012, thanks @Vivek1898).
- Internal: stage fake install bundles in a temp package root and fail loudly (not skip) on a wheel-build error, and serialise both wheel builders under a shared lock so concurrent runs on one checkout do not collide (#4603, #4664, thanks @wanjinhao1); characterize `_is_stale` across changed/unchanged/vanished sources (#4996, thanks @PratikDhanave); isolate the ambient venv/PATH in the `_detect_run` hook test (#4991, thanks @HhH666-ux).
- Fix: **solidity** a library call (`Lib.f()`, including an aliased import) and an `emit`/`revert`/`require` naming a declared event or error now link to the member they name instead of producing no edge; resolution is gated to a single visible type whose unique name/arity member matches, so a builtin `require` or an ambiguous qualifier is left unresolved (#5001, #5005, thanks @rohit-jsfreaky).
- Fix: **csharp** preprocessor directives and `#if` branches that derail tree-sitter are blanked before parsing (byte-length preserving, so line and column numbers do not move), so a directive no longer closes the enclosing class early and orphans later members or drops their calls; the first `#if` branch and distinct framework-fallback branches are kept (#5003, thanks @rohit-jsfreaky).
@@ -15,7 +22,7 @@ Full release notes with details on each version: [GitHub Releases](https://githu
- Fix: **hooks** the once-per-session nudge budget is restored after a Claude Code compaction (a `SessionStart` with `source=compact`), so orientation can re-fire once the earlier nudges have left the model's context (#5008, thanks @rohit-jsfreaky).
- Fix: **hooks** the toplevel-anchor logic keeps working when `CDPATH` is exported; an exported `CDPATH` was corrupting the relative `.git` capture and silently skipping the post-commit/checkout rebuild (#4977, #4988, thanks @HhH666-ux).
- Perf: **update** the watch reconcile pass resolves AST ownership once per file instead of re-reading each header once per node, with identical graph output (#4978, #4986, thanks @Deepjyoti-Sarmah).
- **AST cache schema bumped to 38** for the C# (#5003), Solidity (#5001, #5005) and YAML (#4995) extractor fixes; warm caches re-run the affected extractions.
- **AST cache schema bumped to 39** for the C# (#5003), Solidity (#5001, #5005), YAML (#4995) and Markdown (#4695) extractor fixes; warm caches re-run the affected extractions.
## 0.9.102 (2026-11-03)
+22 -6
View File
@@ -410,17 +410,13 @@ def _build_wheel_names(repo_root):
declared dev dependency, so an environment that runs this test is expected to
have it. A silent skip is how a packaging regression slips through CI.
"""
import contextlib
import hashlib
import subprocess
import sys
import tempfile
import zipfile
# Share the serialisation that test_wheel_packaging uses: both builders run
# `python -m build --no-isolation`, which writes the checkout's shared
# `build/` dir, so two concurrent pytest runs on one checkout must not build
# at the same time (#4603).
from test_wheel_packaging import _wheel_build_lock
try:
import build # noqa: F401
except ImportError:
@@ -429,6 +425,26 @@ def _build_wheel_names(repo_root):
"installed; it is a declared dev dependency (run `uv sync --all-extras`)"
)
# Serialise with the other `python -m build --no-isolation` builder
# (test_wheel_packaging): both write the checkout's shared `build/` dir, so
# two concurrent pytest runs on one checkout must not build at once (#4603).
# Keyed by repo path in the temp dir; fcntl is released by the OS on kill.
@contextlib.contextmanager
def _wheel_build_lock():
try:
import fcntl
except ImportError:
yield
return
key = hashlib.sha256(str(repo_root).encode()).hexdigest()[:16]
lock_path = Path(tempfile.gettempdir()) / f"graphify-wheel-build-{key}.lock"
with open(lock_path, "a+") as fh:
fcntl.flock(fh.fileno(), fcntl.LOCK_EX)
try:
yield
finally:
fcntl.flock(fh.fileno(), fcntl.LOCK_UN)
with tempfile.TemporaryDirectory() as outdir, _wheel_build_lock():
result = subprocess.run(
[sys.executable, "-m", "build", "--wheel", "--no-isolation", "--outdir", outdir, str(repo_root)],