Skip to content

Fix order-only SRVPGM prerequisites never reaching BNDSRVPGM (path 1 of #566) - #569

Closed
saschollen-harris wants to merge 1 commit into
IBM:masterfrom
saschollen-harris:fix-bndsrvpgm-order-only-566
Closed

saschollen-harris wants to merge 1 commit into
IBM:masterfrom
saschollen-harris:fix-bndsrvpgm-order-only-566

Conversation

@saschollen-harris

@saschollen-harris saschollen-harris commented Sep 11, 2026 •

Copy link
Copy Markdown

Summary

  • MODULE_TO_PGM_RECIPE and BND_TO_SRVPGM_RECIPE in src/mk/def_rules.mk both call PGM_VARIABLES/SRVPGM_VARIABLES (which compute BNDSRVPGMPATH from $(externalsrvpgms)) before externalsrvpgms is actually assigned from the order-only prerequisite list ($|). So an order-only *SRVPGM prerequisite like | /QSYS.LIB/QICSS.LIB/QYCDCUSG.SRVPGM was always silently dropped, rendering bndsrvpgm(*NONE) regardless — even though the diagnostic echo_cmd line right above it reads $| directly and reports the service program as if it were included, so the build's own log contradicted the command it ran.
  • Fix: move the $(eval externalsrvpgms := ...) assignment to before the PGM_VARIABLES/SRVPGM_VARIABLES call in each recipe. The qualifying transform itself ($(subst .LIB,,$(subst /QSYS.LIB/,,$|)), which correctly turns /QSYS.LIB/QICSS.LIB/QYCDCUSG.SRVPGM into qualified QICSS/QYCDCUSG.SRVPGM) was already right — it was just unreachable.
  • This is path 1 only of Cannot bind an external qualified service program to a .PGM: the order-only prerequisite path is dead code, and the regular-prerequisite path strips the library qualifier #566. Path 2 (regular prerequisites losing their library qualifier via $(notdir $^)) is intentionally left untouched — fixing it would change existing BNDSRVPGM(...) output for locally-built service programs too, which the issue itself flags as a separate, higher-risk decision.

Addresses part of #566 — path 1 only. Path 2 remains open and is intentionally not addressed by this PR; please don't auto-close #566 on merge.

Test plan

  • Verified against a real project (FTPSAUD) that needed to bind an external, not-TOBi-built service program (QICSS/QYCDCUSG) to a .PGM target. With the patched def_rules.mk, using:
    FTPSAUD.PGM: CERTINV.MODULE DCMAPIS.MODULE FTPSAUD.MODULE | /QSYS.LIB/QICSS.LIB/QYCDCUSG.SRVPGM
    the build produced:
    crtpgm pgm(FTPSAUD/FTPSAUD) module(CERTINV DCMAPIS FTPSAUD) bndsrvpgm(QICSS/QYCDCUSG) ...
    ✓ FTPSAUD.PGM was created successfully!
    
    — qualified, matching what the diagnostic echo had always (incorrectly) claimed.
  • This project had previously worked around the bug with a POSTCMD override producing the same qualified BNDSRVPGM; this fix makes that workaround unnecessary, and it's been removed from the project's Rules.mk.
  • No automated test exists for def_rules.mk macro definitions (nothing in the repo invokes real make against these macros), so verification was manual, consistent with docs/contributing/testing.md's existing approach for makei/build changes.

See agent-os/specs/2026-09-10-1942-fix-bndsrvpgm-order-only-566/ in this PR for full shaping notes and references.

cc @nehab7 @VyshnaviKB

IBM#566)

MODULE_TO_PGM_RECIPE and BND_TO_SRVPGM_RECIPE both called PGM_VARIABLES/
SRVPGM_VARIABLES (which compute BNDSRVPGMPATH from $(externalsrvpgms))
before externalsrvpgms was actually assigned from the order-only
prerequisite list ($|). So an order-only *SRVPGM prerequisite was always
silently dropped, rendering bndsrvpgm(*NONE) regardless. Moving the
externalsrvpgms assignment before the *_VARIABLES call fixes this -- the
qualifying transform there was already correct, just unreachable.

Path 2 of IBM#566 (regular prerequisites stripping the library qualifier via
$(notdir $^)) is intentionally left untouched; it's a separate,
higher-risk decision since it'd change existing output for locally-built
service programs too.

Fixes IBM#566 (partially -- path 1 only)

Signed-off-by: Scott Schollenberger <89707936+Saschollen@users.noreply.github.com>
@saschollen-harris
saschollen-harris force-pushed the fix-bndsrvpgm-order-only-566 branch from fb6e97a to 53172c1 Compare October 12, 2026 21:08
@VyshnaviKB

Copy link
Copy Markdown
Collaborator

Thanks @saschollen-harris for the PR , We were unable to update the branch and change logs, so we created a new PR #587 with the same changes. We’ll proceed with merging the new PR and closing this one.

1 similar comment
@VyshnaviKB

Copy link
Copy Markdown
Collaborator

Thanks @saschollen-harris for the PR , We were unable to update the branch and change logs, so we created a new PR #587 with the same changes. We’ll proceed with merging the new PR and closing this one.

@VyshnaviKB VyshnaviKB closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants