Bug 2128646

Summary: lldb build fails with SWIG 4.1.0
Product: [Fedora] Fedora Reporter: Jitka Plesnikova <jplesnik>
Component: lldbAssignee: serge_sans_paille <sguelton>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: airlied, jan, jchecahi, kkleine, npopov, sguelton, siddharth.kde, tstellar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lldb-15.0.0-2.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-03 13:24:08 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:
Attachments:
Description Flags
Fixes for swig-4.1.0 macro definition correction
none
Fix 'error: non-const lvalue...' caused by SWIG 4.1.0 none

Description Jitka Plesnikova 2022-09-21 10:20:58 UTC
Created attachment 1913293 [details]
Fixes for swig-4.1.0 macro definition correction

I am testing rebuild of SWIG dependencies against upcoming version 4.1.0 in Fedora rawhide/38.

The test of lldb-15.0.0 is failing with this version.

There are 2 things which need to be fixed:

1)
cd /builddir/build/BUILD/lldb-15.0.0.src/redhat-linux-build/bindings/python && /usr/bin/swig -c++ -features autodoc -I/builddir/build/BUILD/lldb-15.0.0.src/include -I/builddir/build/BUILD/lldb-15.0.0.src/bindings -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/builddir/build/BUILD/lldb-15.0.0.src/bindings/python -c++ -shadow -python -py3 -threads -outdir /builddir/build/BUILD/lldb-15.0.0.src/redhat-linux-build/bindings/python -o /builddir/build/BUILD/lldb-15.0.0.src/redhat-linux-build/bindings/python/LLDBWrapPython.cpp /builddir/build/BUILD/lldb-15.0.0.src/bindings/python/python.swig
Deprecated command line option: -py3. Ignored, this option is no longer supported.
/builddir/build/BUILD/lldb-15.0.0.src/bindings/interfaces.swig:5: Error: Macro '__STDC_LIMIT_MACROS' redefined,
:1: Error: previous definition of '__STDC_LIMIT_MACROS'.


For more information see https://github.com/swig/swig/issues/2193

This patch is backwards compatible with older versions of SWIG.

Comment 1 Jitka Plesnikova 2022-09-21 10:25:19 UTC
Created attachment 1913295 [details]
Fix 'error: non-const lvalue...' caused by SWIG 4.1.0

2)
/builddir/build/BUILD/lldb-15.0.0.src/redhat-linux-build/bindings/python/LLDBWrapPython.cpp:22100:19: error: non-const lvalue reference to type 'lldb::FileSP' (aka 'shared_ptr<lldb_private::File>') cannot bind to a value of unrelated type 'SwigValueWrapper<std::shared_ptr<lldb_private::File>>'
    lldb::FileSP &sp = result;
                  ^    ~~~~~~
/builddir/build/BUILD/lldb-15.0.0.src/redhat-linux-build/bindings/python/LLDBWrapPython.cpp:22140:19: error: non-const lvalue reference to type 'lldb::FileSP' (aka 'shared_ptr<lldb_private::File>') cannot bind to a value of unrelated type 'SwigValueWrapper<std::shared_ptr<lldb_private::File>>'
    lldb::FileSP &sp = result;
                  ^    ~~~~~~
/builddir/build/BUILD/lldb-15.0.0.src/redhat-linux-build/bindings/python/LLDBWrapPython.cpp:22180:19: error: non-const lvalue reference to type 'lldb::FileSP' (aka 'shared_ptr<lldb_private::File>') cannot bind to a value of unrelated type 'SwigValueWrapper<std::shared_ptr<lldb_private::File>>'
    lldb::FileSP &sp = result;
                  ^    ~~~~~~
/builddir/build/BUILD/lldb-15.0.0.src/redhat-linux-build/bindings/python/LLDBWrapPython.cpp:30742:19: error: non-const lvalue reference to type 'lldb::FileSP' (aka 'shared_ptr<lldb_private::File>') cannot bind to a value of unrelated type 'SwigValueWrapper<std::shared_ptr<lldb_private::File>>'
    lldb::FileSP &sp = result;
                  ^    ~~~~~~
4 errors generated.

More information about source of the issue:
https://github.com/swig/swig/issues/2377#issuecomment-1252878976

This patch is backwards compatible with older versions of SWIG.

Comment 2 Jitka Plesnikova 2022-09-29 10:08:44 UTC
https://github.com/llvm/llvm-project/issues/58018#issuecomment-1260702467

Tom, could you please submit patches to upstream?

Comment 3 serge_sans_paille 2022-09-29 14:02:21 UTC
Patch submitted for review upstream https://reviews.llvm.org/D134877

Comment 4 Jitka Plesnikova 2022-09-30 05:39:30 UTC
Could you please submit also the second patch `Fix 'error: non-const lvalue...' caused by SWIG 4.1.0`?

Comment 5 serge_sans_paille 2022-09-30 12:50:48 UTC
Both patch landed upstream. @jplesnik do you need these patches to land in rawhide?

Comment 7 Jitka Plesnikova 2022-10-03 08:14:11 UTC
The patches will be needed for rebuild of lldb when SWIG 4.1.0 appears in Fedora rawhide. It will be probably in October.

Comment 8 serge_sans_paille 2022-10-03 09:09:12 UTC
https://src.fedoraproject.org/rpms/lldb/pull-request/55

Comment 9 Fedora Update System 2022-10-03 13:13:39 UTC
FEDORA-2022-a3b896c199 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a3b896c199

Comment 10 Fedora Update System 2022-10-03 13:24:08 UTC
FEDORA-2022-a3b896c199 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 serge_sans_paille 2022-10-03 13:26:14 UTC
Built as lldb-15.0.0-2.fc38, should be in rawhide anytime soon.