-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-107658: Use same logic to look for exec_prefix as for prefix #107661
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: main
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Use same logic to look for exec_prefix as for prefix | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -594,6 +594,12 @@ def search_up(prefix, *landmarks, test=isfile): | |
prefix = abspath('') | ||
warn('Could not find platform independent libraries <prefix>') | ||
|
||
# First try to detect exec_prefix by looking alongside our runtime library, if known | ||
if library and not exec_prefix: | ||
library_dir = dirname(library) | ||
if PLATSTDLIB_LANDMARK: | ||
if isdir(joinpath(library_dir, PLATSTDLIB_LANDMARK)): | ||
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. This check could also go at line 605 (pre-change; 611 post-change), where it would be with the rest of the search for 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. My intent was to mimic the blocks that detect prefix -- the block above corresponds to the block for prefix at 553 (the leading comment is nearly identical) and the block for exec_prefix following it corresponds to the block for prefix at 583. I can see how it might be better to rearrange some of the logic and possibly to create a function that's called for each, but the current patch minimizes the number of changes. 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. I can see what the intent was, but now it's harder to follow because there are two apparently independent blocks for calculating |
||
exec_prefix = library_dir | ||
|
||
# Detect exec_prefix by searching from executable for the platstdlib_dir | ||
if PLATSTDLIB_LANDMARK and not exec_prefix: | ||
|
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.
Please explain the new logic here.