fix(cli): surface compose-flags resolver failures instead of silencing them#1925
Open
w3-surfer wants to merge 1 commit into
Open
fix(cli): surface compose-flags resolver failures instead of silencing them#1925w3-surfer wants to merge 1 commit into
w3-surfer wants to merge 1 commit into
Conversation
…g them _regenerate_compose_flags ran resolve-compose-stack.sh with 2>/dev/null and deleted .compose-flags on failure. The resolver already prints an actionable diagnosis (for example "ERROR: PyYAML is required ..." plus the install command), but the CLI discarded it, so the real failure only surfaced two commands later as compose's "no configuration file provided: not found" with no hint of the cause. Capture the resolver's stderr and print it after a warning that names the consequence, so `ods enable` reports why `ods start` is about to fail. Successful runs are unchanged: stdout still goes to .compose-flags and nothing is printed. Also correct the service-registry warning, which said only "Service registry will be incomplete" while lifecycle commands actually break. Fixes Osmantic#1876 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
@nolanmak thanks for the precise diagnosis here, it made this a quick fix. If you were already planning to take it yourself, say the word and I'll close this in favor of yours. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1876.
Problem
_regenerate_compose_flagsinods-cliran the resolver with stderr discarded, and removed the cache on failure:resolve-compose-stack.shalready prints an actionable diagnosis when it can't run:but
2>/dev/nullthrew it away. As reported in the issue,ods enable <ext>then appeared to succeed and the real failure only surfaced two commands later as compose'sno configuration file provided: not found, with no hint of the cause.Fix
Capture the resolver's stderr and print it after a warning that names the consequence, so the failure is reported where it happens:
The
2>&1 > fileordering keeps stdout going to.compose-flagsand captures only stderr, so successful runs behave exactly as before.Also corrected the
lib/service-registry.shwarning, which said only "Service registry will be incomplete" while lifecycle commands actually break. It now states thatods enable/ods startwill fail.Verification
Extracted the real function and ran it against a stub resolver covering both paths:
Resolver fails (stub reproduces the PyYAML error):
Resolver succeeds: stderr empty,
.compose-flagscontains-f docker-compose.base.yml -f docker-compose.nvidia.yml.bash -npasses on both files.Out of scope
The issue also suggests a host-Python PyYAML preflight check on the macOS install path. That is a larger, separate change and is not included here.