Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1180257 - swig207-setools.patch breaks valid swig input
Summary: swig207-setools.patch breaks valid swig input
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: swig
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jitka Plesnikova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1192849
TreeView+ depends on / blocked
 
Reported: 2015-01-08 17:36 UTC by Miloslav Trmač
Modified: 2015-10-05 11:43 UTC (History)
3 users (show)

Fixed In Version: swig-3.0.7-7.fc24 swig-3.0.7-6.fc23 swig-3.0.7-3.fc22 swig-3.0.7-3.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-03 17:53:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miloslav Trmač 2015-01-08 17:36:23 UTC
swig207-setools.patch, apparently added for #822539 (but with no description of the rationale/details in either the bug or the patch) renames generated member functions,  e.g. for

> struct libvk_volume_property {};
> %extend libvk_volume_property {
>   %typemap(newfree) char * "g_free ($1);";
>   %immutable label;
>   %newobject label;
>   char *label;

swig used to use the name libvk_volume_property_label_get() for the getter function; with the patch, it now uses struct_libvk_volume_property_label_get().

This is in conflict with http://www.swig.org/Doc2.0/SWIGDocumentation.html#SWIG_adding_member_functions 
> Note that %extend can be used to access externally written functions provided they follow the naming convention used in this example> A little known feature of the %extend directive is that it can also be used to add synthesized attributes or to modify the behavior of existing data attributes.> The name used for %extend should be the name of the struct and not the name of any typedef to the struct.

Version-Release number of selected component (if applicable):
swig-2.0.11-1.fc20.x86_64 (up to and including current master branch)

Steps to Reproduce:
Try to check out and build volume_key from http://git.fedorahosted.org/cgit/volume_key.git .  Observe 
> python/volume_key_wrap.c: In function '_wrap_libvk_volume_property_label_get':
> python/volume_key_wrap.c:3767:3: warning: implicit declaration of function 'struct_libvk_volume_property_label_get' [-Wimplicit-function-declaration]
>    result = (char *)struct_libvk_volume_property_label_get(arg1);
and many similar warnings.


Additional info:

Preferably, please revert the patch.  If that were not possible and I had to rename the functions in the swig input, please advise how to write swig input that builds correctly against both the Fedora-patched swig and upstream unmodified one.

Comment 1 Björn 'besser82' Esser 2015-02-10 10:12:25 UTC
Hello Miloslav,

does this happen with SWIG-2.0.X on F20, only?  Can you reproduce that with SWIG-3.0.X on >= fc21?

I just did some quick investigation on that patch and it's purpose.  To me that looks like a kludge applied to SWIG for fixing a build- / functionality-issue in SETools, which is based on faulty or semantically incorrect swig-wrapper-code in there.

I will dig a bit deeper into this during the next days and see, if we can find a way to solve this in a better way.

Cheers,
  Björn

Comment 2 Miloslav Trmač 2015-02-16 21:09:14 UTC
Yes, reproduced with swig-3.0.5-2.fc21.

To do so, in more detail:
> # install packages that provide: cryptsetup-luks-devel, gettext-devel, glib2-devel, /usr/bin/gpg, gpgme-devel, libblkid-devel, nss-devel, python-devel
> git clone http://git.fedorahosted.org/cgit/volume_key.git
> cd volume_key
> autoreconf -fis -Wall
> ./configure --prefix=$(pwd)/p
> make
and observe the warnings

Comment 3 Jaroslav Reznik 2015-03-03 17:06:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 4 Jitka Plesnikova 2015-09-16 15:50:26 UTC
The patch can be removed. The issue was solved by upstream at 2.0.8.

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

Comment 5 Fedora Update System 2015-09-21 06:37:12 UTC
swig-3.0.7-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16287

Comment 6 Fedora Update System 2015-09-21 06:39:15 UTC
swig-3.0.7-3.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16289

Comment 7 Fedora Update System 2015-09-21 06:42:29 UTC
swig-3.0.7-3.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16291

Comment 8 Fedora Update System 2015-09-21 18:19:24 UTC
swig-3.0.7-3.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update swig'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16291

Comment 9 Fedora Update System 2015-09-21 18:21:56 UTC
swig-3.0.7-3.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update swig'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16289

Comment 10 Fedora Update System 2015-09-21 18:51:52 UTC
swig-3.0.7-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update swig'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16287

Comment 11 Fedora Update System 2015-10-03 17:52:38 UTC
swig-3.0.7-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2015-10-03 21:16:28 UTC
swig-3.0.7-3.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2015-10-03 21:52:21 UTC
swig-3.0.7-3.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Miloslav Trmač 2015-10-05 11:43:36 UTC
Confirmed, thanks!


Note You need to log in before you can comment on or make changes to this bug.