Bug 12185 - devtool_modify_native test failure in ross/rocko
Summary: devtool_modify_native test failure in ross/rocko
Status: VERIFIED FIXED
Alias: None
Product: eSDK
Classification: Yocto Project Subprojects
Component: eSDK (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.5 M1
Assignee: Paul Eggleton
QA Contact: Javier Zepeda
URL:
Whiteboard:
: 12218 12237 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-04 19:59 UTC by California Sullivan
Modified: 2017-11-23 16:02 UTC (History)
4 users (show)

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


Attachments
full log (1.24 MB, text/plain)
2017-10-04 19:59 UTC, California Sullivan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description California Sullivan 2017-10-04 19:59:50 UTC
Created attachment 4052 [details]
full log

https://autobuilder.yocto.io/builders/nightly-oe-selftest/builds/554/steps/Running%20oe-selftest/logs/stdio


Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/scripts/devtool", line 331, in <module>
    ret = main()
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/scripts/devtool", line 318, in main
    ret = args.func(args, config, basepath, workspace)
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/scripts/lib/devtool/standard.py", line 714, in modify
    initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil)
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/scripts/lib/devtool/standard.py", line 545, in _extract_source
    with open(os.path.join(tempdir, 'initial_rev'), 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/x86_64-linux/apt-native/1.2.24-r0/devtooltmp-w14_n1me/initial_rev'
Comment 1 Paul Eggleton 2017-10-06 03:04:43 UTC
At the moment I am unable to reproduce this. I'm also a bit stumped as to how it could have happened - unless perhaps the bbappend that we create in order to have the recipe inherit devtool-source wasn't noticed. I thought maybe that could have happened if we ran out of inotify watches - the limit on the server in question is 65536 but it seems we generally create under 2000 for a build like this, and we'd have gotten a nasty error if the limit had been exceeded.
Comment 2 Joshua Lock 2017-10-17 15:09:43 UTC
*** Bug 12218 has been marked as a duplicate of this bug. ***
Comment 3 Joshua Lock 2017-10-17 15:11:40 UTC
I could reproduce this reliably with devtool modify -x apt-native on my Fedora26 host.

I added a simple bb.utils.mkdirhier() call to workaround the failure and submitted the patch: https://patchwork.openembedded.org/patch/145012/

It's probably the wrong fix (I haven't spent much time with devtool's code beyond writing this one-liner), but I wanted to communicate what worked for me.
Comment 4 Joshua Lock 2017-10-17 15:59:10 UTC
(In reply to comment #3)
> It's probably the wrong fix (I haven't spent much time with devtool's code
> beyond writing this one-liner), but I wanted to communicate what worked for
> me.

Or apparently reading the Python library docs. tempfile.mkdtemp() should create the temporary directory. It's unclear why this isn't happening. 

I could easily reproduce this on Fedora 26. We've also seen it on the Tumbleweed builder on autobuilder.yocto.io. Bug #12218 reports that the same failure occurs on Ubuntu 16.04. It's therefore unlikely to be a bug in a specific Python version.
Comment 5 Paul Eggleton 2017-10-19 02:32:22 UTC
I've reproduced this and it is not simply a matter of the directory not existing - bitbake is failing to pick up that devtool is creating a bbappend in the workspace. I've simulated the issue outside of devtool by moving in the bbappend while the bitbake server is in memory - it doesn't notice until you stop and restart it. Investigation ongoing.
Comment 6 Paul Eggleton 2017-10-19 03:43:32 UTC
OK, I've sent a fix for this to the bitbake-devel list - it affects host Python 3.6+ and will also result in bitbake missing added bbappends or recipes if BB_SERVER_TIMEOUT is set.
Comment 7 Joshua Lock 2017-10-19 14:16:05 UTC
*** Bug 12237 has been marked as a duplicate of this bug. ***
Comment 9 Armin Kuster 2017-11-09 20:35:17 UTC
(In reply to comment #8)
> Fix merged to master:
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
> ?id=800e9a50594d6992e1515b14fdd657afe6f7c066
> 
> Also rocko (post-2.4 release):
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
> ?h=rocko&id=7226a1c6003ddc06af620026a212726d60eaf794

Does this need back porting to Pyro?
Comment 10 Paul Eggleton 2017-11-09 21:12:11 UTC
Luckily no, the memres stuff is different in pyro, as is the part of devtool that is affected by this issue, so no need to backport. Thanks for checking though!
Comment 11 Javier Zepeda 2017-11-23 16:02:08 UTC
Works, both have been verified and already passed for Fedora26 where the issue was manifested:

commit_poky:	800e9a50594d6992e1515b14fdd657afe6f7c066

2017-11-09 17:35:36,684 - oe-selftest - INFO -   test_devtool_modify_native (devtool.DevtoolTests)
2017-11-09 17:39:40,153 - oe-selftest - INFO -  ... OK (243.469s)

commit_poky:	72867393fe2004ab9f0ee23eb09a975c82938b9e

2017-11-22 14:34:19,264 - oe-selftest - INFO -   test_devtool_modify_native (devtool.DevtoolTests)
2017-11-22 14:37:56,405 - oe-selftest - INFO -  ... OK (217.141s)