<?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>8825</bug_id>
          
          <creation_ts>2015-12-17 05:10:24 +0000</creation_ts>
          <short_desc>Failed to run devtool sdk-update</short_desc>
          <delta_ts>2016-02-04 02:28:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yi Zhao">yi.zhao</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>bluelightning</cc>
    
    <cc>ke.zou</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>yi.zhao</cc>
          
          <qa_contact name="Yi Zhao">yi.zhao</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>New (Never tested)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57316</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2015-12-17 05:10:24 +0000</bug_when>
    <thetext>Git rev: master/5e3e2e0cbb0a49986f4653e64c4c8d2b5461645e

Steps:
1. Build an ext_sdk toolchain against the old git rev
2. Build another ext_sdk toolchain against the new git rev
3. Install the old ext_sdk into poky_sdk_old directory, install the new ext_sdk into poky_sdk_new directory
4. cd poky_sdk_old, setup the environment
5. Run devtool sdk-update  poky_sdk_new

Error message:
##############
$ devtool sdk-update /buildarea/poky_sdk_new 
NOTE: Installing sstate objects into /buildarea/poky_sdk_old
NOTE: Updating configuration files
NOTE: Updating layers
Traceback (most recent call last):
  File &quot;/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool&quot;, line 288, in &lt;module&gt;
    ret = main()
  File &quot;/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool&quot;, line 277, in main
    ret = args.func(args, config, basepath, workspace)
  File &quot;/buildarea/poky_sdk_old/layers/poky/scripts/lib/devtool/sdk.py&quot;, line 135, in sdk_update
    shutil.copytree(new_layers_dir, old_layers_dir)
  File &quot;/buildarea/poky_sdk_old/tmp/sysroots/x86_64-linux/usr/lib/python2.7/shutil.py&quot;, line 208, in copytree
    raise Error, errors
Error: [(&apos;/buildarea/poky_sdk_new/layers/poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster.sqlite&apos;, &apos;/buildarea/poky_sdk_old/layers/poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster.sqlite&apos;, &quot;[Errno 2] No such file or directory: &apos;/buildarea/poky_sdk_new/layers/poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster.sqlite&apos;&quot;)]
###################

Check the file toaster.sqlite, it is a empty symbolic link
################
ls -l /buildarea/poky_sdk_new/layers/poky/bitbake/lib/toaster/contrib/tts/toasteruitest/
total 116
-rwxrwxr-x 1 yocto yocto   3060 Dec  2 13:48 run_toastertests.py
lrwxrwxrwx 1 yocto yocto     32 Dec 17 09:45 toaster.sqlite -&gt; ../../../../../../toaster.sqlite
-rwxrwxr-x 1 yocto yocto 109285 Dec 11 10:08 toaster_automation_test.py
-rw-rw-r-- 1 yocto yocto    763 Dec  2 13:48 toaster_test.cfg
lrwxrwxrwx 1 yocto yocto     50 Dec 17 09:45 toasterconf.json -&gt; ../../../../../../meta-yocto/conf/toasterconf.json
##################</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57360</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-17 18:34:18 +0000</bug_when>
    <thetext>This should be fixed by this commit: http://cgit.openembedded.org/bitbake/commit/?id=0fbdaa41cd5745c26d996a3f7a734ae3612657d5

Please, check if it works for both old and new git rev more recent than above mentioned commit.

Please, let me know if this needs to be fixed for older git revisions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57379</commentid>
    <comment_count>2</comment_count>
      <attachid>2905</attachid>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-18 11:52:20 +0000</bug_when>
    <thetext>Created attachment 2905
replaced shutil.copy-tree -&gt; subprocess.call(&apos;cp -a ...&apos;)

This patch should fix this for older git revisions. Please, try it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57380</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-18 12:19:38 +0000</bug_when>
    <thetext>Sent patch for review: http://lists.openembedded.org/pipermail/openembedded-core/2015-December/114376.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57451</commentid>
    <comment_count>4</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2015-12-23 02:02:19 +0000</bug_when>
    <thetext>I applied the attached patch and re-tested again, the error message disappeared. I will close this bug if everything works well in M2 test cycle.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57484</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-29 11:04:14 +0000</bug_when>
    <thetext>Patch has been merged into master: http://cgit.openembedded.org/openembedded-core/commit/?id=e5b841420b9fdd33829f7665a62cd06a3017f7e6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58479</commentid>
    <comment_count>6</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2016-02-03 07:05:07 +0000</bug_when>
    <thetext>For 2.1_M2, I still got an error when running sdk-update for a local path update

