Fix ls error when no tar files exist in cache restore#170
Merged
awalsh128 merged 2 commits intoSep 30, 2025
Conversation
Co-authored-by: awalsh128 <2087466+awalsh128@users.noreply.github.com>
Copilot
AI
changed the title
[WIP]
Fix ls error when no tar files exist in cache restore
Sep 30, 2025
cannot access '/home/runner/cache-apt-pkgs/*.tar': No such file or directory
awalsh128
approved these changes
Sep 30, 2025
yicheng47
added a commit
to yicheng47/runner
that referenced
this pull request
May 13, 2026
The `@v1` moving alias resolves to v1.5.3 (annotated 2025-08-11) — six months stale by now. v1.6.0 (2025-10-15) includes the cache-restore fix in awalsh128/cache-apt-pkgs-action#170 ("Fix ls error when no tar files exist in cache restore"), plus a few other patches that look adjacent to the cold-path flakes we've been hitting. Pin to the explicit tag so future moves of `@v1` don't reintroduce behavior we haven't tested against. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
yicheng47
added a commit
to yicheng47/runner
that referenced
this pull request
May 13, 2026
…ress (#99) (#105) * fix(terminal): intercept WebKit keypress for Shift+Enter so it inserts newline The Shift+Enter handler returned false from the keydown but never suppressed the subsequent WebKit `keypress`, which xterm's `_keyPress` then emitted as `\r`. The agent CLI saw `\x1b\r` (newline) immediately followed by `\r` (submit), so the prompt submitted as if plain Enter were pressed. Drop the `e.type !== "keydown"` short-circuit so the custom handler returns false for both the keydown AND the keypress of Shift+Enter; gate the stdin injection on keydown so `\x1b\r` is emitted exactly once. Closes #99. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ci(backend): install Tauri Linux deps with apt-get directly `cache-apt-pkgs-action` wraps apt-fast/aria2 and intermittently hangs on `Clean installing 4 packages...` (observed multiple times, including on this PR — backend ran 14+ min with no progress before the cancel/rerun). The ~40s saved on a cache hit isn't worth the lost-run cost when it hangs. Drop the action and install the four webkit2gtk/gtk/appindicator/rsvg dev packages directly with `apt-get install --no-install-recommends`. Set `DEBIAN_FRONTEND=noninteractive` so a postinst can't block on a tty prompt, and `timeout-minutes: 5` on the step so a future apt-mirror flake fails fast instead of sitting for hours. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ci(backend): revert to cache-apt-pkgs-action, bound it with timeout-minutes The direct `apt-get install` path I switched to in 4441a4e doesn't work on this runner pool — Azure's Ubuntu mirror serves the 177 transitive deps slowly with multi-second `Ign:` retries, consistently blowing past 5 min before completing (observed on this PR: only 41 of ~179 packages downloaded in the timeout window). Go back to `awalsh128/cache-apt-pkgs-action@v1`, which caches the installed *filesystem* (not just .debs) and untars in ~3s on a hit. Add `timeout-minutes: 5` to the step so the rare cold-install hang on apt-fast/aria2 fails fast and a rerun fixes it, rather than sitting indefinitely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ci(backend): pin cache-apt-pkgs-action to v1.6.0 The `@v1` moving alias resolves to v1.5.3 (annotated 2025-08-11) — six months stale by now. v1.6.0 (2025-10-15) includes the cache-restore fix in awalsh128/cache-apt-pkgs-action#170 ("Fix ls error when no tar files exist in cache restore"), plus a few other patches that look adjacent to the cold-path flakes we've been hitting. Pin to the explicit tag so future moves of `@v1` don't reintroduce behavior we haven't tested against. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.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.
Fixes an issue where
restore_pkgs.shwould fail with "No such file or directory" error when attempting to restore cached packages but no.tarfiles were present in the cache directory.Problem
The issue occurred on line 43 of
restore_pkgs.sh:cached_filepaths=$(ls -1 "${cache_dir}"/*.tar | sort)When a cache hit occurred but no actual package
.tarfiles existed (only manifest files and other metadata), thelscommand would fail with:This scenario can happen in cases where:
Solution
Added stderr redirection to gracefully handle missing
.tarfiles:cached_filepaths=$(ls -1 "${cache_dir}"/*.tar 2>/dev/null | sort)Now when no
.tarfiles exist:cached_filepathsbecomes emptyTesting
Verified the fix works correctly in multiple scenarios:
.tarfiles: gracefully reports 0 packages restored.tarfiles: works normally as beforeThis is a minimal, surgical fix that preserves all existing functionality while resolving the error condition that was causing the action to fail silently.
Closes #[issue_number] (related to issues #110 and #116)
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.