From 43597868a60ec6fefee7d4dae667bfd83cb37d7b Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Tue, 4 Aug 2026 17:28:12 -0500 Subject: [PATCH] Guard vendoring template's lint.mk include against tarball builds cat_tools PR #80 (Postgres-Extensions/cat_tools) hit this: a git-archive tarball (what `make dist`/PGXN release archives use) has no .git and no submodule content, so the unconditional include tried to auto-init .vendor/linter and aborted the whole Makefile parse -- breaking `make` and `make install`, not just `make lint`. Wrap the template in ifneq ($(wildcard .git),) so consumers copying this README's example don't hit the same bug. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 10e66b7..c55be4f 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,19 @@ That hand-off file is the entire API — nothing else needs to be copied: # lint.mk — thin wrapper; the whole local footprint for consuming # https://github.com/Postgres-Extensions/linter. Everything else lives in # the .vendor/linter submodule; see its README for available targets/rules. +# +# Guarded by $(wildcard .git) so `make dist`/PGXN release tarballs (built via +# `git archive`, which strips .git and submodule content entirely) don't try +# to init the submodule and abort the whole Makefile parse -- `make lint` +# just becomes unavailable there, which is fine since PGXN consumers don't +# need it. Matches both a real .git directory (plain clone) and the .git +# file pointer used inside a git worktree. +ifneq ($(wildcard .git),) .vendor/linter/lint.mk: git submodule update --init -- .vendor/linter include .vendor/linter/lint.mk +endif ``` Add the submodule once: