Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 616598 - dev-util/android-tools-6.0.1_p79 will not build when bashdb is installed
Summary: dev-util/android-tools-6.0.1_p79 will not build when bashdb is installed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Zac Medico
URL:
Whiteboard:
Keywords: InVCS
: 616672 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-25 15:05 UTC by peteru
Modified: 2025-01-08 23:35 UTC (History)
4 users (show)

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


Attachments
emerge --info (emerge-info,6.15 KB, text/plain)
2017-04-25 15:05 UTC, peteru
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peteru 2017-04-25 15:05:55 UTC
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'
 *
Comment 1 Zac Medico gentoo-dev 2017-04-26 05:22:40 UTC
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*.
Comment 2 Greg Turner 2017-04-26 08:32:30 UTC
(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
 }
Comment 3 Greg Turner 2017-04-26 08:42:41 UTC
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.
Comment 4 peteru 2017-04-26 14:07:46 UTC
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 ;-)
Comment 5 Mike Gilbert gentoo-dev 2017-04-26 16:40:55 UTC
*** Bug 616672 has been marked as a duplicate of this bug. ***
Comment 6 Mike Gilbert gentoo-dev 2017-04-26 17:15:21 UTC
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.
Comment 7 Mike Gilbert gentoo-dev 2017-04-26 17:27:54 UTC
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
Comment 8 Mike Gilbert gentoo-dev 2017-04-26 17:33:52 UTC
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.
Comment 9 Mike Gilbert gentoo-dev 2017-04-26 17:38:44 UTC
The extdebug option was introduced in portage here.

https://gitweb.gentoo.org/proj/portage.git/commit/?id=1173699ee506de28463c11668d688679381b2128
Comment 10 Zac Medico gentoo-dev 2017-04-26 20:11:27 UTC
(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