Skip to content

Commit

Permalink
[BACKPORT 2.21.0][DEVOPS-3023] Packaging: Use ldd to determine glibc …
Browse files Browse the repository at this point in the history
…version instead of scanning binaries.

Summary:
Original commit: 01b596f / D33073
Use ldd to determine glibc version instead of scanning binaries.
Scanning binaries doens't work as there may not be any symbols tagged with the most recent
required glibc.

Test Plan: Jenkins: build only

Reviewers: devops, steve.varnau

Reviewed By: steve.varnau

Subscribers: devops

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D33111
  • Loading branch information
jharveysmith committed Mar 18, 2024
1 parent dfbc6da commit b4399cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/yugabyte/gen_version_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ def boolean_to_json_str(bool_flag: bool) -> str:
return str(bool_flag).lower()


def get_glibc_version() -> str:
glibc_v = subprocess.check_output('ldd --version', shell=True).decode('utf-8').strip()
# We only want the version
return glibc_v.split("\n")[0].split()[-1]


def get_git_sha1(git_repo_dir: str) -> Optional[str]:
try:
sha1 = subprocess.check_output(
Expand Down Expand Up @@ -187,6 +193,11 @@ def main() -> int:
"platform": os_platform,
"architecture": architecture
}

# Record our glibc version. This doesn't apply to mac/darwin.
if os_platform == 'linux':
data["glibc_v"] = get_glibc_version()

content = json.dumps(data)

# Frequently getting errors here when rebuilding on NFS:
Expand Down

0 comments on commit b4399cd

Please sign in to comment.