Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 526200 - dev-java/icedtea- fails to build with dash as the default shell
Summary: dev-java/icedtea- fails to build with dash as the default shell
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andrew John Hughes
Depends on:
Blocks: nonbash
  Show dependency tree
Reported: 2014-10-21 09:34 UTC by Octave Berry
Modified: 2020-05-12 09:18 UTC (History)
7 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Octave Berry 2014-10-21 09:34:45 UTC
Icedtea build fails at the beginning of the compile phase if the default shell is set to dash instead of bash.
There is no clear error message pointing toward that, but these kind of lines : 

(in the configure process)
checking if a javah executable is specified... no
./configure: 9911: test: xno: unexpected operator
hecking if a jar executable is specified... no
./configure: 10033: test: xno: unexpected operator

With the final build lines being the following
rm -f rt-source-files.txt
for files in        ; \
do \
  echo $files >> rt-source-files.txt ; \
touch rt-source-files.txt
mkdir -p lib/rt
if echo        | grep '\S' &> /dev/null ; then \
  /var/tmp/portage/dev-java/icedtea- -g -encoding utf-8    -source 7 -target 7 -d lib/rt \
    -classpath /usr/lib64/icedtea7/jre/lib/rt.jar \
            -sourcepath '/var/tmp/portage/dev-java/icedtea-' \
            -bootclasspath \'\' @rt-source-files.txt ; \
javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options

Changing the default shell to bash and restarting the build seems to fix the issue.

Reproducible: Always

Steps to Reproduce:
1. Change the default sh to dash
2. Build icedtea
Actual Results:  
The build fails in a strange way

Expected Results:  
icedtea builds properly

emerge --info '=dev-java/icedtea-'
Portage 2.2.14 (python 3.4.2-final-0, hardened/linux/amd64, gcc-4.9.1, glibc-2.19-r1, 3.17.1-gentoo x86_64)
                         System Settings
System uname: Linux-3.17.1-gentoo-x86_64-Intel-R-_Core-TM-_i5-2540M_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:     8135032 total,    814564 free
KiB Swap:   10484728 total,   9843228 free
Timestamp of tree: Tue, 21 Oct 2014 07:45:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.3_p30
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r1
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.9.1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo systemd ultrabug x11 pentoo x-portage
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=sandybridge -maes -mavx -mcx16 -mfxsr -mmmx -mpclmul -mpopcnt -msahf -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mtune=sandybridge -mxsave -mxsaveopt -O2 -pipe"
CONFIG_PROTECT="/etc /etc/shorewall /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.1/conf /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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 /usr/bin/startx"
CXXFLAGS="-march=sandybridge -maes -mavx -mcx16 -mfxsr -mmmx -mpclmul -mpopcnt -msahf -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mtune=sandybridge -mxsave -mxsaveopt -O2 -pipe"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
PORTDIR_OVERLAY="/var/lib/layman/systemd /var/lib/layman/ultrabug /var/lib/layman/x11 /var/lib/layman/pentoo /usr/local/portage"
USE="X a52 aac aalib acl acpi alsa amd64 amr apng avx bash-completion berkdb bluetooth bzip2 c++0x caps cdda cddb cjk cli clock cracklib crypt cscope cups curl cxx dbus dc1394 declarative device-mapper dirac directfb djvu dri dts dvb dvd eap-sim ebook embedded encode exif faac fasteap fbcon ffmpeg fftw flac fluidsynth fontconfig frei0r fuse gbm gdal gdbm geos gif gmp go graphics graphite graphviz gs gstreamer hardened hdri iconv icu idn ieee1394 imagemagick iproute2 ipv6 jbig jpeg jpeg2k justify kde kerberos lcms libass libnotify libv4l2 llvm lzma mad matroska midi mikmod mmx mng mod modules mp3 mpeg mtp multilib multitarget mysql ncurses netlink network nls nptl ntfsprogs objc objc++ objc-gc ogg openal openexr opengl openmp osmesa outputs pam pax_kernel pcre pdf pic png postgres proj pstricks pulseaudio python qt3support qt4 readline reports rtmp rtsp ruby schroedinger sdl semantic-desktop session shout skins smp sna speex sql sqlite sqlite3 sse sse2 sse3 sse4_1 ssl ssse3 svg system-sqlite systemd taglib tcpd theora threads tiff truetype twolame udev unicode unlock-notify urandom usb utils v4l v4l2 vaapi video vim-pager vim-syntax vorbis vpx wayland webkit webp wma-fixed wmf wps x264 xattr xcb xetex xinerama xml xtpax xv xvid zlib zsh-completion" 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 proxy proxy_http" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="crypt lvm systemd" 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 ublox ubx" GRUB_PLATFORMS="pc efi-64" INPUT_DEVICES="keyboard mouse evdev keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3 python3_4" QEMU_SOFTMMU_TARGETS="arm i386 x86_64 ppc ppc64 mips mips64" QEMU_USER_TARGETS="arm i386 x86_64 ppc ppc64 mips" RUBY_TARGETS="ruby19 ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965" 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"
USE_PYTHON="2.7 3.3"
Comment 1 into-the-trash-it-goes 2019-10-29 06:11:51 UTC
The following command not only incoporates &> as a bashism, but also depends upon GNU grep.

  if echo $(ICEDTEA_BOOTSTRAP_CLASSES) | grep '\S' &> /dev/null ; then \

