Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180871 - app-portage/portage-utils-0.1.28 uses non posix function get_current_dir_name()
Summary: app-portage/portage-utils-0.1.28 uses non posix function get_current_dir_name()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Portage Utils Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2007-06-04 15:57 UTC by Dan Coats
Modified: 2007-06-12 15:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
app-portage:portage-utils-0.1.28:20070604-15511.log (log,5.11 KB, text/plain)
2007-06-04 16:04 UTC, Dan Coats
Details
qmerge-posix.diff (qmerge-posix.diff,558 bytes, patch)
2007-06-04 16:52 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Coats 2007-06-04 15:57:23 UTC
qcache.c: In function 'qcache_traverse':
qcache.c:517: warning: passing argument 3 of 'scandir' from incompatible pointer type
qcache.c:529: warning: passing argument 3 of 'scandir' from incompatible pointer type
qcache.c:553: warning: passing argument 3 of 'scandir' from incompatible pointer type
qcache.c: In function 'qcache_stats':
qcache.c:776: warning: passing argument 3 of 'scandir' from incompatible pointer type
/var/tmp/portage/app-portage/portage-utils-0.1.28/temp/ccAIrTul.o: In function `pkg_verify_checksums':
main.c:(.text+0xbe55): undefined reference to `get_current_dir_name'
collect2: ld returned 1 exit status
gmake: *** [q] Error 1


Reproducible: Always

Steps to Reproduce:
1.emerge =app-portage/portage-utils-0.1.28


Actual Results:  
fails


# emerge --info
Portage 2.1.2.9 (default-bsd/fbsd/6.2/x86, gcc-4.1.2, freebsd-lib-6.2-r1, 6.2-RELEASE i386)
=================================================================
System uname: 6.2-RELEASE i386 i386
Gentoo Base System release 2.0.0_alpha3
Timestamp of tree: Mon, 04 Jun 2007 13:00:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  6.2-r1
ACCEPT_KEYWORDS="x86-fbsd ~x86-fbsd"
AUTOCLEAN="yes"
CBUILD="i686-gentoo-freebsd6.2"
CFLAGS="-O2 -mtune=i686 -pipe"
CHOST="i686-gentoo-freebsd6.2"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mtune=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks metadata-transfer parallel-fetch sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://mirror.datapipe.net/gentoo http://open-systems.ufl.edu/mirrors/gentoo http://mirror.phy.olemiss.edu/mirror/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac accessability acl adns apache2 bash-completion bcmath berkdb bidi bindinst browserplugin bzip2 cairo calendar cli crypt cups curlwrappers dbus dedicated dga dlloader dri dts emacs emacs-w3 erandom ethereal expat fastcgi font ftp gd gdbm geoip glitz glut gnusetup gnutls gtkhtml hal hardened iconv imap immqt-bc inifile innodb java java5 javascript jp2 jpeg jpeg2k libcaca libclamv libg++ live lzo midi mime ming mmap motif mpi ncurses nls nptlonly nsplugin nvidia oav objc oracle oscar oss pam pcre pdf perl php pic posix ppds python qt3support readline reflection samba session shared spl sqlite sse ssl symlink tcltktcpd tcpd test threads unicode urandom usb usepackagedmakefiles userlocales vcd vhosts x86-fbsd xml xorg xpm xprint zeroconf zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="FreeBSD" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="BSD" VIDEO_CARDS="nv nvidia vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Dan Coats 2007-06-04 16:04:50 UTC
Created attachment 121151 [details]
app-portage:portage-utils-0.1.28:20070604-15511.log
Comment 2 Timothy Redaelli (RETIRED) gentoo-dev 2007-06-04 16:15:50 UTC
get_current_dir_name is not a POSIX function. please don't use GNU extensions.
Comment 3 solar (RETIRED) gentoo-dev 2007-06-04 16:49:21 UTC
blah. I did not even mean to commit that. It was apart of my debugging.
Comment 4 solar (RETIRED) gentoo-dev 2007-06-04 16:52:43 UTC
Created attachment 121154 [details, diff]
qmerge-posix.diff

I don't have a BSD to test with. And the BSD has never provided a work environment for developers to pre-test. So I'm not going to bump to 0.1.28-r1 but I've attached the patch here that I'll put in CVS. You are free to bump portage-utils to -r1 with the patch.
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-06-04 17:06:36 UTC
Works for me and no bump needed IMHO.
Comment 6 Dan Coats 2007-06-04 17:19:05 UTC
works fine now thanks.
Comment 7 solar (RETIRED) gentoo-dev 2007-06-06 20:35:32 UTC
ReOpening bug till this is actually released.
Comment 8 Fabian Groffen gentoo-dev 2007-06-07 08:13:07 UTC
how about my patch from here?
http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/app-portage/portage-utils/files/portage-utils-0.1.28-darwin.patch?rev=6631

it somehow retains the original behaviour, just not using GNU stuff, but BSD stuff.

Also, on Darwin we don't have the GNU linker.  The linker there doesn't understand --export-dynamic, so I needed another patch on Darwin.  It's not a beautiful solution, but it works (also on AIX), the Makefile patch from this patch:
http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/app-portage/portage-utils/files/portage-utils-0.1.28-prefix.patch?rev=6631

