Bug 5625 - Bitbake ungracefully crashed when chrpath is not installed.
Summary: Bitbake ungracefully crashed when chrpath is not installed.
Status: RESOLVED INVALID
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.6
Assignee: Paul Eggleton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-12-03 10:46 UTC by David Nyström
Modified: 2014-01-16 16:37 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Nyström 2013-12-03 10:46:33 UTC
Bitbake ungracefully crashes when chrpath is not installed.

A warning or error should be displayed when trying to build without it.


----------------------------------------------------------------
ERROR: Error executing a python function in /media/sdb5/eel/poky/meta/recipes-devtools/quilt/quilt-native_0.60.bb:
 
The stack trace of python calls that resulted in this exception/failure was:
File: 'relocatable_binaries_preprocess', lineno: 6, function: <module>
     0002:def relocatable_binaries_preprocess(d):
     0003:    rpath_replace(d.expand('/media/sdb5/eel/build/tmp/work/x86_64-linux/quilt-native/0.60-r0/sysroot-destdir/'), d)
     0004:
     0005:
 *** 0006:relocatable_binaries_preprocess(d)
     0007:
File: 'relocatable_binaries_preprocess', lineno: 3, function: relocatable_binaries_preprocess
     0001:
     0002:def relocatable_binaries_preprocess(d):
 *** 0003:    rpath_replace(d.expand('/media/sdb5/eel/build/tmp/work/x86_64-linux/quilt-native/0.60-r0/sysroot-destdir/'), d)
     0004:
     0005:
     0006:relocatable_binaries_preprocess(d)
     0007:
File: 'chrpath.bbclass', lineno: 7, function: rpath_replace
     0003:
     0004:    for bindir in bindirs:
     0005:        #bb.note ("Processing directory " + bindir)
     0006:        directory = path + "/" + bindir
 *** 0007:        process_dir (path, directory, d)
     0008:
File: 'chrpath.bbclass', lineno: 43, function: process_dir
     0039:                perms = None
     0040:            else:
     0041:                # Temporarily make the file writeable so we can chrpath it
     0042:                os.chmod(fpath, perms|stat.S_IRWXU)
 *** 0043:            process_file(cmd, fpath, rootdir, baseprefix, tmpdir, d)
     0044:
     0045:            if perms:
     0046:                os.chmod(fpath, perms)
     0047:
File: 'chrpath.bbclass', lineno: 4, function: process_file_linux
  File "chrpath.bbclass", line 4, in process_file_linux
 
File: '/usr/lib/python2.7/subprocess.py', lineno: 709, function: __init__
     0705:                                cwd, env, universal_newlines,
     0706:                                startupinfo, creationflags, shell, to_close,
     0707:                                p2cread, p2cwrite,
     0708:                                c2pread, c2pwrite,
 *** 0709:                                errread, errwrite)
     0710:        except Exception:
     0711:            # Preserve original exception in case os.close raises.
     0712:            exc_type, exc_value, exc_trace = sys.exc_info()
     0713:
File: '/usr/lib/python2.7/subprocess.py', lineno: 1326, function: _execute_child
     1322:                except OSError as e:
     1323:                    if e.errno != errno.ECHILD:
     1324:                        raise
     1325:                child_exception = pickle.loads(data)
 *** 1326:                raise child_exception
     1327:
     1328:
     1329:        def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
     1330:                _WTERMSIG=os.WTERMSIG, _WIFEXITED=os.WIFEXITED,
Exception: OSError: [Errno 2] No such file or directory
 
ERROR: Function failed: relocatable_binaries_preprocess
ERROR: Logfile of failure stored in: /media/sdb5/eel/build/tmp/work/x86_64-linux/quilt-native/0.60-r0/temp/log.do_populate_sysroot.4713
ERROR: Task 17 (/media/sdb5/eel/poky/meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_populate_sysroot) failed with exit code '1'
Comment 1 Paul Eggleton 2013-12-03 13:32:36 UTC
chrpath is in the default value of SANITY_REQUIRED_UTILITIES, so it should be checked for at startup - are you overriding this in your configuration?
Comment 2 Saul Wold 2013-12-05 15:43:37 UTC
Can you give us some more details if you are overriding the sanity tests
Comment 3 David Nyström 2013-12-18 15:10:31 UTC
Hi,

As far as I remember, this was a vanilla poky-clone on a new ubuntu installation, which was missing chrpath.

Hmm, ubuntu has this wierd behaviour of trying to locate missing binaries for you, i.e. 
---
/media/sdb5/oel/meta-openembedded/meta-oe/recipes-support/pcsc-lite [(fb0f8dc...)]
$ banana
The program 'banana' is currently not installed. You can install it by typing:
sudo apt-get install emboss
---

I wonder if this might be affecting the sanity check.
Comment 4 Paul Eggleton 2013-12-18 15:16:33 UTC
Well, it seems unlikely because the method sanity.bbclass uses is effectively bb.utils.which() which does its own path traversal/existence checking - it doesn't try running the command.

Which version of Ubuntu was this on?
Comment 5 David Nyström 2013-12-18 15:25:21 UTC
Well, I don't have the setup anymore.
So I guess if I'm alone seeing this, it can be closed.

uname -a 
Linux nysan 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:04:55 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="13.10, Saucy Salamander"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.10"
VERSION_ID="13.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
Comment 6 Paul Eggleton 2014-01-06 10:04:34 UTC
I've been able to confirm this, however I'm fairly sure the sanity check has to have passed once previously to get into this situation, since the check for required utilities is done in the check_sanity_version_change() function which is only called when SANITY_VERSION changes or <builddir>/conf/sanity_info doesn't exist. 

Did you by any chance have chrpath installed at one time and then remove it?
Comment 7 Paul Eggleton 2014-01-16 16:37:02 UTC
As above, I'm pretty sure this is a result of us deliberately not running these sanity tests on every build (in order to save time) and chrpath being removed or otherwise becoming unavailable after the test was run on a prior build. If the issue can be reproduced in circumstances other than what I've described, please reopen.