From b70153866da07a53be0ad37502962bb6e1adab7f Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Fri, 31 Jul 2026 18:42:02 -0500 Subject: [PATCH] sql.mk: remove now-redundant historical_installs derivation pgxntool issue #48 (filed citing cat_tools' own workaround as an example) was that base.mk's DATA wildcard only matched sql/*--*--*.sql (upgrade scripts, two dashes), silently skipping historical single-dash full-install scripts like sql/cat_tools--0.1.0.sql. pgxntool 2.3.0 fixed this by widening the wildcard to sql/*--*.sql, which matches both. Our historical_installs variable was a generalized version of that exact workaround (deriving the committed, non-.sql.in-backed cat_tools--0.1.*.sql files), now fully superseded: base.mk's own DATA wildcard already includes them at parse time, since these files are committed directly and are always present regardless of build state (unlike the generated versioned/upgrade files, which is a separate, still-needed derivation here for a different reason -- cat_tools issue #28's two-phase-make timing gap, unaffected by pgxntool's dash-count fix). Verified on a truly clean tree (make clean, only committed .sql present): make -s print-DATA lists all 8 historical cat_tools--0.1.*.sql files without this derivation, make install places them in the real extension directory, and make test / verify-results / test-update all still pass. --- sql.mk | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sql.mk b/sql.mk index 60663c4..9e55749 100644 --- a/sql.mk +++ b/sql.mk @@ -49,23 +49,17 @@ versioned_out = $(subst .sql.in,.sql,$(versioned_in)) # glob misses the generated ones on a clean tree (see header), so add by name. upgrade_scripts_out = $(subst .sql.in,.sql,$(wildcard sql/*--*--*.sql.in)) -# -# Historical install scripts committed directly as .sql with no .sql.in (the -# frozen cat_tools--0.1.* set; see sql/.gitignore). Globbing committed files is -# safe. Derive rather than hardcode: take every install-shaped .sql, then drop -# the update scripts and everything we generate from .sql.in. Parse-stable (the -# subtracted names are name-derived), and picks up new historical files auto. -historical_installs = $(filter-out $(versioned_out) $(wildcard sql/*--*--*.sql), $(wildcard sql/*--*.sql)) - # # DATA -- the INSTALL manifest: what `make install` copies into the extension # dir. Installed != committed. The versioned .sql (install and update scripts) # are BUILT from the committed .sql.in at build time and installed, but are # gitignored, not tracked -- only the .sql.in are. The historical -# cat_tools--0.1.*.sql are the exception: committed directly (no .sql.in source). -# base.mk only seeds DATA; we append here. +# cat_tools--0.1.*.sql are the exception: committed directly (no .sql.in source), +# so they're always present at Make's parse time regardless of build state -- +# base.mk's own DATA wildcard (sql/*--*.sql, widened in pgxntool 2.3.0 to match +# both dash counts) already picks them up on its own; we don't need to add them +# again. base.mk only seeds DATA; we append here. # -DATA += $(historical_installs) # Generated install scripts, minus the current-version file # (EXTENSION__CURRENT_VERSION__FILES, from control.mk) and the update scripts. DATA += $(filter-out $(EXTENSION__CURRENT_VERSION__FILES) $(upgrade_scripts_out), $(versioned_out))