Title: fix(ci): stop the layer-cache prune from being able to fail a build by waleedlatif1 · Pull Request #7252 · simstudioai/sim · GitHub
Open Graph Title: fix(ci): stop the layer-cache prune from being able to fail a build by waleedlatif1 · Pull Request #7252 · simstudioai/sim
X Title: fix(ci): stop the layer-cache prune from being able to fail a build by waleedlatif1 · Pull Request #7252 · simstudioai/sim
Description: Summary The settle loop added in 4f651038f3 reads cur="$(total)". Composite steps run under bash -e -o pipefail, where an assignment takes its command substitution's exit status — so any failing buildctl du aborts the step and fails the build. Reproduced directly: set -e -o pipefail total() { false | grep -iE '^total:' | tr -s ' ' ' '; } echo "echo form: $(total)" # survives cur="$(total)" # ABORTS, exit 1 That asymmetry is why it was invisible: the echo "$(total)" calls run first and survive, and only the assignment inside the settle loop trips it. Not hypothetical. Deleting a sticky disk out from under a running job makes buildkitd panic inside cache.(*cacheManager).DiskUsage, and it took a Build AMD64 job down exactly this way: panic: runtime error: invalid memory address or nil pointer dereference github.com/moby/buildkit/cache.(*cacheManager).DiskUsage(...) grep also exits 1 whenever du prints no Total: line, so a genuinely empty cache would have done it too. Fix total() now always returns 0. Cache hygiene must never be able to fail a deploy. The prune's own failure was already handled correctly — it sits in an if condition, and a failing condition does not trip -e. Verification Reproduced the abort and confirmed the fix under the exact shell flags GitHub uses (bash -e -o pipefail): the settle loop now completes with a totally failing du. shellcheck clean; actionlint identical to the staging baseline; bun run lint passes. Type of Change Bug fix Testing Shell-level reproduction of both the failure and the fix, as above. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary The settle loop added in 4f651038f3 reads cur="$(total)". Composite steps run under bash -e -o pipefail, where an assignment takes its command substitution's exit status — so ...
X Description: Summary The settle loop added in 4f651038f3 reads cur="$(total)". Composite steps run under bash -e -o pipefail, where an assignment takes its command substitution's exit ...
Opengraph URL: https://github.com/simstudioai/sim/pull/7252
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e071324e-c274-6e72-a917-3ec661065999 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AD52:2F2AB3:1987BF2:22CCF4F:6AFB8997 |
| html-safe-nonce | 3adfa43574be8638ef9096d125077f9640a09be157880d4658c9ac6fd39dda93 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDUyOjJGMkFCMzoxOTg3QkYyOjIyQ0NGNEY6NkFGQjg5OTciLCJ2aXNpdG9yX2lkIjoiNTMyNTU0MzEwMjc0MjIzNTU0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cbf59cfed72ab9adc60123ccb3838349202b7e4e5721f014fe37545f63c61cfc |
| hovercard-subject-tag | pull_request:4389530646 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/7252/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary The settle loop added in 4f651038f3 reads cur="$(total)". Composite steps run under bash -e -o pipefail, where an assignment takes its command substitution's exit status — so ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9694464143465782ecae2a97650b2a2b0708d5c31c74f41ee86da57e315e2735 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 05d967182208691fc7f2e6af52e82fa7fabf6bd5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width