Created attachment 470852 [details] emerge --info When app-shells/bashdb-4.4.0.92 is installed on the system, dev-util/android-tools-6.0.1_p79 will not build. Uninstalling bashdb allows the dev-util/android-tools-6.0.1_p79 to build and install without any issues. The following output is produced with bashdb installed: >>> Verifying ebuild manifests >>> Emerging (1 of 1) dev-util/android-tools-6.0.1_p79::gentoo >>> Failed to emerge dev-util/android-tools-6.0.1_p79, Log file: >>> '/tmp/portage/dev-util/android-tools-6.0.1_p79/temp/build.log' >>> Jobs: 0 of 1 complete, 1 failed Load avg: 1.01, 0.63, 0.50 * Package: dev-util/android-tools-6.0.1_p79 * Repository: gentoo * Maintainer: zmedico@gentoo.org * Upstream: https://code.google.com/p/android/issues/list * USE: abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU * FEATURES: compressdebug preserve-libs sandbox userpriv usersandbox >>> Unpacking source... >>> Unpacking android-tools-6.0.1_r79-arch.tar.gz to /tmp/portage/dev-util/android-tools-6.0.1_p79/work/arch >>> Unpacking android-tools-6.0.1_r79-core.tar.gz to /tmp/portage/dev-util/android-tools-6.0.1_p79/work/core >>> Unpacking android-tools-6.0.1_r79-extras.tar.gz to /tmp/portage/dev-util/android-tools-6.0.1_p79/work/extras >>> Unpacking android-tools-6.0.1_r79-libselinux.tar.gz to /tmp/portage/dev-util/android-tools-6.0.1_p79/work/libselinux >>> Unpacking android-tools-6.0.1_r79-f2fs-tools.tar.gz to /tmp/portage/dev-util/android-tools-6.0.1_p79/work/f2fs-tools >>> Source unpacked in /tmp/portage/dev-util/android-tools-6.0.1_p79/work >>> Preparing source in /tmp/portage/dev-util/android-tools-6.0.1_p79/work ... * Applying fix_build.patch ... [ ok ] >>> Source prepared. >>> Configuring source in /tmp/portage/dev-util/android-tools-6.0.1_p79/work ... >>> Source configured. >>> Compiling source in /tmp/portage/dev-util/android-tools-6.0.1_p79/work ... bash debugger, bashdb, release 4.4-0.92 Copyright 2002, 2003, 2004, 2006-2012, 2014 Rocky Bernstein This is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. (/tmp/portage/dev-util/android-tools-6.0.1_p79/work/build.sh:1): 1: gcc -o core/libmincrypt/dsa_sig.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/dsa_sig.c >>> Source compiled. >>> Test phase [not enabled]: dev-util/android-tools-6.0.1_p79 >>> Install android-tools-6.0.1_p79 into /tmp/portage/dev-util/android-tools-6.0.1_p79/image/ category dev-util !!! dobin: adb does not exist * ERROR: dev-util/android-tools-6.0.1_p79::gentoo failed (install phase): * dobin failed * * If you need support, post the output of `emerge --info '=dev-util/android-tools-6.0.1_p79::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-util/android-tools-6.0.1_p79::gentoo'`. * The complete build log is located at '/tmp/portage/dev-util/android-tools-6.0.1_p79/temp/build.log'. * The ebuild environment file is located at '/tmp/portage/dev-util/android-tools-6.0.1_p79/temp/environment'. * Working directory: '/tmp/portage/dev-util/android-tools-6.0.1_p79/work' * S: '/tmp/portage/dev-util/android-tools-6.0.1_p79/work' * QA Notice: file does not exist: * * dobin: adb does not exist * Messages for package dev-util/android-tools-6.0.1_p79: * ERROR: dev-util/android-tools-6.0.1_p79::gentoo failed (install phase): * dobin failed * * If you need support, post the output of `emerge --info '=dev-util/android-tools-6.0.1_p79::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-util/android-tools-6.0.1_p79::gentoo'`. * The complete build log is located at '/tmp/portage/dev-util/android-tools-6.0.1_p79/temp/build.log'. * The ebuild environment file is located at '/tmp/portage/dev-util/android-tools-6.0.1_p79/temp/environment'. * Working directory: '/tmp/portage/dev-util/android-tools-6.0.1_p79/work' * S: '/tmp/portage/dev-util/android-tools-6.0.1_p79/work' * * The following package has failed to build, install, or execute postinst: * * (dev-util/android-tools-6.0.1_p79:0/0::gentoo, ebuild scheduled for merge), Log file: * '/tmp/portage/dev-util/android-tools-6.0.1_p79/temp/build.log' *
I can't reproduce this. It's possible that you have a bashrc that is calling bashdb, either in /etc/portage/bashrc or /etc/portage/env/app-shells/bashdb*.
(In reply to Zac Medico from comment #1) > I can't reproduce this. It's possible that you have a bashrc that is calling > bashdb, either in /etc/portage/bashrc or /etc/portage/env/app-shells/bashdb*. I can't figure out the root cause. But I can figure out the solution: --- android-tools-6.0.1_p79.ebuild.orig 2017-04-26 01:31:25.150153589 -0700 +++ android-tools-6.0.1_p79.ebuild 2017-04-26 01:31:34.098074817 -0700 @@ -62,7 +62,8 @@ src_prepare() { src_compile() { chmod +x ./generate_build.rb || die - ./generate_build.rb > build.sh || die + echo '#!/bin/bash' > build.sh || die + ./generate_build.rb >> build.sh || die chmod +x build.sh || die ./build.sh || die }
The more I think about it, something pretty wierd must be happening to give this bashdb invocation result. I think the answer lies in figuring out: what kind of executable has the kernel (that's still who makes this decision in 2017, no?) decided this is without the shebang in it? I suspect the answer would make for a fun story at a cocktail party attended mostly by systems administrators.
Nothing that would specify bashdb explicitly or anything that would be apparently related to enabling bashdb # grep bashdb -r /etc/ # grep -e --debugger -r /etc # grep extdebug -r /etc # ls /etc/portage/env splitdebug.conf # cat /etc/portage/env/splitdebug.conf FEATURES="splitdebug" CFLAGS="-march=native -O2 -pipe -funit-at-a-time -ggdb" # The kernel currently in use is: # uname -a Linux beep 4.10.12-gentoo #1 SMP Mon Apr 24 21:39:19 AEST 2017 x86_64 Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz GenuineIntel GNU/Linux However, the same issue was there with 4.10.10 Adding shebang is a good fix, however, I would be very keen to learn why the lack of shebang caused the system to try bashdb. Certainly a head scratcher ;-)
*** Bug 616672 has been marked as a duplicate of this bug. ***
I can reproduce this. I've traced the issue to the bash "extdebug" option, which is being enabled in isolated-functions.sh. shopt -s extdebug If I comment this line, bashdb is not invoked and the build proceeds normally.
Reading through the bash sources, if extdebug is enabled, it looks like bash will source /usr/share/bashdb/bashdb-main.inc on startup. You can get the same behavior by invoking bash --debugger. http://git.savannah.gnu.org/cgit/bash.git/tree/shell.c?h=bash-4.4#n1455 http://git.savannah.gnu.org/cgit/bash.git/tree/configure.ac?h=bash-4.4#n140
A very easy workaround for the ebuild would be to invoke "bash ./build.sh" instead of "./build.sh". That should reset any bash options that are in effect by starting a new bash process.
The extdebug option was introduced in portage here. https://gitweb.gentoo.org/proj/portage.git/commit/?id=1173699ee506de28463c11668d688679381b2128
(In reply to Mike Gilbert from comment #8) > A very easy workaround for the ebuild would be to invoke "bash ./build.sh" > instead of "./build.sh". That should reset any bash options that are in > effect by starting a new bash process. Thanks, fixed now: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74d23e41f76e6655be74b1902b3a3022906ee1d2 (In reply to Mike Gilbert from comment #9) > The extdebug option was introduced in portage here. > > https://gitweb.gentoo.org/proj/portage.git/commit/ > ?id=1173699ee506de28463c11668d688679381b2128 I can reproduce the problem with bash-4.4_p12 and bashdb-4.4.0.92. Apparently the extdebug option is needed for the BASH_ARGV variable: https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html