gh-150162: Fix sysconfig cross-compile impermanence#150164
Open
hetmankp wants to merge 1 commit into
Open
Conversation
Fixes issue python#150162 by improving the code introduced by 7015485 (pythonGH-127729) while retaining the original documented intent. The aforementioned code has a side effect when used in a virtual environment context, on posix platforms, with the cross-compiling environment variable _PYTHON_PROJECT_BASE present. In this case, every single sysconfig.get_config_vars() and sysconfig.get_config_var() call, forces the _CONFIG_VARS dictionary to be reinitialised from scratch. This is inefficient, but also means no changes to the dictionary returned by sysconfig.get_config_vars() persist, which can be useful in certain situations. This commit tracks changes to sys.prefix and sys.exec_prefix more directly rather than relying on a misalignment with the corresponding sysconfig variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue #150162 by improving the code introduced by 7015485 (GH-127729) while retaining the original documented intent. The aforementioned code has a side effect when used in a virtual environment context, on posix platforms, with the cross-compiling environment variable _PYTHON_PROJECT_BASE present. In this case, every single sysconfig.get_config_vars() and sysconfig.get_config_var() call, forces the _CONFIG_VARS dictionary to be reinitialised from scratch. This is inefficient, but also means no changes to the dictionary returned by sysconfig.get_config_vars() persist, which can be useful in certain situations.
This commit tracks changes to sys.prefix and sys.exec_prefix more directly rather than relying on a misalignment with the corresponding sysconfig variables.