From 2c66959a3f8af9117a96b96da32920fd8b52736a Mon Sep 17 00:00:00 2001 From: Eval Exec Date: Tue, 22 Sep 2026 09:27:31 -0400 Subject: [PATCH] fix(melpa): serialize forge's sqlite3 module build across the oracle's two editors The batch oracle evaluates GNU Emacs and Neovm concurrently (thread::scope in run_elisp_oracle_batch) against one shared prepared package tree. forge's dependency sqlite3 lazily compiles its native module (sqlite3-api.so) in that tree on first load, and each make run deletes the intermediate sqlite3-api.o after linking. With both builds running on a cold cache, one editor's cleanup removes the .o between the other's compile and link, so the slower link fails: Building sqlite3-api module with "make all" Failed to compile module using: make all: ... ld.bfd: cannot find sqlite3-api.o: No such file or directory The race is nondeterministic and can hit either editor, which is why forge surfaced as an intermittent RestartProbe exit 255. Point SQLITE3_API_BUILD_COMMAND at flock -w 600 /tmp/forge-sqlite3-build.lock make all so the first build completes before the second make runs; the second then observes an up-to-date module and both editors load the same .so. Melpa sweep locally: 939/942. --- crates/neomacs-melpa-tests/src/parity_tests/forge.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/neomacs-melpa-tests/src/parity_tests/forge.rs b/crates/neomacs-melpa-tests/src/parity_tests/forge.rs index 72fee0f8d5..c6aed71d55 100644 --- a/crates/neomacs-melpa-tests/src/parity_tests/forge.rs +++ b/crates/neomacs-melpa-tests/src/parity_tests/forge.rs @@ -7,6 +7,15 @@ use crate::{CachedMelpaOracle, FORGE_MELPA_PIN}; use super::batch_support::{ParityBatchCase, assert_oracle_batch_cases}; const PRELUDE: &str = r####" +;; sqlite3.el lazily compiles its native module inside the shared +;; prepared package tree, and the batch oracle evaluates GNU Emacs and +;; Neovm concurrently against that same tree. Serialize the two builds; +;; make deletes the intermediate sqlite3-api.o after linking, so two +;; unsynchronized builds race on it and the slower link fails. +(setenv "SQLITE3_API_BUILD_COMMAND" + (format "flock -w 600 %s make all" + (expand-file-name "tmp/forge-sqlite3-build.lock" + (getenv "NEOMACS_TEST_WORKSPACE_ROOT")))) (setq forge-add-default-sections nil forge-add-default-bindings nil) (defvar neomacs-forge-test-original-max-lisp-eval-depth