Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2222249 - python-setuptools: FTBFS in Fedora Rawhide
Summary: python-setuptools: FTBFS in Fedora Rawhide
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-setuptools
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
Depends On:
Blocks: F39FTBFS F40FTBFS PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-07-12 12:09 UTC by Tomáš Hrnčiar
Modified: 2023-09-27 01:32 UTC (History)
7 users (show)

Fixed In Version: python-setuptools-67.7.2-7.fc40 python-setuptools-67.7.2-7.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-27 01:32:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
preliminary patch for pip (deleted)
2023-07-12 12:29 UTC, Petr Viktorin (pviktori)
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-setuptools pull-request 102 0 None None None 2023-09-11 15:59:44 UTC
Github python cpython issues 107845 0 None open tarfile.data_filter wrongly rejects some tarballs with symlinks 2023-09-06 10:32:13 UTC

Description Tomáš Hrnčiar 2023-07-12 12:09:40 UTC
Description of problem:
Package python-setuptools fails to build from source in Fedora Rawhide.

Version-Release number of selected component (if applicable):
67.7.2-5.fc39

Steps to Reproduce:
koji build --scratch f39 python-setuptools-67.7.2-5.fc39.src.rpm

Additional info:

There are 6 tests failing, 4 of them are DeprecationWarnings treated as errors and can be surpassed with -Wdefault in the spec file

=================================== FAILURES ===================================
_________________________ test_legacy_editable_install _________________________
venv = <setuptools.tests.environment.VirtualEnv object at 0x3ff94c05520>
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_legacy_editable_install0')
tmpdir_cwd = local('/builddir/build/BUILD/setuptools-67.7.2')
    def test_legacy_editable_install(venv, tmpdir, tmpdir_cwd):
        pyproject = """
        [build-system]
        requires = ["setuptools"]
        build-backend = "setuptools.build_meta"
        [project]
        name = "myproj"
        version = "42"
        """
        path.build({"pyproject.toml": DALS(pyproject), "mymod.py": ""})
    
        # First: sanity check
        cmd = ["pip", "install", "--no-build-isolation", "-e", "."]
>       output = str(venv.run(cmd, cwd=tmpdir), "utf-8").lower()
/builddir/build/BUILD/setuptools-67.7.2/setuptools/tests/test_build_meta.py:883: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/setuptools-67.7.2/setuptools/tests/environment.py:34: in run
    return subprocess.check_output(cmd, *args, **kwargs)
