Skip to content

debian: use $(CURDIR) in help2man PATH to fix intermittent build failure - #1722

Merged
dimitri merged 1 commit into
mainfrom
fix/debian-rules-curdir-path
Jun 23, 2026
Merged

dimitri merged 1 commit into
mainfrom
fix/debian-rules-curdir-path

Conversation

@dimitri

@dimitri dimitri commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Problem

override_dh_installman-arch locates the staged pgloader binary via a relative PATH:

PATH=debian/pgloader/usr/bin:$(PATH) \

dpkg-buildpackage can shift the working directory during dh sequence execution. When that happens, debian/pgloader/usr/bin resolves to nothing, help2man cannot exec pgloader --help, and exits 127:

help2man: can't get `--help' info from pgloader
Try `--no-discard-stderr' if option outputs to stderr
make[1]: *** [debian/rules:77: override_dh_installman-arch] Error 127

This is intermittent because push-event and PR-event jobs land on different GitHub-hosted runners with different working-directory state — one run passes while the other fails on the same commit.

Fix

Replace the relative path with $(CURDIR), which is a make variable that always expands to the build root regardless of working-directory shifts:

PATH=$(CURDIR)/debian/pgloader/usr/bin:$(PATH) \

This matches the pattern already used two lines above in override_dh_auto_test:

PATH=$(CURDIR)/build/bin:$(PATH) debian/tests/testsuite

Relation to PR #1711

PR #1711 fixed the first failure mode (binary not staged to debian/tmp/, so dh_install couldn't find it). This PR fixes the second failure mode (binary is staged but help2man can't find it due to relative PATH). Both are needed for a consistently green Debian build.

override_dh_installman-arch used a relative path to locate the staged
pgloader binary:

    PATH=debian/pgloader/usr/bin:$(PATH)

dpkg-buildpackage can shift the working directory during dh sequence
execution, causing the relative path to resolve to nothing.  help2man
then cannot exec pgloader and exits 127, failing the build.  The same
failure was observed on push-event runs while PR-event runs on different
runners passed, confirming it is runner/CWD-state-dependent.

Fix: use $(CURDIR) so the path is always absolute, matching the pattern
already used on the line above for override_dh_auto_test:

    PATH=$(CURDIR)/build/bin:$(PATH)
@dimitri
dimitri merged commit 50f2bdc into main Jun 23, 2026
3 checks passed
@dimitri
dimitri deleted the fix/debian-rules-curdir-path branch June 23, 2026 17:51
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