It could be written instead as:

  if echo $(ICEDTEA_BOOTSTRAP_CLASSES) | grep -q '[^[:space:]]' 2>/dev/null ; then \

The icedtea7 series has been dropped from portage, so this is no longer a bug from gentoo's perspective. That said, it looks as though it is still being maintained upstream. I might take a closer look at its, with regard to posix conformance. In the event that I do, I shall submit a patch upstream.
Comment 2 Alexander Tsoy 2020-05-10 21:33:41 UTC
It's still an issue with dev-java/icedtea-3.16.0:

checking if there is a ccache gcc wrapper on the PATH... ./configure: 12319: ./configure: Syntax error: redirection unexpected

Here string in configure:

$ sudo sed -n '12319p' /var/tmp/portage/dev-java/icedtea-3.16.0/work/icedtea-3.16.0/configure
     NO_CCACHE_PATH=$(sed "s#[^:]*$(dirname ${ABS_CC}):##g" <<< "${PATH}")
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-10 23:38:37 UTC
*** Bug 722292 has been marked as a duplicate of this bug. ***
Comment 4 into-the-trash-it-goes 2020-05-11 00:01:13 UTC
This bug should not have been retconned. It is a disservice to the original reporter.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-11 20:10:57 UTC
*** Bug 722536 has been marked as a duplicate of this bug. ***
Comment 6 James McClain 2020-05-12 02:18:58 UTC
(In reply to Alexander Tsoy from comment #2)
> It's still an issue with dev-java/icedtea-3.16.0:
> checking if there is a ccache gcc wrapper on the PATH... ./configure: 12319:
> ./configure: Syntax error: redirection unexpected
> Here string in configure:
> $ sudo sed -n '12319p'
> /var/tmp/portage/dev-java/icedtea-3.16.0/work/icedtea-3.16.0/configure
>      NO_CCACHE_PATH=$(sed "s#[^:]*$(dirname ${ABS_CC}):##g" <<< "${PATH}")

I can also confirm that this happens if /bin/sh is a link to dash.  Resetting it to bash fixes it.
Comment 7 into-the-trash-it-goes 2020-05-12 09:06:44 UTC
Un-hijacking. The bug, as originally reported by Octave Berry was for version (OpenJDK 7), not 3.16.0 (OpenJDK 8). The former has been dropped by Gentoo and would have required a different patch anyway. Please direct commentary about 3.16.0 to bug 722292. Thank you.
Comment 8 into-the-trash-it-goes 2020-05-12 09:18:47 UTC
Resolving as OBSOLETE. All things concerning Java 7 were dropped by Gentoo around the end of 2017 so it cannot be resolved downstream at this point (potentially upstream, though).