plugins: neaten rust plugins, make them intermediate objects.
What changed, and why it matters
This commit is a minor cleanup of the build system for Rust-based plugins. It replaces several repetitive copy rules with a single pattern rule and marks the original compiled plugin files as intermediate build artifacts so they can be cleaned up automatically. There is no change to the actual plugin code, behavior, or security of the software.
No security action required. This is a routine build-system refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is confined to plugins/Makefile. It introduces RUST_PLUGIN_NAMES and RUST_PLUGINS variables, uses a GNU Make pattern rule (plugins/%: $(RUST_TARGET_DIR)/%) to copy built Rust plugin binaries into the plugins directory, and declares the source binaries as .INTERMEDIATE so Make removes them after the final targets are produced. No source code, plugin logic, permissions, or runtime behavior is modified.
Changed components
plugins/MakefileInspect captured patch +9 / −13
diff --git a/plugins/Makefile b/plugins/Makefile
index 8a01fa33..cda322ac 100644
--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -138,23 +138,19 @@ $(shell test -d plugins/clnrest && $(RM) -r plugins/clnrest || true)
$(shell test -d plugins/wss-proxy && $(RM) -r plugins/wss-proxy || true)
ifneq ($(RUST),0)
+RUST_PLUGIN_NAMES := cln-grpc clnrest cln-lsps-client cln-lsps-service wss-proxy cln-bip353
+
# Builtin plugins must be in this plugins dir to work when we're executed
# *without* make install.
-plugins/cln-grpc: $(RUST_TARGET_DIR)/cln-grpc
- @cp $< $@
-plugins/clnrest: $(RUST_TARGET_DIR)/clnrest
- @cp $< $@
-plugins/cln-lsps-client: $(RUST_TARGET_DIR)/cln-lsps-client
- @cp $< $@
-plugins/cln-lsps-service: $(RUST_TARGET_DIR)/cln-lsps-service
- @cp $< $@
-plugins/wss-proxy: $(RUST_TARGET_DIR)/wss-proxy
- @cp $< $@
-plugins/cln-bip353: $(RUST_TARGET_DIR)/cln-bip353
+RUST_PLUGINS := $(addprefix plugins/,$(RUST_PLUGIN_NAMES))
+$(RUST_PLUGINS): plugins/%: $(RUST_TARGET_DIR)/%
@cp $< $@
-PLUGINS += plugins/cln-grpc plugins/clnrest plugins/cln-lsps-client plugins/cln-lsps-service plugins/wss-proxy plugins/cln-bip353
-endif
+PLUGINS += $(RUST_PLUGINS)
+
+# You don't need the originals if you have the final ones.
+.INTERMEDIATE: $(RUST_PLUGIN_NAMES:%=$(RUST_TARGET_DIR)/%)
+endif # RUST
include plugins/askrene/Makefile
include plugins/bkpr/Makefile
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.