Building wheel with setup.py and skbuild in linux fails due to permission (Works in Windows)

83 views Asked by At

I'm trying to build a wheel for my package in Linux and get an permission error at a late stage in the build process. This is the error message I get in Linux:

...
...
copying _skbuild/linux-x86_64-3.11/setuptools/lib.linux-x86_64-3.11/mypackage/tests/store_test.py -> _skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage/tests
copying _skbuild/linux-x86_64-3.11/setuptools/lib.linux-x86_64-3.11/mypackage/tests/system_readtextinput_test.py -> _skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage/tests
copying _skbuild/linux-x86_64-3.11/setuptools/lib.linux-x86_64-3.11/mypackage/tests/__init__.py -> _skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage/tests
copying _skbuild/linux-x86_64-3.11/setuptools/lib.linux-x86_64-3.11/mypackage/__init__.py -> _skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage
copied 46 files
running install_egg_info
running egg_info
writing mypackage.egg-info/PKG-INFO
writing dependency_links to mypackage.egg-info/dependency_links.txt
writing requirements to mypackage.egg-info/requires.txt
writing top-level names to mypackage.egg-info/top_level.txt
reading manifest file 'mypackage.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'mypackage.egg-info/SOURCES.txt'
removing '_skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage-5.2.0-py3.11.egg-info' (and everything under it)
Copying mypackage.egg-info to _skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage-5.2.0-py3.11.egg-info
running install_scripts
changing mode of _skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage-5.2.0.data/scripts/new_mypackage_system.py to 777
copied 1 files
error: [('_skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage-5.2.0-py3.11.egg-info', '_skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage-5.2.0.dist-info', "[Errno 13] Permission denied: '_skbuild/linux-x86_64-3.11/setuptools/bdist.linux-x86_64/wheel/mypackage-5.2.0.dist-info'")]

It works fine to build the wheel in Windows, here is the output from the same stage from Windows:

...
...
copying _skbuild\win-amd64-3.11\setuptools\lib.win-amd64-cpython-311\mypackage\tests\system_readtextinput_test.py -> _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\.\mypackage\tests
copying _skbuild\win-amd64-3.11\setuptools\lib.win-amd64-cpython-311\mypackage\tests\__init__.py -> _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\.\mypackage\tests
copying _skbuild\win-amd64-3.11\setuptools\lib.win-amd64-cpython-311\mypackage\__init__.py -> _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\.\mypackage
copied 45 files
running install_egg_info
running egg_info
creating mypackage.egg-info
writing mypackage.egg-info\PKG-INFO
writing dependency_links to mypackage.egg-info\dependency_links.txt
writing requirements to mypackage.egg-info\requires.txt
writing top-level names to mypackage.egg-info\top_level.txt
writing manifest file 'mypackage.egg-info\SOURCES.txt'
reading manifest file 'mypackage.egg-info\SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'mypackage.egg-info\SOURCES.txt'
Copying mypackage.egg-info to _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\.\mypackage-5.2.0-py3.11.egg-info
running install_scripts
creating _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\mypackage-5.2.0.data
creating _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\mypackage-5.2.0.data\scripts
copying _skbuild\win-amd64-3.11\setuptools\scripts-3.11\new_mypackage_system.py -> _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\mypackage-5.2.0.data\scripts
copied 1 files
C:\dev\mypackages\mypackage_win\venv\Lib\site-packages\wheel\bdist_wheel.py:109: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
  if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")):
creating _skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel\mypackage-5.2.0.dist-info\WHEEL
creating 'dist\mypackage-5.2.0-cp311-cp311-win_amd64.whl' and adding '_skbuild\win-amd64-3.11\setuptools\bdist.win-amd64\wheel' to it
adding 'mypackage/__init__.py'
...
...

Building the package with "setup.py build-ext" works fine in both Linux and Windows.

Some package information: python is version 3.11.1 skbuild is version 0.17.6 setuptools is version 68.2.2

I running Linux (Ubuntu 22 LTS) through Windows (WSL).

I've tried checking the permissions for all the folders in the _skbuild/, and they are all drwxrwxrwx, and files have permissions -rwxrwxrwx. I also tried running the "setup.py bdist_wheel" as sudo, but with the same error.

0

There are 0 answers