Skip to content

Commit

Permalink
[BACKPORT 2.20.2] [#21236] DocDB: Fix RPATH issue with OpenLDAP libra…
Browse files Browse the repository at this point in the history
…ries for native glibc x86_64 build

Summary:
We were not setting RPATH correctly for a few OpenLDAP libraries because the executable bit was not set on them.  As a result, either system versions of those libraries would be picked up, or they would not be found at all.

Also refactoring library_packager.py:
- Use an enum for dependency categories.
- Reduce verbose logging when setting RPATHs.

Original commit: d893bb7  / D29140
Jira: DB-10161

Test Plan:
Jenkins: compile only

Manual testing:

```
./yb_build.sh release --no-tests --sj
./yb_release --skip_yugabyted_ui --force --no_reinitdb --skip_build --verbose |& tee ~/yb_release.log
cd build
tar xzf yugabyte-2.20.2.0-*-release-clang16-centos-*.tar.gz
cd yugabyte-2.20.2.0
bin/post_install.sh  # Only on x86_64.
ldd postgres/bin/postgres | grep ldap
ldd postgres/bin/initdb | grep ldap
```

Make sure that ldd output of the above only references Linuxbrew glibc libraries, and the libldap/liblber libraries are linked from the yb-thirdparty directory.

Repeat the test in an AlmaLinux 8 Docker container on both x86_64 (with Linuxbrew) and aarch64 (without Linuxbrew).

bin/run_codecheck

Reviewers: steve.varnau

Reviewed By: steve.varnau

Subscribers: ybase

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D32740
  • Loading branch information
mbautin committed Feb 29, 2024
1 parent a54db61 commit e3718ec
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 68 deletions.
12 changes: 12 additions & 0 deletions python/yugabyte/file_util.py
Expand Up @@ -74,3 +74,15 @@ def compute_file_sha256(file_path: str) -> str:
break
sha256.update(data)
return sha256.hexdigest()


def clean_path_join(base_path: str, rel_path: str) -> str:
"""
>>> clean_path_join('foo', 'bar')
'foo/bar'
>>> clean_path_join('foo', '.')
'foo'
"""
if rel_path == '.':
return base_path
return os.path.join(base_path, rel_path)

0 comments on commit e3718ec

Please sign in to comment.