Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670348 - sys-process/psmisc-23.2-r1 - peekfd.c: In function ‘print_version’: peekfd.c:120:46: error: ‘VERSION’ undeclared (first use in this function)
Summary: sys-process/psmisc-23.2-r1 - peekfd.c: In function ‘print_version’: peekfd.c:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-11-05 05:47 UTC by Gabriel Marcano
Modified: 2019-10-26 11:27 UTC (History)
2 users (show)

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


Attachments
psmisc-23.2-r1.patch for fixing peekfd compilation (psmisc-23.2-r1.ebuild.patch,355 bytes, patch)
2018-11-05 05:47 UTC, Gabriel Marcano
Details | Diff
build.log (build.log,24.34 KB, text/plain)
2019-10-26 05:53 UTC, Martin Mokrejš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Marcano 2018-11-05 05:47:33 UTC
Created attachment 554120 [details, diff]
psmisc-23.2-r1.patch for fixing peekfd compilation

When psmisc was compiling, I ran into the following error (non-fatal):
peekfd.c: In function ‘print_version’:
peekfd.c:120:46: error: ‘VERSION’ undeclared (first use in this function)
   fprintf(stderr, _("peekfd (PSmisc) %s\n"), VERSION);

I was... curious as to why psmisc was able to compile successfully even with that compilation failure, so I went poking around in the ebuild. I found the following comment in src_compile:
    # peekfd is a fragile crap hack #330631

Maybe it's just my system, but whatever issue peekfd had back in the day may not be around anymore (at least not for AMD64). I removed the src_compile function from the ebuild to let it just use the default implementation of that function, and it compiled fine, even peekfd. Looks like it's time to possibly drop that peekfd hack?

The reason the hack breaks is that the HAVE_CONFIG_H variable is not defined the way the hack invokes the compilation for that file. When the file is compiled as part of the normal build process, the define is included, and everything seems to build properly. Let me know if you need any more information. I'm attaching my patch to the ebuild, just for convenience.

Here's my emerge--info:

--
$ emerge --info =psmisc-232.2-r1
Portage 2.3.51 (python 3.5.5-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-8.2.0, glibc-2.27-r6, 4.19.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.6
KiB Mem:    16359656 total,   7902756 free
KiB Swap:   16776192 total,  16776192 free
Timestamp of repository gentoo: Sun, 04 Nov 2018 21:45:01 +0000
Head commit of repository gentoo: 6a18bb60f924dc63b74598375d6d06aee73ff08c
sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p3) 2.31.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.5 [disabled]
app-shells/bash:          4.4_p23::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.5.5-r1::gentoo, 3.6.6::gentoo
dev-util/ccache:          3.5-r1::gentoo
dev-util/cmake:           3.12.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.39.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r1::gentoo
sys-devel/gcc:            8.2.0-r4::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.us.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

Local_Overlay
    location: /usr/local/portage
    masters: gentoo
    eclass-overrides: gentoo Local_Overlay

chrytoo
    location: /var/lib/layman/chrytoo
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=ivybridge -pipe -fomit-frame-pointer -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=ivybridge -pipe -fomit-frame-pointer -O2"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en es"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
USE="=-ppp X a52 aac acl acpi activities alsa amd64 avx bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam flac fortran gdbm gif glamor gpm gtk iconv ipv6 jpeg kde kipi kwallet lcms ldap libnotify libtirpc mad mmx mng mp3 mp4 mpeg mtp multilib ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qml qt qt5 readline sdl seccomp semantic-desktop spell sse sse2 sse3 sse4 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vdpau vorbis widgets wxwidgets x264 xattr xcb xcomposite xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias 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 cgi cgid 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 rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 emu" INPUT_DEVICES="evdev roccat_tyon" KERNEL="linux" L10N="en-US es" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="cnd mobility" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 python3_5" RUBY_TARGETS="ruby23 ruby23 ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 tt_1 2019-05-04 22:12:44 UTC
It's a ten years old hack. the problem adressed has been fixed by upstream recently, therefore the hack should be tree cleaned.
Comment 2 Martin Mokrejš 2019-10-26 05:52:20 UTC
Still happens with =sys-process/psmisc-23.3.
Comment 3 Martin Mokrejš 2019-10-26 05:53:43 UTC
Created attachment 593984 [details]
build.log
Comment 4 Larry the Git Cow gentoo-dev 2019-10-26 11:27:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07017c65f32711111ce3184112f22409aa2af0ac

commit 07017c65f32711111ce3184112f22409aa2af0ac
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-10-26 11:27:02 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-10-26 11:27:21 +0000

    sys-process/psmisc: Removed obsolete peekfd compile hack
    
    Thanks-to: Gabriel Marcano <gabemarcano@yahoo.com>
    Closes: https://bugs.gentoo.org/670348
    Package-Manager: Portage-2.3.78, Repoman-2.3.17
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 sys-process/psmisc/psmisc-23.2-r2.ebuild | 6 ------
 sys-process/psmisc/psmisc-23.3.ebuild    | 6 ------
 2 files changed, 12 deletions(-)