Skip to content
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

gh-99370: fix test_zippath_from_non_installed_posix #99483

Merged
merged 3 commits into from
Nov 15, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix test_zippath_from_non_installed_posix
When build with shared enabled, we need to set `LD_LIBRARY_PATH`
for the non-installed python environment in
test_zippath_from_non_installed_posix so that the python binary
and find and link the libpython.so.
kkpattern committed Nov 14, 2022
commit 70828999ccebfec167444a4812c137210bc7c49e
12 changes: 11 additions & 1 deletion Lib/test/test_venv.py
Original file line number Diff line number Diff line change
@@ -590,7 +590,17 @@ def test_zippath_from_non_installed_posix(self):
# venv module correctly.
pythonpath = os.pathsep.join(
additional_pythonpath_for_non_installed)
subprocess.check_call(cmd, env={"PYTHONPATH": pythonpath})
# For python built with shared enabled. We need to set
# LD_LIBRARY_PATH so the non-installed python can find and link
# libpython.so
ld_library_path = os.path.abspath(os.path.dirname(sys.executable))
if sys.platform == 'darwin':
ld_library_path_env = "DYLD_LIBRARY_PATH"
else:
ld_library_path_env = "LD_LIBRARY_PATH"
subprocess.check_call(cmd,
env={"PYTHONPATH": pythonpath,
ld_library_path_env: ld_library_path})
envpy = os.path.join(self.env_dir, self.bindir, self.exe)
# Now check the venv created from the non-installed python has
# correct zip path in pythonpath.