Skip to content

ci(qemu): fix cross-workflow cache pollution that killed do_fetch#10

Merged
EmbeddedAndroid merged 1 commit into
mainfrom
fix-cache-collision
May 15, 2026
Merged

ci(qemu): fix cross-workflow cache pollution that killed do_fetch#10
EmbeddedAndroid merged 1 commit into
mainfrom
fix-cache-collision

Conversation

@EmbeddedAndroid
Copy link
Copy Markdown
Owner

Three qemu-runtime runs died identically at vscode do_unpack with 'tar: cannot open'. Investigation showed bitbake's task graph for vscode was running do_prepare_recipe_sysroot then do_unpack with no do_fetch in between. Root cause:

  • 'Cache poky checkout' used restore-keys 'poky-scarthgap-' which fuzzy-matched poky-scarthgap-v1 from meta-vscode's ci.yml parse jobs.
  • That cache contains poky/build/tmp/stamps/...vscode/do_fetch (the 'fetched' marker) plus poky/build/downloads/code-stable-x64-*.tar.gz.
  • qemu-runtime.yml overrode DL_DIR to a different path; the restored fetch-stamp made bitbake skip do_fetch but the file wasn't where DL_DIR pointed, so do_unpack found nothing.

Fixes:

  • Drop restore-keys on every cache step. Caches must hit on the exact qemu-runtime-* key, otherwise start fresh. No more cross-workflow contamination.
  • Drop the SSTATE_DIR / DL_DIR overrides; use bitbake's defaults so the cached poky tree and the live build agree on locations.

Also paired sstate + poky into a single cache definition so they invalidate together.

…TE/DL dirs

Three failed runs all died the same way: bitbake's task graph for
vscode jumped straight from do_prepare_recipe_sysroot to do_unpack
with no do_fetch, then do_unpack failed because the tarball wasn't
in DL_DIR. Root cause was cache pollution:
- 'Cache poky checkout' used restore-keys 'poky-scarthgap-' which
  fuzzy-matched poky-scarthgap-v1 written by meta-vscode/ci.yml's
  parse jobs.
- That cache contains poky/build/tmp/stamps/.../vscode...do_fetch
  marking fetch as done, plus poky/build/downloads with the
  tarball.
- This workflow overrode DL_DIR to a different location, so the
  stamp-restored 'fetched' state was true but the file lived
  somewhere bitbake wasn't looking.

Two fixes:
- Drop the restore-keys on every cache step. Cache must hit on the
  exact qemu-runtime-* key, otherwise start fresh. No more
  cross-workflow contamination.
- Drop the SSTATE_DIR / DL_DIR overrides; leave them at bitbake's
  defaults (${TOPDIR}/sstate-cache, ${TOPDIR}/downloads) so the
  cached poky/ tree and the live build agree on where things go.
@EmbeddedAndroid EmbeddedAndroid merged commit 7ff6dc4 into main May 15, 2026
19 of 22 checks passed
@EmbeddedAndroid EmbeddedAndroid deleted the fix-cache-collision branch May 15, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant