config: surface real make-uncompress failures, drop dead try/except#112
Merged
config: surface real make-uncompress failures, drop dead try/except#112
Conversation
Previously uncompress_gds() called subprocess.run without check=True so its except CalledProcessError block was dead code, and stderr/stdout went into PIPE and were thrown away. When `make uncompress` failed (e.g. on Fargate under disk pressure for a large repo) cf-precheck silently swallowed the real error and emitted only the misleading downstream "A single valid GDS was not found" message — see chipfoundry/cf-cli#20 where users blamed LFS. Now: judge by post-condition (gds/*.gds files in the working tree) since caravel-lite's Makefile legitimately exits non-zero on the mag/ step *after* the gds/ step completes, and we don't want that benign failure to fail the whole precheck. If gds/ ends up populated, log INFO with the file list + make's exit code and continue. If empty, log CRITICAL with returncode + stderr tail (4000 chars) + stdout tail (200 chars) so the operator can see exactly why make couldn't produce the layouts. Fail with sys.exit(252). Per .cursor/rules/no-fallback-code.mdc. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Fixes the silent-fallback bug in
uncompress_gds()that caused chipfoundry/cf-cli#20 to look like an LFS bug when it wasn't. The previous implementation calledsubprocess.runwithoutcheck=Trueso itsexcept CalledProcessErrorblock was dead code, and stderr/stdout went into PIPE and were thrown away. Whenmake uncompressfailed (e.g. on Fargate under disk pressure for a large repo) cf-precheck silently swallowed the real error and emitted only the misleading downstream[CRITICAL] A single valid GDS was not foundmessage.Behavior
After running
make uncompress, judge by post-condition (presence ofgds/*.gdsfiles in the working tree) since caravel-lite's Makefile legitimately exits non-zero on themag/step after thegds/step succeeds — failing the whole precheck on that benign mag-step exit would be wrong.gds/*.gdspresent → log INFO with the produced file list and the make exit code, and continue (works for bothexit 0and benignexit 2).gds/*.gdsabsent and make exited non-zero → log CRITICAL withreturncode,stderrtail (4000 chars),stdouttail (200 chars). Exit 252.gds/*.gdsabsent and make exited zero → log CRITICAL "make uncompress reported success but produced no gds/*.gds files". Exit 252.gds/directory missing entirely → log CRITICAL. Exit 252.Per
.cursor/rules/no-fallback-code.mdc.Test plan
subprocess.runfor all 4 branches (success-with-mag-noise, real-failure, success-with-no-output, missing-dir):pytest tests/test_uncompress_gds.py -v— 4/4 pass.vyges/vyges-edge-sensor-soc@main(the repo in Precheck reporting SPDX exceptions for binary files #20). cf-precheck completed normally and wroteprecheck_results/.../precheck.loginstead of bailing in 501 ms. CloudWatch showsmake uncompress produced 9 gds/*.gds file(s) ...INFO line and no CRITICAL.make uncompress failed (exit N)message.Made with Cursor