Bug 8825 - Failed to run devtool sdk-update
Summary: Failed to run devtool sdk-update
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 2.1
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.1 M2
Assignee: Ed Bartosh
QA Contact: Yi Zhao
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-12-17 05:10 UTC by Yi Zhao
Modified: 2016-02-04 02:28 UTC (History)
6 users (show)

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


Attachments
replaced shutil.copy-tree -> subprocess.call('cp -a ...') (698 bytes, text/plain)
2015-12-18 11:52 UTC, Ed Bartosh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Zhao 2015-12-17 05:10:24 UTC
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 "/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool", line 288, in <module>
    ret = main()
  File "/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool", line 277, in main
    ret = args.func(args, config, basepath, workspace)
  File "/buildarea/poky_sdk_old/layers/poky/scripts/lib/devtool/sdk.py", line 135, in sdk_update
    shutil.copytree(new_layers_dir, old_layers_dir)
  File "/buildarea/poky_sdk_old/tmp/sysroots/x86_64-linux/usr/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
Error: [('/buildarea/poky_sdk_new/layers/poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster.sqlite', '/buildarea/poky_sdk_old/layers/poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster.sqlite', "[Errno 2] No such file or directory: '/buildarea/poky_sdk_new/layers/poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster.sqlite'")]
###################

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 -> ../../../../../../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 -> ../../../../../../meta-yocto/conf/toasterconf.json
##################
Comment 1 Ed Bartosh 2015-12-17 18:34:18 UTC
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.
Comment 2 Ed Bartosh 2015-12-18 11:52:20 UTC
Created attachment 2905 [details]
replaced shutil.copy-tree -> subprocess.call('cp -a ...')

This patch should fix this for older git revisions. Please, try it.
Comment 4 Yi Zhao 2015-12-23 02:02:19 UTC
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.
Comment 5 Ed Bartosh 2015-12-29 11:04:14 UTC
Patch has been merged into master: http://cgit.openembedded.org/openembedded-core/commit/?id=e5b841420b9fdd33829f7665a62cd06a3017f7e6
Comment 6 Yi Zhao 2016-02-03 07:05:07 UTC
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 "/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool", line 305, in <module>
    ret = main()
  File "/buildarea/poky_sdk_old/sysroots/x86_64-pokysdk-linux//usr/bin/devtool", line 292, in main
    ret = args.func(args, config, basepath, workspace)
  File "/buildarea/poky_sdk_old/layers/build/scripts/lib/devtool/sdk.py", line 138, in sdk_update
    sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
NameError: global name 'newsdk_path' 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
Comment 7 Ed Bartosh 2016-02-03 14:40:58 UTC
This is totally different issue. Actually it's a regression brought by recent change. Please, create separate bug for it.
Comment 8 Yi Zhao 2016-02-04 02:28:13 UTC
(In reply to comment #7)
> This is totally different issue. Actually it's a regression brought by
> recent change. Please, create separate bug for it.

Thanks. I will file a new bug.

Yi