Skip to content

utils.py: Fix corner case in relative_symlink_path() that breaks builds

The goal of turning absolute symlink paths into relative ones is a noble one -- we want to avoid any chance of corrupting stuff on the host system. Symlinks pointing to /lib/ld.so or whatever can be dangerous (although by not running BuildStream as 'root' you are mostly protected anyway).

Some Baserock builds were broken by this as it didn't take into account that the path to a symlink may itself contain symlinks. Adding an extra os.realpath() call is enough to fix this case.

Merge request reports