Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 417303

Summary: sys-libs/libselinux-2.1.9: emerging with USE=ruby and RUBY_TARGETS=ruby19 leads to error
Product: Gentoo Linux Reporter: Michael Morak <michael.morak>
Component: HardenedAssignee: SE Linux Bugs <selinux>
Status: VERIFIED FIXED    
Severity: normal CC: michael.morak
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard: selinux-utils
Package list:
Runtime testing required: ---

Description Michael Morak 2012-05-23 19:53:40 UTC
Since ruby 1.9.1 was unmasked, with "eselect ruby set ruby19" and USE=ruby RUBY_TARGETS=ruby19, emerging libselinux no longer works, because it's looking for ruby.h in /usr/lib64/ruby/1.9/x86_64-linux, which for ruby-1.9.1 is no longer existent. Also the correct directory, /usr/lib64/ruby/1.9.1/x86_64-linux, does not contain a ruby.h file. It is instead located in the /usr/include/ruby-1.9.1 directory.

When calling gcc during libselinux compilation, emerge should use the correct directory for the -I flag, instead of -I/usr/lib64/ruby/1.9/x86_64-linux, which does not exist for ruby 1.9.1.

Reproducible: Always

Steps to Reproduce:
1.USE=ruby RUBY_TARGETS=ruby19 emerge -1v libselinux
Actual Results:  
>>> Emerging (1 of 1) sys-libs/libselinux-2.1.9
 * libselinux-2.1.9.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                                                                                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking libselinux-2.1.9.tar.gz to /var/tmp/portage/sys-libs/libselinux-2.1.9/work
