From 75198a74bfd9c50b29b13b2d9a3205504a13c4ef Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 1 Jul 2026 21:49:18 -0400 Subject: fix(native-comp): compile at speed 2 to preserve redefinition semantics At speed 3 the native compiler emits direct calls for functions in the same compilation unit, bypassing the symbol's function cell. Any cl-letf mock of a module's own helper then silently runs the real code: the recording tests' mocked wayland check and device validation were bypassed, and make test launched real wf-recorder screen captures. Speed 2 is the highest level that preserves redefinition semantics. A meta test now pins the setting; the local eln cache needs one flush so stale speed-3 artifacts recompile. --- modules/system-defaults.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/system-defaults.el b/modules/system-defaults.el index c63ca009..7f369a5e 100644 --- a/modules/system-defaults.el +++ b/modules/system-defaults.el @@ -40,7 +40,13 @@ (with-eval-after-load 'comp-run (setopt native-comp-async-jobs-number 8) ; parallel compile workers - (setopt native-comp-speed 3) ; highest optimization level + ;; Speed 2, not 3: at speed 3 the native compiler emits direct calls for + ;; functions in the same compilation unit, bypassing the function cell. + ;; cl-letf mocks of a module's own helpers then silently run the real + ;; code — on 2026-07-01 `make test' launched real wf-recorder screen + ;; recordings this way. Speed 2 is the highest semantics-preserving + ;; level. Guarded by tests/test-meta-native-comp-speed.el. + (setopt native-comp-speed 2) (setopt native-comp-always-compile t)) ; always native-compile ;; -------------------------- Log Native Comp Warnings ------------------------- -- cgit v1.2.3