Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize rpath entries to guard against missing default solib dir #14660

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Jan 28, 2022

When all dynamic deps in a build are built in transitioned configurations, the default solib dir is not created. However, while
resolving paths, the dynamic linker stops at the first directory that does not exist, even when followed by ../.

Before this commit, all rpath entries would consist of the relative path to the default solib dir followed by the relative path to the
particular library's solib dir. Thus, if the default solib dir was missing, the dynamic linker wouldn't resolve any of these paths.

This commit ensures that the relative path entries are normalized and thus contain no references to non-existing directories assuming the normalized path itself exists.

Work towards #13819.

When all dynamic deps in a build are built in transitioned
configurations, the default solib dir is not created. However, while
resolving paths, the dynamic linker stops at the first directory that
does not exist, even when followed by "../".

Before this commit, all rpath entries would consist of the relative
path to the default solib dir followed by the relative path to the
particular library's solib dir. Thus, if the default solib dir was
missing, the dynamic linker wouldn't resolve any of these paths.

This commit ensures that the relative path entries are normalized and
thus contain no references to non-existing directories assuming the
normalized path itself exists.

Work towards bazelbuild#13819.
Copy link
Contributor

@oquenchil oquenchil left a comment

Choose a reason for hiding this comment

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

LGTM

@fmeum
Copy link
Collaborator Author

fmeum commented Feb 24, 2022

@oquenchil Friendly ping. Is this simply waiting to be imported or does it perhaps fail some internal tests?

@bazel-io bazel-io closed this in 0b1beef Mar 1, 2022
@fmeum fmeum deleted the fix-default-solib-lookup branch March 1, 2022 14:34
fmeum added a commit to fmeum/bazel that referenced this pull request Mar 1, 2022
When all dynamic deps in a build are built in transitioned configurations, the default solib dir is not created. However, while
resolving paths, the dynamic linker stops at the first directory that does not exist, even when followed by `../`.

Before this commit, all rpath entries would consist of the relative path to the default solib dir followed by the relative path to the
particular library's solib dir. Thus, if the default solib dir was missing, the dynamic linker wouldn't resolve any of these paths.

This commit ensures that the relative path entries are normalized and thus contain no references to non-existing directories assuming the normalized path itself exists.

Work towards bazelbuild#13819.

Closes bazelbuild#14660.

PiperOrigin-RevId: 431671888
fmeum added a commit to fmeum/bazel that referenced this pull request Mar 2, 2022
When all dynamic deps in a build are built in transitioned configurations, the default solib dir is not created. However, while
resolving paths, the dynamic linker stops at the first directory that does not exist, even when followed by `../`.

Before this commit, all rpath entries would consist of the relative path to the default solib dir followed by the relative path to the
particular library's solib dir. Thus, if the default solib dir was missing, the dynamic linker wouldn't resolve any of these paths.

This commit ensures that the relative path entries are normalized and thus contain no references to non-existing directories assuming the normalized path itself exists.

Work towards bazelbuild#13819.

Closes bazelbuild#14660.

PiperOrigin-RevId: 431671888
Wyverald pushed a commit that referenced this pull request Mar 2, 2022
…14929)

When all dynamic deps in a build are built in transitioned configurations, the default solib dir is not created. However, while
resolving paths, the dynamic linker stops at the first directory that does not exist, even when followed by `../`.

Before this commit, all rpath entries would consist of the relative path to the default solib dir followed by the relative path to the
particular library's solib dir. Thus, if the default solib dir was missing, the dynamic linker wouldn't resolve any of these paths.

This commit ensures that the relative path entries are normalized and thus contain no references to non-existing directories assuming the normalized path itself exists.

Work towards #13819.

Closes #14660.

PiperOrigin-RevId: 431671888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants