You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
do_adjust_git: FileExistsError on dangling symlinks when DL_DIR path changes #122
do_adjust_git() in meta/classes-recipe/dpkg-base.bbclass fails with FileExistsError when DL_DIR changes between kas-container sessions,
leaving a dangling symlink at ${WORKDIR}/git.
Root Cause
Lines 30 and 33 use os.path.exists(), which follows symlinks. When the
symlink target no longer exists (dangling), os.path.exists() returns False — even though the symlink itself still exists on disk.
This causes:
Line 30: The stale symlink check (if os.path.exists(git_link) and ...)
evaluates to False, so the dangling symlink is not removed.
Line 33: The creation check (if not os.path.exists(git_link)) evaluates
to True, so os.symlink() attempts to create a new symlink — but
the old one still exists, raising FileExistsError.
Reproduction
Run an ISAR build with DL_DIR=/path/a
Change DL_DIR to /path/b (e.g., kas-container mounts change between sessions)
Replace os.path.exists() with os.path.lexists() on both lines. os.path.lexists() checks for the existence of the path itself (the symlink
entry) rather than following the symlink to its target.
Activity
fix: add upstream issue/PR references for ISAR symlink fix
fix: use stable kas-container mount points for DL_DIR/SSTATE_DIR