Bug 11775

Summary: oe-init-build-env should check for dash and throw a meaningful error
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Stephano Cetola <stephano>
Component: coreAssignee: Joshua Watt <JPEWhacker>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: brian.avery, jacob.kroon, JPEWhacker, meta.mr.watcher, meta.watcher, randy.macleod
Version: 2.2   
Target Milestone: 2.8 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Stephano Cetola 2017-07-07 23:44:25 UTC
If you source oe-init-build-env using dash you can illicit some truly confusing errors. It would be best if we simply checked for the use of dash and threw an error to the effect of "please use bash or compatible shell when sourcing oe-init-build-env".
Comment 1 brian avery 2017-07-08 19:57:32 UTC
perhaps we could check to see if it acts like bash or dash.
e.g.
if [ "$RANDOM" != "" ]; then

 echo "I am bash"

else

 echo " I am dash"

fi
Comment 2 Stephano Cetola 2018-02-24 18:54:00 UTC
This is a bug. It's also a simple change and should make M4.
Comment 3 Joshua Watt 2018-07-17 01:57:32 UTC
I just tried this with dash 0.5.9, and it appeared to work correctly (at least I was able to source the environment script and start a core-image-minimal build). Do you have an example of the errors that were being generated?
Comment 4 Stephen K Jolley 2018-07-23 20:39:08 UTC
Joshua,

Stephano has left the Yocto Team, so has Brian, so if this work for you why don't you close it as works for me.

Thanks,

Stephen
Comment 5 Joshua Watt 2018-10-03 15:41:41 UTC
This appears to work with dash 0.5.9. This can be reopened if it is determined that we need to work with an older version.
Comment 6 Jacob Kroon 2019-01-14 21:43:28 UTC
On ubuntu 9 using dash, it does work when run from the same directory as the script lives in, but not otherwise.
Comment 7 Jacob Kroon 2019-01-14 21:43:55 UTC
Sorry, I meant debian 9.
Comment 8 Joshua Watt 2019-05-08 13:49:51 UTC
Let's add a check in the init script so that it will fail early and loudly if dash is used and the CWD isn't correct.
Comment 9 Joshua Watt 2019-09-16 18:28:11 UTC
Fixed in 09923bbf467612a481a058d35f3717189b72477f ("oe-init-build-env: Error out when failed to locate cwd")