#######################
$ devtool sdk-update /buildarea/poky_sdk
Traceback (most recent call last):
  File &quot;/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool&quot;, line 305, in &lt;module&gt;
    ret = main()
  File &quot;/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool&quot;, line 292, in main
    ret = args.func(args, config, basepath, workspace)
  File &quot;/buildarea/poky_sdk_old/layers/build/scripts/lib/devtool/sdk.py&quot;, line 138, in sdk_update
    sstate_dir = os.path.join(newsdk_path, &apos;sstate-cache&apos;)
NameError: global name &apos;newsdk_path&apos; is not defined
#######################


Steps:
1. Build an ext_sdk toolchain against the old git rev
2. Build another ext_sdk toolchain against the new git rev
3. Install the old ext_sdk into poky_sdk_old directory, install the new ext_sdk into poky_sdk_new directory
4. cd poky_sdk_old, setup the environment
5. Run devtool sdk-update  poky_sdk_new</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58499</commentid>
    <comment_count>7</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-02-03 14:40:58 +0000</bug_when>
    <thetext>This is totally different issue. Actually it&apos;s a regression brought by recent change. Please, create separate bug for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58517</commentid>
    <comment_count>8</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2016-02-04 02:28:13 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; This is totally different issue. Actually it&apos;s a regression brought by
&gt; recent change. Please, create separate bug for it.

Thanks. I will file a new bug.

Yi</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2905</attachid>
            <date>2015-12-18 11:52:20 +0000</date>
            <delta_ts>2015-12-18 11:52:20 +0000</delta_ts>
            <desc>replaced shutil.copy-tree -&gt; subprocess.call(&apos;cp -a ...&apos;)</desc>
            <filename>file_8825.txt</filename>
            <type>text/plain</type>
            <size>698</size>
            <attacher name="Ed Bartosh">eduard.bartosh</attacher>
            
              <data encoding="base64">LS0tIGEvc2NyaXB0cy9saWIvZGV2dG9vbC9zZGsucHkNCisrKyBiL3NjcmlwdHMvbGliL2RldnRv
b2wvc2RrLnB5DQpAQCAtMTMyLDcgKzEzMiwxMCBAQCBkZWYgc2RrX3VwZGF0ZShhcmdzLCBjb25m
aWcsIGJhc2VwYXRoLCB3b3Jrc3BhY2UpOg0KICAgICAgICAgbmV3X2xheWVyc19kaXIgPSBvcy5w
YXRoLmpvaW4oYXJncy51cGRhdGVzZXJ2ZXIsICdsYXllcnMnKQ0KICAgICAgICAgb2xkX2xheWVy
c19kaXIgPSBvcy5wYXRoLmpvaW4oYmFzZXBhdGgsICdsYXllcnMnKQ0KICAgICAgICAgc2h1dGls
LnJtdHJlZShvbGRfbGF5ZXJzX2RpcikNCi0gICAgICAgIHNodXRpbC5jb3B5dHJlZShuZXdfbGF5
ZXJzX2Rpciwgb2xkX2xheWVyc19kaXIpDQorICAgICAgICByZXQgPSBzdWJwcm9jZXNzLmNhbGwo
ImNwIC1hICVzICVzIiAlIChuZXdfbGF5ZXJzX2Rpciwgb2xkX2xheWVyc19kaXIpLCBzaGVsbD1U
cnVlKQ0KKyAgICAgICAgaWYgcmV0ICE9IDA6DQorICAgICAgICAgICAgbG9nZ2VyLmVycm9yKCJD
b3B5aW5nICVzIHRvICVzIGZhaWxlZCIgJSAobmV3X2xheWVyc19kaXIsIG9sZF9sYXllcnNfZGly
KSkNCisgICAgICAgICAgICByZXR1cm4gcmV0DQogICAgIGVsc2U6DQogICAgICAgICAjIGRldnRv
b2wgc2RrLXVwZGF0ZSBodHRwOi8vbXlob3N0L3Nkaw0KICAgICAgICAgdG1wc2RrX2RpciA9ICcv
dG1wL3Nkay1leHQnDQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>