Bug 1793504

Summary: swid-tools fails to build with Python 3.9: difference in help text for type=str, nargs='*'
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: swid-toolsAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, jpazdziora, mhroncok, rpm-software-management
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-01-22 10:28:25 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 Miro Hrončok 2020-01-21 13:47:18 UTC
swid-tools fails to build with Python 3.9.0a2.

++ ./bin/rpm2swidtag --config=tests/rpm2swidtag.conf -p nonexistent
+ OUT='./bin/rpm2swidtag: Error reading rpm file [nonexistent]: No such file or directory'
+ ERR=3
+ set -e
+ test 3 -eq 3
+ test './bin/rpm2swidtag: Error reading rpm file [nonexistent]: No such file or directory' == './bin/rpm2swidtag: Error reading rpm file [nonexistent]: No such file or directory'
+ set +e
++ ./bin/rpm2swidtag --config=tests/rpm2swidtag.conf -p /dev/null
+ OUT='./bin/rpm2swidtag: Error reading rpm file [/dev/null]: error reading package header'
+ ERR=3
+ set -e
+ test 3 -eq 3
+ test './bin/rpm2swidtag: Error reading rpm file [/dev/null]: error reading package header' == './bin/rpm2swidtag: Error reading rpm file [/dev/null]: error reading package header'
+ set +e
++ RPM2SWIDTAG_XSLT=nonexistent
++ ./bin/rpm2swidtag --config=tests/rpm2swidtag.conf -p tests/rpms/x86_64/pkg1-1.2.0-1.fc28.x86_64.rpm
+ OUT='./bin/rpm2swidtag: Error reading processing XSLT file [nonexistent]: Error reading file '\''nonexistent'\'': failed to load external entity "nonexistent"'
+ ERR=5
+ set -e
+ test 5 -eq 5
+ test './bin/rpm2swidtag: Error reading processing XSLT file [nonexistent]: Error reading file '\''nonexistent'\'': failed to load external entity "nonexistent"' == './bin/rpm2swidtag: Error reading processing XSLT file [nonexistent]: Error reading file '\''nonexistent'\'': failed to load external entity "nonexistent"'
+ set +e
++ RPM2SWIDTAG_XSLT=tests/xslt/swidtag-fail.xslt
++ ./bin/rpm2swidtag --config=tests/rpm2swidtag.conf -p tests/rpms/x86_64/pkg1-1.2.0-1.fc28.x86_64.rpm
+ OUT='./bin/rpm2swidtag: Error generating SWID tag for file [tests/rpms/x86_64/pkg1-1.2.0-1.fc28.x86_64.rpm]: Unknown header tag [broken] requested by XSLT stylesheet: unknown header tag'
+ ERR=6
+ set -e
+ test 6 -eq 6
+ test './bin/rpm2swidtag: Error generating SWID tag for file [tests/rpms/x86_64/pkg1-1.2.0-1.fc28.x86_64.rpm]: Unknown header tag [broken] requested by XSLT stylesheet: unknown header tag' == './bin/rpm2swidtag: Error generating SWID tag for file [tests/rpms/x86_64/pkg1-1.2.0-1.fc28.x86_64.rpm]: Unknown header tag [broken] requested by XSLT stylesheet: unknown header tag'
+ set +e
+++ pwd

...

++ sed -n '/^usage: rpm2swidtag/,/```/{/```/T;p}' README.md
++ ./bin/rpm2swidtag -h
--- /dev/fd/63	2020-01-21 02:18:25.170950354 +0000
+++ /dev/fd/62	2020-01-21 02:18:25.172950354 +0000
@@ -7,7 +7,7 @@
                    [--primary-only] [--print-tagid]
                    [--preserve-signing-template] [--retain-old-md N]
                    [--config FILE]
-                   [... ...]
+                   [... [... ...]]
 
 Generating SWID tags for rpm packages.
 
error: Bad exit status from /var/tmp/rpm-tmp.scDs8v (%check)



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

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

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. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Jan Pazdziora (Red Hat) 2020-01-21 16:35:49 UTC
The failure actually seems to be due to the way

        parser.add_argument('package', type=str, nargs='*', help='package(s), glob(s) or file name(s)', metavar='...')

is presented in the help string.

Comment 2 Jan Pazdziora (Red Hat) 2020-01-21 16:53:56 UTC
Likely caused by https://github.com/python/cpython/pull/17106/files.

Comment 3 Fedora Update System 2020-01-22 10:02:11 UTC
FEDORA-2020-714f4bfc6c has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-714f4bfc6c

Comment 4 Jan Pazdziora (Red Hat) 2020-01-22 10:03:04 UTC
Fixed in upstream rpm2swidtag 0.8.8, done new build for rawhide.

Comment 5 Miro Hrončok 2020-01-22 10:28:25 UTC
Thank You.