Bug 10963

Summary: devtool sdk-update fails at subsequent runs
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Andrea Galbusera <gizero>
Component: Scripts and ToolsAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: richard.purdie, ross.burton
Version: unspecified   
Target Milestone: 2.3 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 Andrea Galbusera 2017-01-25 14:44:31 UTC
Observed on poky commit (default configuration):
62d7d4130202d8ede16abf9e7d779361ca70847e

Steps to Repeat
================
$ git clone git://git.yoctoproject.org/poky
$ cd poky
$ git checkout master
$ source oe-init-build-env
$ bitbake core-image-minimal -c populate_sdk_ext

(publish the eSDK over HTTP)
$ oe-publish-sdk tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2+snapshot.sh /home/gizero/work/upstreaming/sdks/updates

$ cd /home/gizero/work/upstreaming; python -m SimpleHTTPServer 8888 &

(install eSDK from installer)
$ tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2+snapshot.sh -y -d ~/poky_sdk_master
$ . /home/gizero/poky_sdk_master/environment-setup-i586-poky-linux

(update eSDK from HTTP: first try)
$ devtool sdk-update http://localhost:8888/sdks/updates
(...works as expected. No real updates but no complaints either)

(update eSDK from HTTP: first try)
$ devtool sdk-update http://localhost:8888/sdks/updates

Observed Behavior
==================
At second run:
ERROR: Failed to update metadata as there have been changes made to it. Aborting.
ERROR: Changed files:
b' M poky/bitbake/lib/bb/pysh/pyshtables.py\n'


Expected Behavior
==================
Second "update" should complete successfully
Comment 1 Andrea Galbusera 2017-01-25 14:51:29 UTC
This was discussed on #yocto with RP and it appear to be related to how .gitignore is populated inside the eSDK. 

poky/bitbake/lib/bb/pysh/pyshtables.py in versioned by git while it probably shouldn't.

Removing the file from the repo (but not from the workingdir) and adding it to .gitignore results in subsequent runs of 'devtool sdk-update' to complete smoothly... Of course this needs a solvution on the eSDK generation side
Comment 2 Richard Purdie 2017-01-25 14:56:28 UTC
Looks like scripts/oe-publish-sdk needs to include this when it writes the .gitignore file...
Comment 3 Andrea Galbusera 2017-01-25 21:16:44 UTC
fix submitted to oe-core ML: https://patchwork.openembedded.org/patch/136433/
Comment 4 Paul Eggleton 2017-01-31 17:31:57 UTC
Fix merged to master - thanks!

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6476182c33760cb4e55b85853331a6aa916eb365