Opened 15 years ago

Closed 15 years ago

#2954 closed defect (fixed)

swig 1.3.39 breaks nearly all swig bindings (java, python, ruby)

Reported by: nerdboy Owned by: cfis
Priority: normal Milestone: 1.6.1
Component: RubyBindings Version: 1.6.0
Severity: major Keywords:
Cc: Even Rouault, hobu, szekerest, warmerdam

Description (last modified by warmerdam)

This was obscured before I applied the debian patch for the ruby makefile, and it's still weird... We've had libtool issues in the past, so the current Gentoo config disables it (as well as disabling parallel makes). You can see all our versions/patches here:

http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/gdal/?hideattic=1

Note that, although the number of warnings seems to have gone up, it does build successfully with both perl and python bindings (although with some deprecation warnings with python 2.6) as long as ruby is disabled.

This particular issue is especially annoying since it (gdal-1.6.0) built fine with ruby for the week or two of testing leading up to me committing the 1.6.0 ebuild last week. After what seemed like a minor system update, it stopped building, and coughs several warnings I don't recall seeing before (there are so many warnings at the end of the build log, you have to look close to find the actual errors buried in there). Trust me, it's much more obvious now than it was before I applied the debian patch; see the attached build log.

System info for the build host:
Portage 2.2_rc30 (default/linux/amd64/2008.0, gcc-4.3.3, glibc-2.8_p20080602-r1, 2.6.29.1 x86_64)
=================================================================
System uname: Linux-2.6.29.1-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4800+-with-gentoo-2.0.0
Timestamp of tree: Sat, 18 Apr 2009 09:45:02 +0000
distcc 3.0 x86_64-pc-linux-gnu [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p17-r1
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.4.4-r15, 2.5.4-r2, 2.6.1-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.3
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"     
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib64/fax /usr/share/bufrtables /usr/share/config /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg ccache distcc distlocks fixpackages multilib-strict parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://kuroshin.arnolds.bogus/gentoo/"
LANG="C"                        
LDFLAGS="-Wl,-O1"               
LINGUAS="en"                    
MAKEOPTS="-j5"                  
PKGDIR="/usr/portage/packages"  
PORTAGE_CONFIGROOT="/"          
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"       
PORTDIR="/usr/portage"          
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://kuroshin.arnolds.bogus/gentoo-portage"
USE="3dnow X Xaw3d a52 aac aalib accessibility acl acpi ada alsa amd64 ansi ao artworkextra aspell avahi avi bitmap-fonts bluetooth bonobo browserplugin bzip2 cairo caps cddb cdparanoia cdr clamav cli cracklib crypt cups curl daap dbus dga directfb divx4linux djvu dri dts dv dvd dvdr dvdread dynagraph emacs enchant encode evo exif faac faad fam fame fbcon ffmpeg firefox3 fits flac fontconfig fortran freetype freetype2 gb gd gdbm geos gif gimp glib gmp gnome gnutls gphoto2 gpm gps graphviz grass gs gstreamer gtk gtkhtml gtkspell guile hal howl iconv icq id3tag ieee1394 imagemagick imap imlib ipv6 isdnlog jabber jack jasper java jbig jikes jpeg jpeg2k jpg junit ladspa lame lapack lash latex lcms ldap libnotify libsamplerate lirc lm_sensors logrotate mad midi mmx motif mp3 mpeg mplayer mudflap multilib mysql mythtv nas nautilus ncurses netcdf nfs nls nolvmstatic nptlonly nsplugin numeric ogdi ogg oggvorbis opengl openmp oss pam pcre pda pdf perl pkcs11 plotutils png postgres pppd pulseaudio python qt qt3support qt4 quicktime readline reflection rtc ruby samba sasl sdl seamonkey session slp smartcard sndfile snmp spamassassin spell spl sse sse2 ssl subtitles svg sysfs tcl tcpd theora threads tiff timidity tk truetype truetype-fonts type1-fonts unicode usb v4l v4l2 vcd vorbis wavpack wifi xanim xcb xext xine xml xorg xpm xulrunner xv xvid xvmc zeo zlib zvbi" ALSA_CARDS="emu10k1 hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_digest auth_basic authn_alias   authn_anon authn_dbm authn_default authn_file authz_dbm authz_default   authz_groupfile authz_host authz_owner authz_user autoindex cache dav   dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache   filter headers include info log_config logio mem_cache mime mime_magic   negotiation proxy proxy_connect proxy_http rewrite setenvif speling status   unique_id userdir usertrack vhost_alias" CAMERAS="directory canon casio fuji kodak polaroid ptp2 samsung spca50x" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="fbdev radeon vesa v4l radeonhd"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Attachments (2)

build.log (425.0 KB ) - added by nerdboy 15 years ago.
Build log with ruby enabled
environment (127.8 KB ) - added by nerdboy 15 years ago.
Build environment

Download all attachments as: .zip

Change History (8)

by nerdboy, 15 years ago

Attachment: build.log added

Build log with ruby enabled

by nerdboy, 15 years ago

Attachment: environment added

Build environment

comment:1 by warmerdam, 15 years ago

Description: modified (diff)

comment:2 by warmerdam, 15 years ago

Cc: Even Rouault added

I would note that the pertinent part of the build log is:

gdal_wrap.cpp: In function 'VALUE _wrap_GCP_Info_set(int, VALUE*, VALUE)':
gdal_wrap.cpp:6057: error: could not convert 'GDAL_GCP_Info_set(arg1, ((const char*)arg2))' to 'bool'
gdal_wrap.cpp:6057: error: type 'void' argument given to 'delete', expected pointer
gdal_wrap.cpp:6060: error: invalid use of 'void'
gdal_wrap.cpp:6062: error: invalid use of 'void'
gdal_wrap.cpp: In function 'VALUE _wrap_GCP_Id_set(int, VALUE*, VALUE)':
gdal_wrap.cpp:6157: error: could not convert 'GDAL_GCP_Id_set(arg1, ((const char*)arg2))' to 'bool'
gdal_wrap.cpp:6157: error: type 'void' argument given to 'delete', expected pointer
gdal_wrap.cpp:6160: error: invalid use of 'void'
gdal_wrap.cpp:6162: error: invalid use of 'void'

in gdal/swig/ruby/gdal_wrap.c. Apparently the problem was first noticed in 1.6.0 release, though it may have existed previously.

comment:3 by Even Rouault, 15 years ago

Summary: toolchain update breaks ruby bindingsswig 1.3.39 breaks ruby bindings

One more time the swig guys have f*ked things up. ruby bindings build fine with SWIG 1.3.38, but no more with SWIG 1.3.39. I guess Gentoo has updated to 1.3.39 right ?

They have already caused a mess with the python bindings between 1.3.37 and 1.3.38...

comment:4 by Even Rouault, 15 years ago

Summary: swig 1.3.39 breaks ruby bindingsswig 1.3.39 breaks nearly all swig bindings (java, python, ruby)

Well, they have also broken the python and java bindings with 1.3.39 !!!

comment:5 by Even Rouault, 15 years ago

Cc: hobu warmerdam added

Offending generated code : "if (GDAL_GCP_Info_set(arg1,arg2)) delete[] GDAL_GCP_Info_set(arg1,arg2);"

But the GDAL_GCP_Info_set is defined in gdal.i as returning void : "void GDAL_GCP_Info_set( GDAL_GCP *gcp, const char * pszInfo ) { ... } "

So the generated code is totally bogus. SWIG 1.3.39 seems to have serious bugs. I'd suggest reverting to 1.3.38 or even earlier !

comment:6 by Even Rouault, 15 years ago

Cc: szekerest added
Milestone: 1.6.1
Resolution: fixed
Status: newclosed

Tamas kindly indicated that he has faced the same issue with csharp (See #2928) and that's fixable.

I've generalized the fix for all bindings in trunk (r16826) and in branches/1.6 (r16827)

Note: See TracTickets for help on using tickets.