If there is interest in getting portage-utils to work on Solaris, I can try to smash a few of the 1000+ warnings on Darwin and Solaris, which end up being an error on Solaris.

(thanks for the CC, sorry for not searching myself first)
Comment 9 solar (RETIRED) gentoo-dev 2007-06-07 15:04:10 UTC
(In reply to comment #8)
> how about my patch from here?
> http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/app-portage/portage-utils/files/portage-utils-0.1.28-darwin.patch?rev=6631


I really don't need the working dir. I needed it for about 5mins to debug
 something that should never happen again.

> Also, on Darwin we don't have the GNU linker.  The linker there doesn't
> understand --export-dynamic, so I needed another patch on Darwin.  It's not a
> beautiful solution, but it works (also on AIX), the Makefile patch from this
> patch:

I think on non linux/bsd hosts it's probably going to be best if you compiled with -DSTATIC

>http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/app-portage/portage-utils/files/portage-utils-0.1.28-prefix.patch?rev=6631

@GENTOO_PORTAGE_EPREFIX@ ?? That looks like something you would sed pre compile 
time.. If so that's not really the right solution. For the /etc/ stuff we could 
make portage-utils $PORTAGE_CONFIGROOT aware. If made aware there the values of 
pkgdir,tmpdir etc would all come from the make.conf but that is more fitting to discuss on another bug vs this one.
Comment 10 Fabian Groffen gentoo-dev 2007-06-07 15:45:33 UTC
(In reply to comment #9)
...
> > understand --export-dynamic, so I needed another patch on Darwin.  It's not a
> > beautiful solution, but it works (also on AIX), the Makefile patch from this
> > patch:
> 
> I think on non linux/bsd hosts it's probably going to be best if you compiled
> with -DSTATIC
> 
> >http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/app-portage/portage-utils/files/portage-utils-0.1.28-prefix.patch?rev=6631
> 
> @GENTOO_PORTAGE_EPREFIX@ ?? That looks like something you would sed pre 

error.  That's why I said "the Makefile patch".  Don't look at that please.
Comment 11 Fabian Groffen gentoo-dev 2007-06-07 21:11:00 UTC
This patch fixes the following (= all warnings/errors) on Solaris:
http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/app-portage/portage-utils/files/portage-utils-0.1.28-solaris.patch

With this patch Darwin still compiles (sorry couldn't check Linux), though with many warnings.  I plan to squash them another time/day.  Feedback appreciated.


main.c:204: warning: declaration of 'regex' shadows a global declaration
(renamed to qregex)
q.c:12: warning: initialization discards qualifiers from pointer target type
qcheck.c:14: warning: initialization discards qualifiers from pointer target type
qdepends.c:14: warning: initialization discards qualifiers from pointer target type
(added QOPS macro to do a cast)
q.c:106: warning: implicit declaration of function 'asprintf'
q.c:106: warning: nested extern declaration of 'asprintf'
(made Solaris asprintf implementation)
qcheck.c:187: warning: format '%4o' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
(added cast to unsigned int)
qsize.c:120: error: 'S_BLKSIZE' undeclared (first use in this function)
(use DEVID_BLKSIZE from sys/dklabel.h)
qgrep.c:276: error: 'strcasestr' undeclared (first use in this function)
(implemented strcasestr function (__GNU_SOURCE))
qcache.c:16:21: error: sys/dir.h: No such file or directory
(ifndeffed it)
qcache.c:529: error: dereferencing pointer to incomplete type
(use struct dirent instead of struct direct)
qcache.c:555: warning: passing argument 4 of 'scandir' from incompatible pointer type
(fix qcache_vercmp signature)
qcache.c:778: warning: passing argument 2 of 'scandir' from incompatible pointer type
(use struct dirent instead of struct direct)

(warningless compilation on Solaris)

% uname -a
SunOS ra 5.10 Generic_125101-08 i86pc i386 i86pc Solaris
% qlist baselayout-prefix
/export/scratch0/GentooPrefix/lib/rcscripts/awk/functions.awk
/export/scratch0/GentooPrefix/etc/gentoo-release
/export/scratch0/GentooPrefix/etc/profile
/export/scratch0/GentooPrefix/etc/env.d/99basic
/export/scratch0/GentooPrefix/etc/env.d/00basic
/export/scratch0/GentooPrefix/etc/init.d/depscan.sh
/export/scratch0/GentooPrefix/etc/init.d/runscript.sh
/export/scratch0/GentooPrefix/etc/init.d/functions.sh
/export/scratch0/GentooPrefix/sbin/env-update.sh
/export/scratch0/GentooPrefix/sbin/depscan.sh
/export/scratch0/GentooPrefix/sbin/runscript.sh
/export/scratch0/GentooPrefix/sbin/functions.sh
%
Comment 12 solar (RETIRED) gentoo-dev 2007-06-07 21:13:35 UTC
(In reply to comment #11)
> This patch fixes the following (= all warnings/errors) on Solaris:

Please use another bug for solaris/osx porting.. 
This bug here is strictly for the get_current_dir_name() bug.
Comment 13 Fabian Groffen gentoo-dev 2007-06-07 21:14:52 UTC
ok, then forget about it.  Sorry.
Comment 14 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-06-12 15:11:21 UTC
I've committed the patch to .28 so the bug is fixed.