diff --git a/.gitmodules b/.gitmodules index 7510d1a707b74..9051680962f18 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,3 +29,6 @@ [submodule "pglite/other_extensions/pgmq"] path = pglite/other_extensions/pgmq url = https://github.com/pgmq/pgmq +[submodule "pglite/other_extensions/plpgsql_check"] + path = pglite/other_extensions/plpgsql_check + url = https://github.com/okbob/plpgsql_check.git diff --git a/pglite/other_extensions/Makefile b/pglite/other_extensions/Makefile index 601f0ffb12545..31d7e8dbd2c95 100644 --- a/pglite/other_extensions/Makefile +++ b/pglite/other_extensions/Makefile @@ -9,7 +9,8 @@ SUBDIRS = \ pg_uuidv7 \ pg_hashids \ pg_textsearch \ - pgmq/pgmq-extension + pgmq/pgmq-extension \ + plpgsql_check prefix ?= /pglite EXTENSIONS_BUILD_ROOT := /tmp/extensions/build @@ -33,6 +34,21 @@ dist: $(addsuffix .tar.gz,$(EXTENSIONS)) files=$$(find . -type f -o -type l | sed 's|^\./||') && \ tar -czf $(ARCHIVE_DIR)/$$(basename $*)\.tar.gz $$files +# plpgsql_check's upstream Makefile hardcodes -g; strip the debug info at +# packaging time (instead of patching the submodule) to keep the .so small +# and avoid shipping DWARF sections. +plpgsql_check.tar.gz: + @echo "=== Staging plpgsql_check ===" + rm -rf $(EXTENSIONS_BUILD_ROOT)/plpgsql_check + bash -c 'mkdir -p $(EXTENSIONS_BUILD_ROOT)/plpgsql_check/$(prefix)/{bin,lib,share/extension,share/doc,share/postgresql/extension,share/postgresql/tsearch_data,include}' + $(MAKE) -C plpgsql_check install DESTDIR=$(EXTENSIONS_BUILD_ROOT)/plpgsql_check + emstrip --strip-debug $(EXTENSIONS_BUILD_ROOT)/plpgsql_check/$(prefix)/lib/postgresql/plpgsql_check.so + @echo "=== Packaging plpgsql_check ===" + mkdir -p $(ARCHIVE_DIR) + cd $(EXTENSIONS_BUILD_ROOT)/plpgsql_check/$(prefix) && \ + files=$$(find . -type f -o -type l | sed 's|^\./||') && \ + tar -czf $(ARCHIVE_DIR)/plpgsql_check.tar.gz $$files + # AGE requires SIZEOF_DATUM=4 for 32-bit WASM compatibility (strips PASSEDBYVALUE from graphid) age.tar.gz: @echo "=== Staging age (with 32-bit support) ===" diff --git a/pglite/other_extensions/plpgsql_check b/pglite/other_extensions/plpgsql_check new file mode 160000 index 0000000000000..7e1d6fcc6d3d5 --- /dev/null +++ b/pglite/other_extensions/plpgsql_check @@ -0,0 +1 @@ +Subproject commit 7e1d6fcc6d3d5d5fd83337ea6a07003ddcaa3bf3