<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10114</bug_id>
          
          <creation_ts>2016-08-11 14:18:49 +0000</creation_ts>
          <short_desc>Insufficent error-handling in SDK installer</short_desc>
          <delta_ts>2017-12-06 17:07:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>eSDK</product>
          <component>eSDK</component>
          <version>2.0.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Should require backport also</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>linus.wallgren</reporter>
          <assigned_to name="Mariano Lopez">mariano.lopez</assigned_to>
          <cc>akuster</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65061</commentid>
    <comment_count>0</comment_count>
    <who name="">linus.wallgren</who>
    <bug_when>2016-08-11 14:18:49 +0000</bug_when>
    <thetext>I don&apos;t have a very complete understanding of yocto and its build systems, so hopefully I haven&apos;t missed anything obvious.

I&apos;m trying to install an SDK I have created in a docker container but noticed that certain errors weren&apos;t properly dealt with by the installer.

I was missing the bzip2 dependency and tried to install and got this:

```
You are about to install the SDK to &quot;/home/user/sdk&quot;. Proceed[Y/n]? Y
Extracting SDK...tar (grandchild): bzip2: Cannot exec: No such file or directory
tar (grandchild): Error is not recoverable: exiting now
tar: Child died with signal 13
tar: Error is not recoverable: exiting now
done
Setting it up...ls: cannot access &apos;/home/user/sdk/environment-setup-*&apos;: No such file or directory
mv: cannot move &apos;/tmp/tmp.J2J4wgh7z1/relocate_sdk.sh&apos; to &apos;/relocate_sdk.sh&apos;: Permission denied
chmod: cannot access &apos;/relocate_sdk.sh&apos;: No such file or directory
./toolchain.sh: 208: ./toolchain.sh: /relocate_sdk.sh: not found
SDK could not be set up. Relocate script failed. Abort!
```

Notice how it does not notice the error of a missing bzip2 executable but fails later when files are missing.

After I installed bzip and python (two other dependencies that I had missing), I got the following issue (because I was missing the file binary):

```
You are about to install the SDK to &quot;/home/user/sdk&quot;. Proceed[Y/n]? Y
Extracting SDK..........................................done
Setting it up...xargs: file: No such file or directory
sed: no input files
done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
 $ . /home/user/sdk/environment-setup-cortexa8hf-vfp-neon-poky-linux-gnueabi
```

Notice how it doesn&apos;t detect the issue and considers the installation to be successful, despite a big red warning.

The issue is in the toolchain-shar-relocate.sh script:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/files/toolchain-shar-relocate.sh#n48

I see no error-handling in this file whatsoever, perhaps setting the pipefail ( https://www.gnu.org/software/bash/manual/html_node/Pipelines.html ) can be a solution?

Regards
Linus</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65940</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-09-08 17:10:01 +0000</bug_when>
    <thetext>Moving to M4 due to time constraints.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66421</commentid>
    <comment_count>2</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2016-09-21 15:59:25 +0000</bug_when>
    <thetext>Sent patch to the mailing list:

http://lists.openembedded.org/pipermail/openembedded-core/2016-September/126761.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66634</commentid>
    <comment_count>3</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2016-09-27 15:13:24 +0000</bug_when>
    <thetext>This has been solved in commits:

http://git.openembedded.org/openembedded-core/commit/meta/files/toolchain-shar-relocate.sh?id=c9982dab4cfdd5963d2c2dd4aab99dd6a27fcd1c

http://git.openembedded.org/openembedded-core/commit/meta/files/toolchain-shar-relocate.sh?id=8d6ee36493800a30e9bd6eacb671fbafe5d61ad7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66903</commentid>
    <comment_count>4</comment_count>
    <who name="">linus.wallgren</who>
    <bug_when>2016-10-04 20:53:57 +0000</bug_when>
    <thetext>While I haven&apos;t been able to test this yet, it does not seem that your patch addresses the issues of missing dependencies, specifically bzip2 and python. Have you left that out on purpose?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66904</commentid>
    <comment_count>5</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2016-10-04 21:22:51 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; While I haven&apos;t been able to test this yet, it does not seem that your patch
&gt; addresses the issues of missing dependencies, specifically bzip2 and python.
&gt; Have you left that out on purpose?

bzip2 has been replaced long ago in commit 193086137b899a0a4e774ffc337ed0da9947fd4f

python is checked in relocation script when calling the dynamic generated script. The only thing that I did on that was to change the shebang from bash to sh.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>