Skip to content

gh-133951: Remove lib64->lib symlink in venv creation #137139

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Cycloctane
Copy link

@Cycloctane Cycloctane commented Jul 27, 2025

venv creates a lib64->lib symlink on posix platforms (except osx) to make purelib and platlib always share the same directory in all dists (#65396). This can cause problems on filesystems without symlink support. It is also not necessary anymore because venv now creates lib paths in venv directory based on sysconfig. Others should also use sysconfig to get the correct lib paths.

@Cycloctane Cycloctane requested review from vsajip and FFY00 as code owners July 27, 2025 07:49
@python-cla-bot
Copy link

python-cla-bot bot commented Jul 27, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Jul 27, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Jul 27, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@picnixz
Copy link
Member

picnixz commented Jul 27, 2025

More generally, could it cause issues with platforms that are configured with --with-platlibdir=lib64? On OpenSUSE I need to explicitly specify this when doing ./configure, otherwise Python won't be correctly installed.

It is also not necessary anymore because venv now creates lib paths in venv directory based on sysconfig.

Is there a possibility that this could somehow conflict with legacy venvs? or with some weird sysconfig? If this is causing issues on platforms without symlink support why not just checking if that platform supports symlinks and, if not, do nothing?

@Cycloctane
Copy link
Author

could it cause issues with platforms that are configured with --with-platlibdir=lib64?

The difference on these platforms is that platlib and purelib modules will be installed into separated directory (lib64/ and lib/) as defined in posix_venv installation scheme. This is also virtualenv's current behavior.

Is there a possibility that this could somehow conflict with legacy venvs?

I think this only affects venv creation. Legacy venvs should still be able to run.

If this is causing issues on platforms without symlink support why not just checking if that platform supports symlinks and, if not, do nothing?

In my understanding this symlink is not needed in anyway. Other paths created by venv are all looked up from venv scheme sysconfig except this symlink which is hard-coded and created even unnecessary. So I remove it for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants