Repository navigation
Conversation
| sudo mport install pkgconf brotli libnghttp2 ${MATRIX_INSTALL} | grep -v -E '(Downloading.+%|^/usr/local)' || true | ||
| log=$(mktemp) || exit $? | ||
| sudo mport install pkgconf brotli libnghttp2 ${MATRIX_INSTALL} > "${log}" 2>&1 || true | ||
| # mport can return nonzero after success; check installed packages. |
There was a problem hiding this comment.
Is this simply the case? That explains a lot.
| sudo mport install pkgconf brotli libnghttp2 ${MATRIX_INSTALL} > "${log}" 2>&1 || true | ||
| # mport can return nonzero after success; check installed packages. | ||
| missing='' | ||
| for package in pkgconf brotli libnghttp2 ${MATRIX_INSTALL}; do |
There was a problem hiding this comment.
I don't like the package list being duplicated here.
| done | ||
| if [ -n "${missing}" ]; then | ||
| cat "${log}" | ||
| rm -f "${log}" |
There was a problem hiding this comment.
This isn't really needed; the container will be destroyed in a moment already.
| echo "Missing prerequisites:${missing}" >&2 | ||
| exit 1 | ||
| fi | ||
| grep -v -E '(Downloading.+%|^/usr/local)' "${log}" || true |
There was a problem hiding this comment.
The grep will always succeed if we make it here, right? Then the || true can be dropped.
| sudo mport upgrade | grep -v -E '(Downloading.+%|^/usr/local)' | ||
| fi | ||
| sudo mport install pkgconf brotli libnghttp2 ${MATRIX_INSTALL} | grep -v -E '(Downloading.+%|^/usr/local)' || true | ||
| log=$(mktemp) || exit $? |
There was a problem hiding this comment.
The exit shouldn't be needed here; the error status should already cause the workflow to fail.
| if [ -n "${missing}" ]; then | ||
| cat "${log}" | ||
| rm -f "${log}" | ||
| echo "Missing prerequisites:${missing}" >&2 |
There was a problem hiding this comment.
This could be simplified by checking immediately after each mport info command rather than storing a list of failures in $missing. The exact packages having failed aren't that interesting, only that at least one has failed. The log will show everything once it's cat'ed.
|
Hi there! I updated the workflow in f222215]
I kept I also confirmed that I tested the revised block on MidnightBSD 4.0.4: installed prerequisites passed, and a nonexistent prerequisite failed as expected. Changed test to workflow for accuracy, added I before tested, and formatted commands as code. |
|
My (non-LLM), one-liner proposal: #23294 |
MidnightBSD CI can continue after a prerequisite fails to install, producing a misleading error later, such as
cmake: not found. Sincemportalso returns nonzero after successful installations, check that every requested package is installed usingmport -U info.If a package is missing, print the installation log, list the missing prerequisites, and stop the job.
Fixes #23291
Validation on MidnightBSD 4.0.4:
git diff --checkpassed.Full GitHub Actions execution and an actual download failure remain untested.
AI disclosure: Codex helped investigate, implement, and test this change. I’m responsible for the contribution.