-
Notifications
You must be signed in to change notification settings - Fork 71
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
sys._home -> sys.base_exec_prefix #42
Conversation
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.
* What's the point to include the folder only when in venv?
I'm afraid I don't have any expertise on the reported concern. The comment says "Append the source distribution library directories, [allowing] distutils on windows to work in the source tree".
I also observe that {base_exec_prefix}/libs
is appended earlier, referencing bpo-16116.
It does seem surprising to me that sys.base_exec_prefix
should be added to the library_dirs
with slight variations (one with libs
and the other without) and under different conditionals (!= sys.prefix
or unconditionally).
I don't know how sys._home
is used or why library_dirs attempts to honor it here, but I don't think it's safe to twiddle the value based on a few select use-cases.
* I don't know whether to choose `sys.base_exec_prefix` or `sys.base_prefix`, though they are identical in my environment.
I don't see anything in the description above about why you would want to add either of these values. What behavior is enabled by choosing one of these prefixes (what behavior fails without this change)?
Here's what I'd like to see to make a change like this:
- As best as possible, trace (through source history tracing) the origin of this code and attempt to replicate the environment for which this code was created. Determine if that motivation is still present, and if so, create a test to capture that requirement.
- Capture the desired behavior that this PR is attempting to create and create a test for that, something that fails before the patch and passes after it.
Unfortunately, distutils is weakly covered and tested but also used by a wide array of environments and configurations, so any changes we make will need to be carefully considered and start to build toward a more robust and rigorously specified implementation.
I'm happy to work with you on this effort, but I doubt it will be a quick fix.
I don't have much experience either. The reason I found this is because there is a If both my two PRs are merged, there won't be a ld error as I said in #41 and people can successfully use MinGW to compile extensions. In linux,
Though I don't know if it's appropriate to use |
May I recommend to revisit this issue and file a report that describes the issue. In particular, what do you expect to happen and what happens instead and under what conditions? And then the next step will be to create two tests as mentioned above:
These two tests may be the same thing. |
I really don't have time for programming now. 😢 |
On further consideration, and after reviewing the patch in bpo-15367 (7e4558c), it may be asking a lot to capture the expectation that this change introduces. I also agree, that the I did read up on the difference between Let's incorporate this change and see how it goes. Thanks for the contrib. |
Facts:
library_dirs
is used to add-L xxx
in build commandssys._home
only exists in venv(https://github.com/python/cpython/blob/main/Lib/site.py#L527) It does exist outside of venv, but the value is Noneos.name == 'nt'
Problems:
sys._home
makes no sense. It's likeC:\Users\<user>\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0
and only contains 0KB filesChanges:
Other options:
Note:
sys.base_exec_prefix
orsys.base_prefix
, though they are identical in my environment.