Bug 1892248

Summary: build fails against NSS 3.58
Product: [Fedora] Fedora Reporter: Stanislav Levin <slev>
Component: python-nssAssignee: Alex Scheel <ascheel>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: ascheel, chris, gwync, jdennis, mhroncok, thrnciar, vashirov
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-12-07 18:29:16 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: 1868278, 1890881    

Description Stanislav Levin 2020-10-28 09:56:06 UTC
With the recent NSS 3.58:
```
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -
pipe -frecord-gcc-switches -Wall -g -O3 -pipe -frecord-gcc-switches -Wall -g -O2 -fno-strict-al
iasing -fPIC -Isrc -I/usr/include/nss -I/usr/include/nspr -I/usr/include/python3.8 -c src/py_ns
s.c -o build/temp.linux-x86_64-3.8/src/py_nss.o -O0 -g
...
In file included from src/py_nss.c:341:
src/py_nss.h:126:3: error: conflicting types for ‘RSAPublicKey’
  126 | } RSAPublicKey;
      |   ^~~~~~~~~~~~
In file included from /usr/include/nss/pk11hpke.h:8,
                 from /usr/include/nss/pk11pub.h:12,
                 from src/py_nss.h:23,
                 from src/py_nss.c:341:
/usr/include/nss/blapit.h:281:32: note: previous declaration of ‘RSAPublicKey’ was here
  281 | typedef struct RSAPublicKeyStr RSAPublicKey;
      |                                ^~~~~~~~~~~~
In file included from src/py_nss.c:341:
src/py_nss.h:136:3: error: conflicting types for ‘DSAPublicKey’
  136 | } DSAPublicKey;
      |   ^~~~~~~~~~~~
In file included from /usr/include/nss/pk11hpke.h:8,
                 from /usr/include/nss/pk11pub.h:12,
                 from src/py_nss.h:23,
                 from src/py_nss.c:341:
/usr/include/nss/blapit.h:323:32: note: previous declaration of ‘DSAPublicKey’ was here
  323 | typedef struct DSAPublicKeyStr DSAPublicKey;
      |                                ^~~~~~~~~~~~
...
```

https://phabricator.services.mozilla.com/D73947

Comment 1 Miro Hrončok 2020-11-18 15:55:53 UTC
*** Bug 1899142 has been marked as a duplicate of this bug. ***

Comment 2 Miro Hrončok 2020-11-18 16:06:14 UTC
At this point, I would needinfo the package maintainer, but it is not possible here.

Comment 3 Miro Hrončok 2020-11-21 11:00:20 UTC
This blocks the Python 3.10 rebuild of pki-core.

Error: 
 Problem: package python3-nss-1.0.1-20.fc33.x86_64 requires python(abi) = 3.9, but none of the providers can be installed
  - package python3-devel-3.10.0~a2-1.fc34.x86_64 conflicts with python3 < 3.10.0~a2-1.fc34 provided by python3-3.9.0-1.fc34.i686
  - cannot install both python3-3.9.0-1.fc34.x86_64 and python3-3.10.0~a2-1.fc34.x86_64
  - cannot install the best candidate for the job

For all our attempts to build python-nss with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-nss/

For all our attempts to build pki-core with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/pki-core/

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.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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.

https://fedoraproject.org/wiki/Changes/Python3.10

Comment 4 Alex Scheel 2020-12-04 22:07:36 UTC
I've checked this into dist-git, but did not build it. Miro reported on IRC that this rebuilds fine in the 3.10 COPR; I'll let the 3.10 mass rebuild take care of building.

I've not backported this to earlier releases yet, despite them also being affected due to newer NSS. 

(Note: failure was caused by newer NSS, not Python 3.10).

Comment 5 Stanislav Levin 2020-12-07 10:58:13 UTC
ascheel@, thank you for the patch [0].

This change rename Python classes (actually exposed from Python NSS) RSAPublicKey -> PyRSAPublicKey and DSAPublicKey -> PyDSAPublicKey:

188 -    "nss.nss.RSAPublicKey",                    /* tp_name */                   
189 -    sizeof(RSAPublicKey),                      /* tp_basicsize */              
190 +    "nss.nss.PyRSAPublicKey",                  /* tp_name */                   
191 +    sizeof(PyRSAPublicKey),                    /* tp_basicsize */

417 -    "nss.nss.DSAPublicKey",                    /* tp_name */                   
418 -    sizeof(DSAPublicKey),                      /* tp_basicsize */              
419 +    "nss.nss.PyDSAPublicKey",                  /* tp_name */                   
420 +    sizeof(PyDSAPublicKey),                    /* tp_basicsize */

I think that was the unintentional rename, because breaks old clients.


[0]: https://src.fedoraproject.org/rpms/python-nss/blob/master/f/0001-Rename-DSA-RSA-PublicKey-to-Py-DSA-RSA-PublicKey.patch

Comment 6 Alex Scheel 2020-12-07 18:29:16 UTC
Thanks Stanislav for the review. Dogtag doesn't use RSAPublicKey/DSAPublicKey at all so I missed that. 

IIRC the sizeof needs to stay; it is just the name that needs to change. 

I've pushed this as a modification to the original patch and it should now build correctly in Fedora. I've also rebuilt rawhide now, so marking this as fixed.

Comment 7 Alex Scheel 2021-03-01 14:24:00 UTC
*** Bug 1933360 has been marked as a duplicate of this bug. ***