Skip to content

Make Codex and Claude Code subscriptions go further: a local model router that gives routine agent work to economical models and keeps your strongest model for the hard parts.

fix(release): keep macOS build locks in parent process

johnlanni5dac9bcddb99
diff --git a/scripts/package-desktop.py b/scripts/package-desktop.py
index 6965d6b6..74115440 100644
--- a/scripts/package-desktop.py
+++ b/scripts/package-desktop.py
@@ -25,7 +25,6 @@ TARGETS = {"arm64": "aarch64-apple-darwin", "x86_64": "x86_64-apple-darwin"}
CPA_SOURCE = json.loads((REPO / "vendor/cpa/source.json").read_text())
CPA_VERSION = CPA_SOURCE["version"]
CPA_COMMIT = CPA_SOURCE["commit"]
-BUILD_LOCK_FDS = ()
BUILD_LOG = None
BUILD_TIMINGS = []
@@ -36,7 +35,7 @@ def run(*args, cwd=REPO, env=None, timeout=None):
print(f"Running {Path(args[0]).name} {' '.join(args[1:3])}", file=sys.stderr, flush=True)
started = time.monotonic()
result = subprocess.run(args, cwd=cwd, env=env, text=True, timeout=timeout,
- pass_fds=BUILD_LOCK_FDS, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
BUILD_TIMINGS.append({"command": list(args[:3]), "seconds": round(time.monotonic() - started, 3),
"exit_code": result.returncode})
if BUILD_LOG is not None:
@@ -363,7 +362,6 @@ def build(args):
def main():
- global BUILD_LOCK_FDS
parser = argparse.ArgumentParser(description=__doc__)
commands = parser.add_subparsers(dest="command", required=True)
create = commands.add_parser("build")
@@ -382,8 +380,7 @@ def main():
# Start the cache server before children inherit the shared lock FDs.
run("sccache", "--show-stats")
local = module("desktop_package_local_rust", "local-rust.py")
- with local.Store().locked(REPO) as handles:
- BUILD_LOCK_FDS = tuple(handle.fileno() for handle in handles)
+ with local.Store().locked(REPO):
result = build(args)
(Path(result["app"]).parent / "result.json").write_text(json.dumps(result, indent=2) + "\n")
elif args.command == "verify-dmg":
diff --git a/scripts/test-package-desktop.py b/scripts/test-package-desktop.py
index 29a80a79..2a96123f 100644
--- a/scripts/test-package-desktop.py
+++ b/scripts/test-package-desktop.py
@@ -35,6 +35,14 @@ class BundleIdentityTests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, "patch checksum mismatch"):
builder.pinned_source()
+ def test_build_children_do_not_inherit_validation_lock_descriptors(self):
+ completed = package.subprocess.CompletedProcess(
+ ["fixture"], 0, stdout="ok\n", stderr=""
+ )
+ with patch.object(package.subprocess, "run", return_value=completed) as invoked:
+ self.assertEqual(package.run("fixture"), "ok")
+ self.assertNotIn("pass_fds", invoked.call_args.kwargs)
+
def test_final_signed_bytes_verified_and_resigning_rejected(self):
package.verify_contents(self.app, self.manifest)
self.cpa.write_bytes(b"signed again")