Skip to content

Stop resolving symlinks in _relative_symlink_target

Description

_relative_symlink_target contains two calls to _resolve_symlinks which ultimately call os.path.realpath. Since absolute paths are passed in, the behaviour of this function is dependent on the host's filing system.

For example, when resolving:

/home/jimmacarthur/bs/buildstream/tmp/test_autotools_build0/cache/build/base-alpine-u9w2ax4c/root/input

Any path element in there could be a symlink and can change between two calls to realpath.

I'm suggesting we drop the resolution because:

  • The name of the function just suggests it makes an absolute symlink target relative, and none of the comments in it say anything about resolving symlinks.
  • There's only one call to it in _process_list and nothing in the context there suggests resolving is necessary.
  • All the current tests pass with the replaced version and freedesktop-sdk builds successfully.

Proposed changes

  • Remove calls to _resolve_symlinks from _relative_symlink_target

This merge request, when approved, will close issue/bug: #830 (closed)

Edited by Jim MacArthur

Merge request reports

Loading