From cbd156907033c6164a1f12fdab917a1d65381893 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 5 Oct 2026 05:12:26 -0500 Subject: fix(make): keep elpa bytecode out of clean-compiled - clean-compiled deleted every .elc in the tree, elpa included. - make clean runs it, so each clean wiped package bytecode. - Nothing here rebuilds it, so packages loaded from source. - Source loads skip native-comp JIT and slow startup. - Emacs 31 also warns per cookie-less file loaded from source. - I made the find skip elpa/ and quote its start point. - New tests run the real target against a throwaway home. - A dry run must show the temp path first. --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fd759f30..920933a7 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ # make telega-image - Build the telega-server container image # make profile - Profile Emacs startup performance # make clean - Remove test artifacts and compiled files -# make clean-compiled - Remove .elc/.eln files only +# make clean-compiled - Remove .elc/.eln files only (keeps elpa/) # make clean-tests - Remove test artifacts only # make reset - Reset to first launch (destructive!) @@ -106,7 +106,7 @@ help: @echo " make telega-image - Build the telega-server container image" @echo " make profile - Profile Emacs startup performance" @echo " make clean - Remove test artifacts and compiled files" - @echo " make clean-compiled - Remove .elc/.eln files only" + @echo " make clean-compiled - Remove .elc/.eln files only (keeps elpa/)" @echo " make clean-tests - Remove test artifacts only" @echo " make reset - Reset to first launch (DESTRUCTIVE!)" @echo "" @@ -494,9 +494,13 @@ task-sorted: clean: clean-tests clean-compiled @echo "✓ Clean complete" +# elpa/ is excluded: package.el owns that bytecode and nothing here rebuilds it. +# Without it every package loads from source, slower and with no native-comp +# JIT, and Emacs 31 warns about each file lacking a lexical-binding cookie. clean-compiled: @echo "Removing compiled files (.elc, .eln)..." - @find $(EMACS_HOME) -type f \( -name "*.eln" -o -name "*.elc" \) -delete + @find "$(EMACS_HOME)" -type f \( -name "*.eln" -o -name "*.elc" \) \ + -not -path "$(patsubst %/,%,$(EMACS_HOME))/elpa/*" -delete @echo "✓ Compiled files removed" clean-tests: -- cgit v1.2.3