Skip to content

check-stale-expected's installcheck dependency can run installcheck before install on a fresh tree #79

Description

@jnasbyupgrade

2.2.0's `check-stale-expected: installcheck` (base.mk) creates an explicit ordering edge, but `check-stale-expected` is appended to `TEST_DEPS` before `test-build`/`install`/`installcheck` are appended. When `test: $(TEST_DEPS)` is resolved left to right, Make reaches `check-stale-expected` first, which pulls in `installcheck` as its prerequisite -- and `installcheck`'s own rule does not depend on `install`. On a tree where the extension isn't already installed (a fresh checkout, e.g. CI), this runs the full pg_regress suite against a database where `CREATE EXTENSION` never happened, so every test that touches the extension fails with "schema ... does not exist" -- before `TEST_DEPS`'s own later `install installcheck` pair (and `test-build`'s `install` prerequisite) ever run.

Reproduced with cat_tools (Postgres-Extensions/cat_tools) on a fresh CI checkout after syncing to pgxntool 2.2.0: https://github.com/Postgres-Extensions/cat_tools/actions/runs/30493836900/job/90717960885. The extension's own dev environment didn't catch this because a previously-installed extension on disk masked the missing `install` step; a truly fresh tree (or `make clean && make uninstall` first) reproduces it reliably.

Suggested fix: either give `installcheck` itself an `install` prerequisite in base.mk (so every caller gets the guarantee, not just ones that add it defensively), or move the `TEST_DEPS = testdeps` / feature-append block so `check-stale-expected` is appended after `test-build`/`install`/`installcheck`, matching the real intended run order.

Workaround applied in cat_tools meanwhile: Postgres-Extensions/cat_tools#51 adds an explicit `install` prerequisite to its own `installcheck` rule in `sql.mk`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions