Bug 1789643

Summary: python-scandir fails to build with Python 3.9
Product: [Fedora] Fedora Reporter: Charalampos Stratakis <cstratak>
Component: python-scandirAssignee: Avram Lubkin <aviso>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aviso, cstratak, mhroncok, michel, mplch, pviktori, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-28 10:00:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1785415    

Description Charalampos Stratakis 2020-01-10 00:27:37 UTC
python-scandir fails to build with Python 3.9.0a2.

_scandir.c:663:7: error: conflicting type qualifiers for ‘PyStructSequence_UnnamedField’
  663 | char *PyStructSequence_UnnamedField = "unnamed field";
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.9/Python.h:125,
                 from _scandir.c:14:
/usr/include/python3.9/structseq.h:22:27: note: previous declaration of ‘PyStructSequence_UnnamedField’ was here
   22 | extern const char * const PyStructSequence_UnnamedField;
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01142513-python-scandir/

For all our attempts to build python-scandir with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-scandir/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33, but the initial bootstrapping has already started.
A build failure this early in the bootstrap sequence blocks us very much.

Comment 1 Charalampos Stratakis 2020-01-10 00:28:44 UTC
This is due to PyStructSequence_UnnamedField being now a constant in Python 3.9. This should be easily fixable by changing the type.

https://github.com/python/cpython/pull/17005/files

Comment 2 Petr Viktorin (pviktori) 2020-01-10 08:36:21 UTC
scandir is a backport of os.scandir and os.walk from Python 3.5+ standard library. How hard would it be to switch everything that needs scandir to the stdlib, and retire python-scandir?
scandir's README says to do:

# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
    from os import scandir, walk
except ImportError:
    from scandir import scandir, walk

Comment 3 Victor Stinner 2020-01-16 14:37:38 UTC
> scandir is a backport of os.scandir and os.walk from Python 3.5+ standard library.
> How hard would it be to switch everything that needs scandir to the stdlib, and retire python-scandir?

It's a drop-in replacement. I don't think that it makes sense to use the backport on Python 3.5 and newer.

The documentation says:

"This scandir module is intended to work on Python 2.7+ and Python 3.4+ (and it has been tested on those versions)."

Does another package depend on this 3rd party scandir package?

Comment 4 Miro Hrončok 2020-01-16 14:45:17 UTC
Nothing in Fedora seems to require this. It indeed shall be retired, if my repoquery is right.

We need to adapt our bootstrap sequence not to list this package.

Comment 5 Avram Lubkin 2020-01-16 21:17:48 UTC
I had the same result and went ahead and retired it in master. Will live on in EPEL 6 and 7.

Comment 6 Ben Cotton 2020-02-11 17:34:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 7 Miro Hrončok 2020-02-28 10:00:23 UTC
The package was retired.