Skip to content

pg_autoctl: relocate vendored pg_receivewal to src/bin/common - #1194

Merged
dimitri merged 1 commit into
mainfrom
vendor-pg_receivewal-relocation
Sep 27, 2026
Merged

dimitri merged 1 commit into
mainfrom
vendor-pg_receivewal-relocation

Conversation

@dimitri

@dimitri dimitri commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Pure build-only relocation, split out of #1193 for isolated review before that
PR rebases on top of it.

pg_walserver's own embedded pull capturer (landing later in #1193) needs to
fork and call pg_receivewal_main() in-process, exactly like pg_autoctl's
service_archiver_pgreceivewal_ctl.c already does -- so the vendored
pg_receivewal sources move to src/bin/common/vendor/pg_receivewal/, the
same relocation fetch_client.c already went through earlier in this same
PR, so both binaries build the identical sources instead of duplicating them.

src/bin/common/Makefile.common now owns the shared include path and the
pgrw-*.o object build rule (named pgrw-*, not vendor-*, so it can never
collide with a caller's own vendor-%.o: .../vendor/%.c pattern rule, e.g.
pg_walserver's own vendor/tar.c); pg_autoctl's Makefile drops its own
copy of that rule and links the shared PG_RECEIVEWAL_VENDOR_OBJS instead.
.gitattributes' -citus-style exceptions and one header comment follow the
files to their new path.

No behavior change: pg_autoctl still builds and links exactly the same
object code as before. Verified with a clean docker build --target run
(zero warnings) and citus_indent --check/ci/banned.h.sh both clean.

pg_walserver's own embedded pull capturer (a following commit) needs to
fork and call pg_receivewal_main() in-process, exactly like pg_autoctl's
service_archiver_pgreceivewal_ctl.c already does -- so the vendored
pg_receivewal sources move to src/bin/common/vendor/pg_receivewal/, the
same relocation fetch_client.c already went through in this PR, so both
binaries build the identical sources instead of duplicating them.

Build-only move: Makefile.common now owns the shared include path and
the pgrw-*.o object build rule (named pgrw-*, not vendor-*, so it can
never collide with a caller's own "vendor-%.o: .../vendor/%.c" pattern
rule, e.g. pg_walserver's own vendor/tar.c); pg_autoctl's Makefile drops
its own copy of that rule and links the shared PG_RECEIVEWAL_VENDOR_OBJS
instead. .gitattributes' -citus-style exceptions and one header comment
follow the files to their new path. No behavior change; pg_autoctl still
builds and links exactly the same object code as before.
@dimitri
dimitri merged commit 4af4938 into main Sep 27, 2026
147 of 148 checks passed
@dimitri
dimitri deleted the vendor-pg_receivewal-relocation branch September 27, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant