-
Notifications
You must be signed in to change notification settings - Fork 36
Modify library_checking to play nicely on NixOS #125
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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:", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to understand where this pattern comes from. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /nix/store is where everything in nixos lives including libraries, the |
||
| "^.*/nix/store/", | ||
| f"^.* => {re.escape(YB_THIRDPARTY_DIR)}" | ||
| ] | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to remove all environment variables except PATH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't per se, but in my use case the PATH variable was not being picked up unless I explicitly included it, like so