>>> Source unpacked in /var/tmp/portage/sys-libs/libselinux-2.1.9/work
>>> Preparing source in /var/tmp/portage/sys-libs/libselinux-2.1.9/work/libselinux-2.1.9 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-libs/libselinux-2.1.9/work/libselinux-2.1.9 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-libs/libselinux-2.1.9/work/libselinux-2.1.9 ...
make -j9 AR=x86_64-pc-linux-gnu-ar CC=x86_64-pc-linux-gnu-gcc 'LDFLAGS=-fPIC -Wl,-O1 -Wl,--as-needed' all
make -C src
make[1]: Entering directory `/var/tmp/portage/sys-libs/libselinux-2.1.9/work/libselinux-2.1.9/src'
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64   -c -o seusers.o seusers.c

...............


make[1]: Entering directory `/var/tmp/portage/sys-libs/libselinux-2.1.9/work/libselinux-2.1.9/src'
swig -Wall -ruby -o selinuxswig_ruby_wrap.c -outdir ./ selinuxswig_ruby.i
../include/selinux/avc.h:410: Warning 302: Identifier 'avc_cache_stats' redefined (ignored),
../include/selinux/avc.h:390: Warning 302: previous definition of 'avc_cache_stats'.
../include/selinux/avc.h:21: Warning 801: Wrong class name (corrected to `Security_id')
../include/selinux/avc.h:21: Warning 801: Wrong class name (corrected to `Security_id')
../include/selinux/avc.h:96: Warning 801: Wrong class name (corrected to `Avc_entry_ref')
../include/selinux/avc.h:96: Warning 801: Wrong class name (corrected to `Avc_entry_ref')
../include/selinux/avc.h:122: Warning 801: Wrong class name (corrected to `Avc_memory_callback')
../include/selinux/avc.h:122: Warning 801: Wrong class name (corrected to `Avc_memory_callback')
../include/selinux/avc.h:131: Warning 801: Wrong class name (corrected to `Avc_log_callback')
../include/selinux/avc.h:131: Warning 801: Wrong class name (corrected to `Avc_log_callback')
../include/selinux/avc.h:140: Warning 801: Wrong class name (corrected to `Avc_thread_callback')
../include/selinux/avc.h:140: Warning 801: Wrong class name (corrected to `Avc_thread_callback')
../include/selinux/avc.h:148: Warning 801: Wrong class name (corrected to `Avc_lock_callback')
../include/selinux/avc.h:148: Warning 801: Wrong class name (corrected to `Avc_lock_callback')
../include/selinux/avc.h:390: Warning 801: Wrong class name (corrected to `Avc_cache_stats')
../include/selinux/avc.h:390: Warning 801: Wrong class name (corrected to `Avc_cache_stats')
../include/selinux/context.h:12: Warning 801: Wrong class name (corrected to `Context_s_t')
../include/selinux/context.h:12: Warning 801: Wrong class name (corrected to `Context_s_t')
../include/selinux/selinux.h:127: Warning 801: Wrong class name (corrected to `Av_decision')
../include/selinux/selinux.h:127: Warning 801: Wrong class name (corrected to `Av_decision')
../include/selinux/selinux.h:140: Warning 801: Wrong class name (corrected to `Selinux_opt')
../include/selinux/selinux.h:140: Warning 801: Wrong class name (corrected to `Selinux_opt')
../include/selinux/selinux.h:142: Warning 451: Setting a const char * variable may leak memory.
../include/selinux/selinux.h:146: Warning 801: Wrong class name (corrected to `Selinux_callback')
../include/selinux/selinux.h:146: Warning 801: Wrong class name (corrected to `Selinux_callback')
../include/selinux/selinux.h:344: Warning 801: Wrong class name (corrected to `Security_class_mapping')
../include/selinux/selinux.h:344: Warning 801: Wrong class name (corrected to `Security_class_mapping')
../include/selinux/selinux.h:345: Warning 451: Setting a const char * variable may leak memory.
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/ruby/1.9/x86_64-linux -fPIC -DSHARED -c -o selinuxswig_ruby_wrap.lo selinuxswig_ruby_wrap.c
selinuxswig_ruby_wrap.c:832:18: fatal error: ruby.h: No such file or directory
compilation terminated.
make[1]: *** [selinuxswig_ruby_wrap.lo] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-libs/libselinux-2.1.9/work/libselinux-2.1.9/src'
make: *** [rubywrap] Error 2
emake failed
 * ERROR: sys-libs/libselinux-2.1.9 failed (compile phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  85:  Called src_compile
 *   environment, line 3337:  Called die
 * The specific snippet of code:
 *           emake CC="$(tc-getCC)" rubywrap || die;
 *
 * If you need support, post the output of 'emerge --info =sys-libs/libselinux-2.1.9',
 * the complete build log and the output of 'emerge -pqv =sys-libs/libselinux-2.1.9'.
 * The complete build log is located at '/var/tmp/portage/sys-libs/libselinux-2.1.9/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/libselinux-2.1.9/temp/environment'.
 * S: '/var/tmp/portage/sys-libs/libselinux-2.1.9/work/libselinux-2.1.9'

Expected Results:  
Should compile fine with USE=ruby and ruby-1.9.1

emerge --info:

Portage 2.1.10.49 (hardened/linux/amd64/selinux, gcc-4.5.3, glibc-2.14.1-r3, 3.2.11-hardened x86_64)
=================================================================
System uname: Linux-3.2.11-hardened-x86_64-Intel-R-_Core-TM-_i7_CPU_950_@_3.07GHz-with-gentoo-2.1
Timestamp of tree: Wed, 23 May 2012 06:45:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.3-r1, 3.2.3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo x-portage sabayon
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox selinux sesandbox sfperms strict stricter unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.mneisen.org/ http://de-mirror.org/gentoo/ http://mirrors.linuxant.fr/distfiles.gentoo.org/ http://distfiles.gentoo.org/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/sabayon"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="64bit aac aacs acl acpi amd64 apache2 bash-completion bazaar bluray bzip2 caps cli cracklib crypt cups curl curlwrappers cvs cxx dbus djvu dri dvi exif ffmpeg flac ftp geoip gif git gmp gnutls gpm gs gzip hardened iconv icu id3 id3tag imap ipv6 javascript jpeg jpeg2k justify kerberos ldap lm_sensors logrotate lua lzma lzo matroska mercurial mmx modules mono mp3 mp4 mpeg mudflap multilib ncurses nls nptl ntfs ogg open_perms opencl openldap openmp pam pax_kernel pcre pdf perl pkcs11 png posix postgres pppd ps python quicktime raw readline rss ruby samba sasl selinux session smp sockets sql sqlite sse sse2 sse3 sse4 sse4_1 ssl ssse3 subversion svg szip tcpd theora threads tiff udev unicode vim vim-syntax vorbis wavpack webm webp wmf x264 xml xmp xorg xvid zlib" 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" 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_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="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby19" USERLAND="GNU" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-27 10:05:28 UTC
Going to force use of ruby18 for now.
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-27 11:00:04 UTC
Should be resolved in hardened-dev overlay. However, the build might fail due to bug #426428 - a fix for it is already available in that bug report.
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2012-09-08 18:45:32 UTC
In main tree,  ~arch'ed
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-06 16:57:03 UTC
Stabilized; the patch to still include support for ruby19 might hit a later -rev though