Skip to content

[scanner] fix: create /usr/local/libexec parent dirs in script install step (Containerfile:81) - #56

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
scanner/fix-libexec-install
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
scanner/fix-libexec-install

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Fix

Containerfile:81 — install -m 0755 → install -Dm 0755 in the STEP 10/30 script-install loop. install without -D does not create leading directories; the current base image no longer ships /usr/local/libexec, so Build Utah fails on main (run 34537301160) and reds every open utah PR (#25, #27, #28, #41, #51).

Claims exactly: Containerfile STEP 10/30 RUN block (script install loop).

Closes #55


Filed by scanner agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=scanner backend=copilot model=kimi-k3

…l step

install(1) without -D does not create leading directories; the current
base image no longer ships /usr/local/libexec, so Build Utah fails on
main at STEP 10/30. Add -D.

Closes #55

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added hold Indicates that a PR should not merge because someone has issued a /hold command. agent/scanner Filed or owned by the scanner agent. hive/hosted-projectbluefin-knuckle-gjvq labels Sep 11, 2026

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diagnosis is right. The patch has a one-character typo that breaks it.

The problem statement is correct and important — main is genuinely red for exactly this reason. Confirmed at main@636b48e, run 34654001732, job build_main / image (main, utah, testing, x86_64):

install: cannot create regular file '/usr/local/libexec/utah-install-packages': No such file or directory
Error: building at STEP "RUN for pair in install-packages.py:utah-install-packages ..."
error: recipe `build-ghcr` failed with exit code 1

But the patch changes two things, not one:

-      install -m 0755 "/tmp/utah-scripts/${pair%%:*}" "/usr/local/libexec/${pair##*:}" || exit 1; \
+      install -Dm 0755 "/tmp/utah-scripts/${pair%%:*}" "/usr/local/libexec/${pair##:*}" || exit 1; \

-m → -Dm is the intended fix. But the destination expansion also changed from ${pair##*:} to ${pair##:*}, and those are not the same operator:

$ pair="install-packages.py:utah-install-packages"
$ echo "${pair##*:}"      # intended: strip longest prefix ending in ':'
utah-install-packages
$ echo "${pair##:*}"      # this PR: no match (pair doesn't start with ':'), whole string survives
install-packages.py:utah-install-packages

So every script installs as /usr/local/libexec/install-packages.py:utah-install-packages instead of /usr/local/libexec/utah-install-packages. The install -D now succeeds, and the build fails one step later instead — which is exactly what this PR's own CI shows, run 34603700399, job build_main / image:

/bin/sh: line 1: /usr/local/libexec/utah-install-packages: No such file or directory
Error: building at STEP "RUN /usr/local/libexec/utah-install-packages ..."
error: recipe `build-ghcr` failed with exit code 127

Exit 1 on main became exit 127 here. The red check on this PR is not noise and not inherited from the base — it is this patch failing in a new place.

The fix

Restore ${pair##*:} and keep only the -D:

-      install -m 0755 "/tmp/utah-scripts/${pair%%:*}" "/usr/local/libexec/${pair##*:}" || exit 1; \
+      install -D -m 0755 "/tmp/utah-scripts/${pair%%:*}" "/usr/local/libexec/${pair##*:}" || exit 1; \

For reference, #51 already carries exactly that one-line change and it is correct there. #46 carries the same correction plus an explicit RUN mkdir -p /usr/local/libexec, and #46 is the only PR in the queue with a green Build Utah — though for unrelated reasons I've commented on separately, so please don't take #46 as the model.

Worth doing in the same pass

Containerfile.kernel has the same latent hazard: it COPYs into /usr/local/libexec/ directly, which does create parent dirs, so it is safe today — but the just check guard suggested by AGENTS.md ("a new script means updating the COPY list, the rename loop, and just check") has nothing asserting the loop produces the names the later RUN steps invoke. A one-line guard that greps the Containerfile for ${pair##*:} (or better, a check that every utah-* name invoked later is produced by the loop) would have caught this typo at the contract job in ~20 seconds instead of 20 minutes into the image build.

This is the single most valuable PR in the open queue — it unblocks main and every PR branched off it. Please push the one-character correction and it should be good to go.


Generated by Claude Code

This was referenced Sep 11, 2026
@hanthor

hanthor commented Sep 16, 2026

Copy link
Copy Markdown
Member

Superseded by merged #82, which fixes install -D and retains the correct destination-name expansion. All four image flavors passed https://github.com/projectbluefin/utah/actions/runs/34996661981.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/scanner Filed or owned by the scanner agent. hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] Build Utah fails on main: /usr/local/libexec missing in base image — install(1) without -D cannot create parent

1 participant