Skip to content

fix: use stable kas-container mount points for DL_DIR/SSTATE_DIR#13

Merged
timblaktu merged 4 commits intomainfrom
fix/dl-dir-caching
Feb 27, 2026
Merged

fix: use stable kas-container mount points for DL_DIR/SSTATE_DIR#13
timblaktu merged 4 commits intomainfrom
fix/dl-dir-caching

Conversation

@timblaktu
Copy link
Copy Markdown
Collaborator

Summary

  • Use kas-container's stable /downloads and /sstate mount points instead of host paths that change between sessions
  • Export DL_DIR/SSTATE_DIR from flake.nix devShell so kas-container mounts host cache dirs automatically
  • Remove ci-cache.yml overlay (CI sets DL_DIR/SSTATE_DIR env vars directly, picked up by the same mechanism)
  • Point ISAR repo at kyosaku-kai fork with fix for dangling symlink handling in do_adjust_git()

Problem

ISAR builds failed with FileExistsError when DL_DIR changed between kas-container sessions. Two root causes:

  1. base.yml used ${HOME} in local_conf_header, but kas overrides HOME to an ephemeral tmpdir inside the container ($HOME variable is overwritten siemens/kas#148)
  2. do_adjust_git() in dpkg-base.bbclass used os.path.exists() which follows symlinks, missing dangling ones left from previous sessions

Changes

Test plan

  • Local ISAR build with nix run '.' -- --variant base completes without FileExistsError
  • CI pipeline passes (DL_DIR/SSTATE_DIR picked up from environment)
  • Second build reuses sstate cache from first build

Remove vsim-era content: two mermaid diagrams, session history table,
stale path references (hosts/n100-*, modules/hardware/, modules/roles/,
VSIM-INTEGRATION-PLAN.md, tests/integration/), redundant architecture
sections, oversized platform/troubleshooting/ARM64/resource-control
sections, and "Integrated from vsim project" footer.

Retain: framework purpose with clear "not primary test infra" callout,
platform requirements, directory structure, build/run commands, inner-VM
usage (virsh, OVS, tc profiles), compact ASCII architecture diagram,
traffic control profile table, flake outputs, and references.
base.yml used ${HOME}/.cache/yocto/{downloads,sstate} in local_conf_header,
but inside kas-container, kas overrides HOME to an ephemeral tmpdir
(/tmp/tmpXXXXXX). BitBake expanded ${HOME} to that tmpdir, so all downloads
were destroyed when the container exited. Neither devShell nor kas-build
exported DL_DIR/SSTATE_DIR as host environment variables, so kas-container
never mounted a persistent cache directory.

Fix:
- kas-build wrapper (both Darwin and Linux): export DL_DIR and SSTATE_DIR
  with defaults of ~/.cache/yocto/{downloads,sstate}, using ${VAR:-default}
  so CI can override
- base.yml: hardcode /downloads and /sstate (the stable kas-container
  mount points that correspond to the host DL_DIR/SSTATE_DIR)
- Delete ci-cache.yml overlay (existed solely to override the broken ${HOME}
  paths for CI; now redundant)
- Remove ci-cache.yml from build-matrix.nix mkCiKasCommand
- Remove .git-downloads workaround from isar-build-all.sh and CI workflow
  (DL_DIR now resolves to /downloads which is stable across container
  sessions, so .git-downloads symlinks no longer go stale)
- Update CLAUDE.md: replace stale workaround docs with new caching docs

References: siemens/kas#52, siemens/kas#148
Switch mirrors.yml from upstream ilbers/isar to our fork at
kyosaku-kai/isar on the fix/do-adjust-git-dangling-symlinks branch.

The fork contains a one-line fix: os.path.exists() → os.path.lexists()
in dpkg-base.bbclass do_adjust_git(), fixing FileExistsError when
DL_DIR mount paths change between kas-container sessions (dangling
.git-downloads symlink not detected by exists() which follows symlinks).

Revert to upstream once ilbers/isar merges the fix.
Update mirrors.yml PENDING placeholders with actual upstream tracking:
- Issue: ilbers/isar#122
- PR: ilbers/isar#123
@timblaktu timblaktu merged commit 3cc1aa6 into main Feb 27, 2026
85 of 86 checks passed
@timblaktu timblaktu deleted the fix/dl-dir-caching branch February 27, 2026 16:51
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