From 28b8432860554bc30ffe54d2544ecce0f7f18372 Mon Sep 17 00:00:00 2001 From: Dov Alperin Date: Thu, 14 Jul 2022 23:41:14 -0700 Subject: [PATCH] Modify library_checking to play nicely on NixOS --- python/yugabyte_db_thirdparty/library_checking.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/yugabyte_db_thirdparty/library_checking.py b/python/yugabyte_db_thirdparty/library_checking.py index 21c65ec1..35388240 100644 --- a/python/yugabyte_db_thirdparty/library_checking.py +++ b/python/yugabyte_db_thirdparty/library_checking.py @@ -93,8 +93,10 @@ def compile_re_list(re_list: List[str]) -> Any: def get_needed_libs(file_path: str) -> List[str]: + env = {"PATH": os.getenv("PATH")} return capture_all_output( ['patchelf', '--print-needed', file_path], + env=env, allowed_exit_codes={1}, extra_msg_on_nonzero_exit_code="Warning: could not determine libraries directly " f"needed by {file_path}") @@ -317,6 +319,9 @@ def __init__(self) -> None: "^.* => /lib/", "^.* => /usr/lib/x86_64-linux-gnu/", "^.* => /opt/yb-build/brew/linuxbrew", + "^.* => /nix/store/", + "/bin/sh:", + "^.*/nix/store/", f"^.* => {re.escape(YB_THIRDPARTY_DIR)}" ]