Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility - #2391
Conversation
| else if (PyLong_Check($input)) | ||
| $1 = (time_t) PyLong_AsLong($input); |
There was a problem hiding this comment.
This is the same as the previous branch.
There was a problem hiding this comment.
Can you please elaborate, this is (now) rebased on latest main so this shouldn't be the case?
There was a problem hiding this comment.
The if condition and statement is the same as the else if condition and statement. The else if is superflous and lines 51-52 should be removed.
if (PyLong_Check($input))
$1 = (time_t) PyLong_AsLong($input);
else if (PyLong_Check($input))
$1 = (time_t) PyLong_AsLong($input);
There was a problem hiding this comment.
Updated. Please take a look.
a9dfc2c to
b2168a9
Compare
b2168a9 to
5d723d1
Compare
…276475) The explicit -DCMAKE_BUILD_TYPE=None suppressed the cmake pipeline's Release default, so NDEBUG was never defined and OpenSCAP's SEXP_VALIDATE debug assertion stayed compiled in. That assertion re-validates the entire collected-item list on every item append, making recursive file_object probes quadratic in file count: the GPOS STIG profile's /usr/lib ownership walk takes ~10 minutes on a 20k-file tree (20+ minutes on gitlab toolbox images) instead of ~1 second. Rebuilding with NDEBUG produces byte-identical per-rule scan results, verified by diffing XCCDF results of both builds against the same extracted rootfs. Also fix a pre-existing FTBFS surfaced by rebuilding: swig >= 4.3 removed the Python 2 compat macros (PyInt_Check, PyInt_AsLong, PyString_AsString) that swig/openscap.i relies on. Backport the pending upstream fix (OpenSCAP/openscap#2391, itself a backport of Fedora's packaging fix) verbatim so the patch drops cleanly once it lands in a release. Export: c981b6d629fc68b5aa435c725023387aae288d9a
|
Is this fix planned to be merged soon? This is starting to be a problem in most distros packaging this project. Is there also a planned release date of 1.4.5? Which hopefully includes this fix. |
Back ported from https://src.fedoraproject.org/rpms/openscap/pull-request/35 Co-authored-by: Jitka Plesnikova <jplesnik@redhat.com>
5d723d1 to
26b6cb1
Compare
|
|
/packit build |
1 similar comment
|
/packit build |
jan-cerny
left a comment
There was a problem hiding this comment.
The test fails on Fedora Rawhide aren't caused by the contents of this PR and will be fixed by #2410.
The fails of testing farm jobs are infrastructure problems (failed to setup the test environment) and aren't caused by the contents of this PR.
|
@havardAasen PR merged now. At this moment we don't have any specific plan for releasing the 1.4.5 version. |



Backport from https://src.fedoraproject.org/rpms/openscap/pull-request/35