Skip to content

Fixed dangling symlinks in builds#656

Merged
UebelAndre merged 2 commits intobazel-contrib:mainfrom
UebelAndre:symlink
Jun 1, 2021
Merged

Fixed dangling symlinks in builds#656
UebelAndre merged 2 commits intobazel-contrib:mainfrom
UebelAndre:symlink

Conversation

@UebelAndre
Copy link
Copy Markdown
Collaborator

@UebelAndre UebelAndre commented May 26, 2021

In some cases, the assumed output for a build, lib*.so, is actually a symlink which points to lib*.#.#.#.so. This results in issues like

ERROR: /home/user/.cache/bazel/_bazel_user/3821989c4a000f3a0c8be3e30c90c4f7/external/libjpeg_turbo/BUILD.bazel:23:6: output 'external/libjpeg_turbo/libjpeg_turbo/lib/libjpeg.so' is a dangling symbolic link

To fix this, any explicitly requested output should be resolved to it's full file.

@UebelAndre UebelAndre requested a review from jsharpe May 26, 2021 17:18
@UebelAndre UebelAndre marked this pull request as ready for review May 26, 2021 17:18
@UebelAndre UebelAndre requested a review from oquenchil as a code owner May 26, 2021 17:18
Copy link
Copy Markdown
Member

@jsharpe jsharpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 as this fixes the dangling symlinks for the specified outputs but we still have #449 to think about how to handle properly - its not ideal that we end up with copies of shared libraries which should be symlinks. ldconfig complains about the fact that the .so library isn't a symlink.

I've not checked but do we also have broken symlinks in the gen_dir output too?

@UebelAndre
Copy link
Copy Markdown
Collaborator Author

+1 as this fixes the dangling symlinks for the specified outputs but we still have #449 to think about how to handle properly - its not ideal that we end up with copies of shared libraries which should be symlinks. ldconfig complains about the fact that the .so library isn't a symlink.

I've not checked but do we also have broken symlinks in the gen_dir output too?

Yeah, this would have been an existing issue from before #575

This change restores previous behavior but is still incorrect but incorrect for functionality that didn't work or was undefined previously.

@UebelAndre UebelAndre merged commit 76198ed into bazel-contrib:main Jun 1, 2021
@UebelAndre UebelAndre deleted the symlink branch June 1, 2021 20: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.

2 participants