pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.78k stars 1.02k forks source link

Python stdlib venv makes lib64 symlink, should virtualenv? #2733

Closed hoodmane closed 2 months ago

hoodmane commented 2 months ago

The standard library venv module contains the following logic:

        # Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX
        if ((sys.maxsize > 2**32) and (os.name == 'posix') and
            (sys.platform != 'darwin')):
            link_path = os.path.join(env_dir, 'lib64')
            if not os.path.exists(link_path):   # Issue #21643
                os.symlink('lib', link_path)

https://github.com/python/cpython/blob/14e1506a6d7056c38fbbc0797268dcf783f91243/Lib/venv/__init__.py?plain=1#L184-L189

The issue it refers to is https://github.com/python/cpython/issues/65396.

As far as I can tell, virtualenv does not ever make a lib64 directory. I am curious what people think about whether or not similar logic should be included into virtualenv. This came up here: https://github.com/pypa/cibuildwheel/issues/1853

cc @henryiii @QuLogic

gaborbernat commented 2 months ago

If this is happening it is a bug inside the python interpreter. Virtualenv looks up The python interpreters paths to determine where the purelib and platlib should be. Usually the platform library is the one containing the 64. If you check platforms like Fedora they handle this correctly. And that folder gets created accordingly.

hoodmane commented 2 months ago

If this is happening it is a bug inside the python interpreter.

Indeed on 64 bit ubuntu linux, venv creates a lib64 directory but virtualenv does not. On 64 bit fedora linux, both create lib64 directories.

gaborbernat commented 2 months ago

Sounds to me like a buggy build of the Debian python.