/usr/lib64/python3.12/subprocess.py:466: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
input = None, capture_output = False, timeout = None, check = True
popenargs = ([Path('/tmp/pytest-of-mockbuild/pytest-0/test_legacy_editable_install0/venv/.env/bin/pip'), 'install', '--no-build-isolation', '-e', '.'],)
kwargs = {'cwd': local('/tmp/pytest-of-mockbuild/pytest-0/test_legacy_editable_install0'), 'env': {'CC': 'gcc', 'CFLAGS': '-O2 ...e=z14 -fasynchronous-unwind-tables -fstack-clash-protection ', 'CONFIG_SITE': 'NONE', 'CXX': 'g++', ...}, 'stdout': -1}
process = <Popen: returncode: 1 args: [Path('/tmp/pytest-of-mockbuild/pytest-0/test_le...>
stdout = b"Obtaining file:///tmp/pytest-of-mockbuild/pytest-0/test_legacy_editable_install0\n  Checking if build backend suppor...ble metadata (pyproject.toml): started\n  Preparing editable metadata (pyproject.toml): finished with status 'error'\n"
stderr = None, retcode = 1
    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '[Path('/tmp/pytest-of-mockbuild/pytest-0/test_legacy_editable_install0/venv/.env/bin/pip'), 'install', '--no-build-isolation', '-e', '.']' returned non-zero exit status 1.
/usr/lib64/python3.12/subprocess.py:571: CalledProcessError
---------------------------- Captured stdout setup -----------------------------
created virtual environment CPython3.12.0.beta.4-64 in 188ms
  creator CPython3Posix(dest=/tmp/pytest-of-mockbuild/pytest-0/test_legacy_editable_install0/venv/.env, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=False, pip=bundle, via=copy, app_data_dir=/builddir/.local/share/virtualenv)
    added seed packages: pip==23.1.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Processing ./pyproject-wheeldir/setuptools-67.7.2-py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-67.7.2
----------------------------- Captured stderr call -----------------------------
  error: subprocess-exited-with-error
  
  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      running dist_info
      creating /tmp/pip-modern-metadata-sug8ruca/myproj.egg-info
      writing /tmp/pip-modern-metadata-sug8ruca/myproj.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-modern-metadata-sug8ruca/myproj.egg-info/dependency_links.txt
      writing top-level names to /tmp/pip-modern-metadata-sug8ruca/myproj.egg-info/top_level.txt
      writing manifest file '/tmp/pip-modern-metadata-sug8ruca/myproj.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-modern-metadata-sug8ruca/myproj.egg-info/SOURCES.txt'
      writing manifest file '/tmp/pip-modern-metadata-sug8ruca/myproj.egg-info/SOURCES.txt'
      creating '/tmp/pip-modern-metadata-sug8ruca/myproj-42.dist-info'
      error: invalid command 'bdist_wheel'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
_____ TestSetupRequires.test_setup_requires_override_nspkg[use_setup_cfg0] _____
self = <setuptools.tests.test_easy_install.TestSetupRequires object at 0x3ff95111f70>
use_setup_cfg = ()
    @pytest.mark.parametrize('use_setup_cfg', use_setup_cfg)
    def test_setup_requires_override_nspkg(self, use_setup_cfg):
        """
        Like ``test_setup_requires_overrides_version_conflict`` but where the
        ``setup_requires`` package is part of a namespace package that has
        *already* been imported.
        """
    
        with contexts.save_pkg_resources_state():
            with contexts.tempdir() as temp_dir:
                foobar_1_archive = os.path.join(temp_dir, 'foo.bar-0.1.tar.gz')
                make_nspkg_sdist(foobar_1_archive, 'foo.bar', '0.1')
                # Now actually go ahead an extract to the temp dir and add the
                # extracted path to sys.path so foo.bar v0.1 is importable
                foobar_1_dir = os.path.join(temp_dir, 'foo.bar-0.1')
                os.mkdir(foobar_1_dir)
                with tarfile.open(foobar_1_archive) as tf:
>                   tf.extractall(foobar_1_dir)
setuptools/tests/test_easy_install.py:618: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.12/tarfile.py:2248: in extractall
    filter_function = self._get_filter_function(filter)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <tarfile.TarFile object at 0x3ff91141d30>, filter = None
    def _get_filter_function(self, filter):
        if filter is None:
            filter = self.extraction_filter
            if filter is None:
>               warnings.warn(
                    'Python 3.14 will, by default, filter extracted tar '
                    + 'archives and reject files or modify their metadata. '
                    + 'Use the filter argument to control this behavior.',
                    DeprecationWarning)
E               DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
/usr/lib64/python3.12/tarfile.py:2213: DeprecationWarning
_____ TestSetupRequires.test_setup_requires_override_nspkg[use_setup_cfg1] _____
self = <setuptools.tests.test_easy_install.TestSetupRequires object at 0x3ff95110c50>
use_setup_cfg = ('dependency_links',)
    @pytest.mark.parametrize('use_setup_cfg', use_setup_cfg)
    def test_setup_requires_override_nspkg(self, use_setup_cfg):
        """
        Like ``test_setup_requires_overrides_version_conflict`` but where the
        ``setup_requires`` package is part of a namespace package that has
        *already* been imported.
        """
    
        with contexts.save_pkg_resources_state():
            with contexts.tempdir() as temp_dir:
                foobar_1_archive = os.path.join(temp_dir, 'foo.bar-0.1.tar.gz')
                make_nspkg_sdist(foobar_1_archive, 'foo.bar', '0.1')
                # Now actually go ahead an extract to the temp dir and add the
                # extracted path to sys.path so foo.bar v0.1 is importable
                foobar_1_dir = os.path.join(temp_dir, 'foo.bar-0.1')
                os.mkdir(foobar_1_dir)
                with tarfile.open(foobar_1_archive) as tf:
>                   tf.extractall(foobar_1_dir)
setuptools/tests/test_easy_install.py:618: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.12/tarfile.py:2248: in extractall
    filter_function = self._get_filter_function(filter)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <tarfile.TarFile object at 0x3ff90e08dd0>, filter = None
    def _get_filter_function(self, filter):
        if filter is None:
            filter = self.extraction_filter
            if filter is None:
>               warnings.warn(
                    'Python 3.14 will, by default, filter extracted tar '
                    + 'archives and reject files or modify their metadata. '
                    + 'Use the filter argument to control this behavior.',
                    DeprecationWarning)
E               DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
/usr/lib64/python3.12/tarfile.py:2213: DeprecationWarning
_____ TestSetupRequires.test_setup_requires_override_nspkg[use_setup_cfg2] _____
self = <setuptools.tests.test_easy_install.TestSetupRequires object at 0x3ff95113bf0>
use_setup_cfg = ('setup_requires',)
    @pytest.mark.parametrize('use_setup_cfg', use_setup_cfg)
    def test_setup_requires_override_nspkg(self, use_setup_cfg):
        """
        Like ``test_setup_requires_overrides_version_conflict`` but where the
        ``setup_requires`` package is part of a namespace package that has
        *already* been imported.
        """
    
        with contexts.save_pkg_resources_state():
            with contexts.tempdir() as temp_dir:
                foobar_1_archive = os.path.join(temp_dir, 'foo.bar-0.1.tar.gz')
                make_nspkg_sdist(foobar_1_archive, 'foo.bar', '0.1')
                # Now actually go ahead an extract to the temp dir and add the
                # extracted path to sys.path so foo.bar v0.1 is importable
                foobar_1_dir = os.path.join(temp_dir, 'foo.bar-0.1')
                os.mkdir(foobar_1_dir)
                with tarfile.open(foobar_1_archive) as tf:
>                   tf.extractall(foobar_1_dir)
setuptools/tests/test_easy_install.py:618: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.12/tarfile.py:2248: in extractall
    filter_function = self._get_filter_function(filter)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <tarfile.TarFile object at 0x3ff90e0a690>, filter = None
    def _get_filter_function(self, filter):
        if filter is None:
            filter = self.extraction_filter
            if filter is None:
>               warnings.warn(
                    'Python 3.14 will, by default, filter extracted tar '
                    + 'archives and reject files or modify their metadata. '
                    + 'Use the filter argument to control this behavior.',
                    DeprecationWarning)
E               DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
/usr/lib64/python3.12/tarfile.py:2213: DeprecationWarning
_____ TestSetupRequires.test_setup_requires_override_nspkg[use_setup_cfg3] _____
self = <setuptools.tests.test_easy_install.TestSetupRequires object at 0x3ff95113c80>
use_setup_cfg = ('dependency_links', 'setup_requires')
    @pytest.mark.parametrize('use_setup_cfg', use_setup_cfg)
    def test_setup_requires_override_nspkg(self, use_setup_cfg):
        """
        Like ``test_setup_requires_overrides_version_conflict`` but where the
        ``setup_requires`` package is part of a namespace package that has
        *already* been imported.
        """
    
        with contexts.save_pkg_resources_state():
            with contexts.tempdir() as temp_dir:
                foobar_1_archive = os.path.join(temp_dir, 'foo.bar-0.1.tar.gz')
                make_nspkg_sdist(foobar_1_archive, 'foo.bar', '0.1')
                # Now actually go ahead an extract to the temp dir and add the
                # extracted path to sys.path so foo.bar v0.1 is importable
                foobar_1_dir = os.path.join(temp_dir, 'foo.bar-0.1')
                os.mkdir(foobar_1_dir)
                with tarfile.open(foobar_1_archive) as tf:
>                   tf.extractall(foobar_1_dir)
setuptools/tests/test_easy_install.py:618: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.12/tarfile.py:2248: in extractall
    filter_function = self._get_filter_function(filter)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <tarfile.TarFile object at 0x3ff90e0a570>, filter = None
    def _get_filter_function(self, filter):
        if filter is None:
            filter = self.extraction_filter
            if filter is None:
>               warnings.warn(
                    'Python 3.14 will, by default, filter extracted tar '
                    + 'archives and reject files or modify their metadata. '
                    + 'Use the filter argument to control this behavior.',
                    DeprecationWarning)
E               DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
/usr/lib64/python3.12/tarfile.py:2213: DeprecationWarning
____________________ test_test_command_install_requirements ____________________
venv = <setuptools.tests.environment.VirtualEnv object at 0x3ff816978f0>
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0')
tmpdir_cwd = local('/builddir/build/BUILD/setuptools-67.7.2')
    def test_test_command_install_requirements(venv, tmpdir, tmpdir_cwd):
        # Ensure pip/wheel packages are installed.
>       venv.run(["python", "-c", "__import__('pkg_resources').require(['pip', 'wheel'])"])
/builddir/build/BUILD/setuptools-67.7.2/setuptools/tests/test_virtualenv.py:178: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/setuptools-67.7.2/setuptools/tests/environment.py:34: in run
    return subprocess.check_output(cmd, *args, **kwargs)
/usr/lib64/python3.12/subprocess.py:466: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
input = None, capture_output = False, timeout = None, check = True
popenargs = ([Path('/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0/venv/.env/bin/python'), '-c', "__import__('pkg_resources').require(['pip', 'wheel'])"],)
kwargs = {'cwd': Path('/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0/venv'), 'env': {'CC': 'gcc', 'CFLAGS':...e=z14 -fasynchronous-unwind-tables -fstack-clash-protection ', 'CONFIG_SITE': 'NONE', 'CXX': 'g++', ...}, 'stdout': -1}
process = <Popen: returncode: 1 args: [Path('/tmp/pytest-of-mockbuild/pytest-0/test_te...>
stdout = b'', stderr = None, retcode = 1
    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '[Path('/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0/venv/.env/bin/python'), '-c', "__import__('pkg_resources').require(['pip', 'wheel'])"]' returned non-zero exit status 1.
/usr/lib64/python3.12/subprocess.py:571: CalledProcessError
---------------------------- Captured stdout setup -----------------------------
created virtual environment CPython3.12.0.beta.4-64 in 228ms
  creator CPython3Posix(dest=/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0/venv/.env, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=False, pip=bundle, via=copy, app_data_dir=/builddir/.local/share/virtualenv)
    added seed packages: pip==23.1.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Processing ./pyproject-wheeldir/setuptools-67.7.2-py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-67.7.2
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0/venv/.env/lib/python3.12/site-packages/pkg_resources/__init__.py", line 966, in require
    needed = self.resolve(parse_requirements(requirements))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0/venv/.env/lib/python3.12/site-packages/pkg_resources/__init__.py", line 827, in resolve
    dist = self._resolve_dist(
           ^^^^^^^^^^^^^^^^^^^
  File "/tmp/pytest-of-mockbuild/pytest-0/test_test_command_install_requ0/venv/.env/lib/python3.12/site-packages/pkg_resources/__init__.py", line 868, in _resolve_dist
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'wheel' distribution was not found and is required by the application
=============================== warnings summary ===============================
setuptools/tests/test_config_discovery.py::TestDiscoverPackagesAndPyModules::test_py_modules_when_wheel_dir_is_cwd
  /usr/lib/python3.12/site-packages/wheel/bdist_wheel.py:419: DeprecationWarning: onerror argument is deprecated, use onexc instead
    rmtree(self.bdist_dir, onerror=remove_readonly)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [1] pkg_resources/tests/test_pkg_resources.py:387: Testing case-insensitive filesystems.
SKIPPED [3] pkg_resources/tests/test_pkg_resources.py:404: Testing systems using backslashes as path separators.
SKIPPED [1] setuptools/tests/test_develop.py:64: TODO: needs a fixture to cause 'develop' to be invoked without mutating environment.
SKIPPED [1] setuptools/tests/test_distutils_adoption.py:58: stdlib distutils is removed from Python 3.12+
SKIPPED [3] setuptools/tests/test_distutils_adoption.py:126: stdlib distutils is removed from Python 3.12+
SKIPPED [1] setuptools/tests/test_distutils_adoption.py:157: stdlib distutils is removed from Python 3.12+
SKIPPED [1] setuptools/tests/test_install_scripts.py:50: Windows only
SKIPPED [1] setuptools/tests/test_install_scripts.py:78: Windows only
SKIPPED [1] setuptools/tests/test_msvc14.py:15: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:33: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:51: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:67: These tests are only for win32
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:80: Windows only
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:121: Windows only
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:182: Windows only
XFAIL setuptools/tests/test_bdist_egg.py::Test::test_exclude_source_files - Byte code disabled
XFAIL setuptools/tests/test_build_py.py::test_excluded_subpackages - reason: #3260
XFAIL setuptools/tests/test_dist.py::test_read_metadata[Metadata Version 1.2: Project-Url-attrs5] - Issue #1578: project_urls not read
XFAIL setuptools/tests/test_dist.py::test_read_metadata[Metadata Version 2.1: Provides Extra-attrs9] - provides_extras not read
XFAIL setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[extras_require_with_marker_in_setup_cfg]
XPASS pkg_resources/tests/test_pkg_resources.py::test_distribution_version_missing[egg-info-PKG-INFO-EggInfoDistribution] https://github.com/python/cpython/issues/103632
XPASS pkg_resources/tests/test_pkg_resources.py::test_distribution_version_missing[dist-info-METADATA-DistInfoDistribution] https://github.com/python/cpython/issues/103632
XPASS pkg_resources/tests/test_pkg_resources.py::test_distribution_version_missing_undetected_path https://github.com/python/cpython/issues/103632
XPASS pkg_resources/tests/test_resources.py::TestDistro::testDistroDependsOptions https://github.com/python/cpython/issues/103632
XPASS setuptools/tests/test_archive_util.py::test_unicode_files #710 and #712
= 6 failed, 1040 passed, 19 skipped, 6 deselected, 5 xfailed, 5 xpassed, 1 warning in 139.95s (0:02:19) =

Comment 1 Petr Viktorin (pviktori) 2023-07-12 12:29:01 UTC
Created attachment 1975369 [details]
preliminary patch for pip

Attaching preliminary patch for pip (maybe a different version, let me know if it doesn't apply).
Upstream it'll need to go through the PEP process.

for the spec:

# Backport CVE-2007-4559 mitigations
# pip itself (upstream issue): https://github.com/pypa/pip/issues/12111
# distlib (accepted upstream): https://github.com/pypa/distlib/pull/201
Patch7:         cve-2007-4559-tarfile.patch

Comment 2 Fedora Release Engineering 2023-08-16 07:19:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 3 Tomas Orsava 2023-08-16 12:17:01 UTC
python-setuptools now builds.

Comment 4 Charalampos Stratakis 2023-08-16 12:41:39 UTC
Reopening, currently it builds without tests.

Comment 5 Charalampos Stratakis 2023-08-22 23:19:29 UTC
(In reply to Petr Viktorin from comment #1)
> Created attachment 1975369 [details]
> preliminary patch for pip
> 
> Attaching preliminary patch for pip (maybe a different version, let me know
> if it doesn't apply).
> Upstream it'll need to go through the PEP process.
> 
> for the spec:
> 
> # Backport CVE-2007-4559 mitigations
> # pip itself (upstream issue): https://github.com/pypa/pip/issues/12111
> # distlib (accepted upstream): https://github.com/pypa/distlib/pull/201
> Patch7:         cve-2007-4559-tarfile.patch

Trying to build pip with that fails with:

=================================== FAILURES ===================================
______________________ TestUnpackArchives.test_unpack_tgz ______________________

self = <tests.unit.test_utils_unpacking.TestUnpackArchives object at 0x7ff10390a6c0>
data = <tests.lib.TestData object at 0x7ff10166a7b0>

    def test_unpack_tgz(self, data: TestData) -> None:
        """
        Test unpacking a *.tgz, and setting execute permissions
        """
        test_file = data.packages.joinpath("test_tar.tgz")
        untar_file(os.fspath(test_file), self.tempdir)
>       self.confirm_files()

tests/unit/test_utils_unpacking.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.unit.test_utils_unpacking.TestUnpackArchives object at 0x7ff10390a6c0>

    def confirm_files(self) -> None:
        # expectations based on 022 umask set above and the unpack logic that
        # sets execute permissions, not preservation
        for fname, expected_mode, test, expected_contents in [
            ("file.txt", 0o644, os.path.isfile, b"file\n"),
            # We don't test the "symlink.txt" contents for now.
            ("symlink.txt", 0o644, os.path.isfile, None),
            ("script_owner.sh", 0o755, os.path.isfile, b"file\n"),
            ("script_group.sh", 0o755, os.path.isfile, b"file\n"),
            ("script_world.sh", 0o755, os.path.isfile, b"file\n"),
            ("dir", 0o755, os.path.isdir, None),
            (os.path.join("dir", "dirfile"), 0o644, os.path.isfile, b""),
        ]:
            path = os.path.join(self.tempdir, fname)
            if path.endswith("symlink.txt") and sys.platform == "win32":
                # no symlinks created on windows
                continue
            assert test(path), path
            if expected_contents is not None:
                with open(path, mode="rb") as f:
                    contents = f.read()
                assert contents == expected_contents, f"fname: {fname}"
            if sys.platform == "win32":
                # the permissions tests below don't apply in windows
                # due to os.chmod being a noop
                continue
            mode = self.mode(path)
>           assert (
                mode == expected_mode
            ), f"mode: {mode}, expected mode: {expected_mode}"
E           AssertionError: mode: 420, expected mode: 493
E           assert 420 == 493

tests/unit/test_utils_unpacking.py:79: AssertionError
__________________ TestUnpackArchives.test_unpack_tar_failure __________________

self = <tests.unit.test_utils_unpacking.TestUnpackArchives object at 0x7ff1039085c0>

    def test_unpack_tar_failure(self) -> None:
        """
        Test unpacking a *.tar with file containing .. path
        and expect exception
        """
        files = ["regular_file.txt", os.path.join("..", "outside_file.txt")]
        test_tar = self.make_tar_file("test_tar.tar", files)
        with pytest.raises(InstallationError) as e:
>           untar_file(test_tar, self.tempdir)

tests/unit/test_utils_unpacking.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../BUILDROOT/python-pip-23.2.1-1.fc40.x86_64/usr/lib/python3.12/site-packages/pip/_internal/utils/unpacking.py:177: in untar_file
    member = tarfile.data_filter(member, location)
/usr/lib64/python3.12/tarfile.py:820: in data_filter
    new_attrs = _get_filtered_attrs(member, dest_path, True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

member = <TarInfo '../outside_file.txt' at 0x7ff101c310c0>
dest_path = '/tmp/tmpy174tx_p', for_data = True

    def _get_filtered_attrs(member, dest_path, for_data=True):
        new_attrs = {}
        name = member.name
        dest_path = os.path.realpath(dest_path)
        # Strip leading / (tar's directory separator) from filenames.
        # Include os.sep (target OS directory separator) as well.
        if name.startswith(('/', os.sep)):
            name = new_attrs['name'] = member.path.lstrip('/' + os.sep)
        if os.path.isabs(name):
            # Path is absolute even after stripping.
            # For example, 'C:/foo' on Windows.
            raise AbsolutePathError(member)
        # Ensure we stay in the destination
        target_path = os.path.realpath(os.path.join(dest_path, name))
        if os.path.commonpath([target_path, dest_path]) != dest_path:
>           raise OutsideDestinationError(member, target_path)
E           tarfile.OutsideDestinationError: '../outside_file.txt' would be extracted to '/tmp/outside_file.txt', which is outside the destination

/usr/lib64/python3.12/tarfile.py:769: OutsideDestinationError
=============================== warnings summary ===============================

Comment 6 Petr Viktorin (pviktori) 2023-09-06 10:32:14 UTC
Python 3.12.0rc2 will have a fix related to OutsideDestinationError, I hope it will solve this issue.

Comment 7 Petr Viktorin (pviktori) 2023-09-11 15:59:44 UTC
Backporting patches for remaining build failures: https://src.fedoraproject.org/rpms/python-setuptools/pull-request/102

Comment 8 Fedora Update System 2023-09-11 18:56:52 UTC
FEDORA-2023-8def0bcf03 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-8def0bcf03

Comment 9 Fedora Update System 2023-09-12 01:23:46 UTC
FEDORA-2023-8def0bcf03 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-8def0bcf03`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-8def0bcf03

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2023-09-27 01:32:14 UTC
FEDORA-2023-8def0bcf03 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.