Bug 12218

Summary: devtool modify failing in fedora 26
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Component: devtools / tool chainAssignee: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: Medium+ CC: bluelightning, javierx.zepeda.murguia, joshuagloe, meta.mr.watcher, meta.watcher
Version: 2.4   
Target Milestone: 2.5 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Leonardo Sandoval Gonzalez 2017-10-11 15:13:28 UTC
At local AB, the following test is constantly failing

2017-10-10 01:08:59,987 - oe-selftest - INFO - FAIL [92.497s]: test_devtool_modify_native (devtool.DevtoolTests)
2017-10-10 01:08:59,988 - oe-selftest - INFO - ----------------------------------------------------------------------
2017-10-10 01:08:59,988 - oe-selftest - INFO - Traceback (most recent call last):
  File "/home/ab/autobuilder/yocto-worker/nightly-oe-selftest-fedora26/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
    return func(*args, **kwargs)
  File "/home/ab/autobuilder/yocto-worker/nightly-oe-selftest-fedora26/build/meta/lib/oeqa/selftest/cases/devtool.py", line 598, in test_devtool_modify_native
    result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)))
  File "/home/ab/autobuilder/yocto-worker/nightly-oe-selftest-fedora26/build/meta/lib/oeqa/utils/commands.py", line 191, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command 'devtool modify apt-native -x /tmp/devtoolqaeweriswe/apt-native' returned non-zero exit status 1:
Comment 1 Leonardo Sandoval Gonzalez 2017-10-11 15:14:27 UTC
I did some initial debugging with opensuse and fedora23 and the issue is not present. Seems that this problem only applies to fedora >= 26 versions.
Comment 2 Rebecca Chang 2017-10-12 06:01:31 UTC
We used crops/poky container and switched base to Fedora26. The issue is reproducible.
We also tried out Ubuntu base crops/poky and run the selftest. Ubuntu 16.04 base is failing with the same error too.
Comment 3 Stephen K Jolley 2017-10-13 16:26:02 UTC
I believe the question has been answered.
Comment 4 Joshua Lock 2017-10-16 14:01:05 UTC
The problem appears to be the -x switch to devtool modify. If I run that interactively I get a full backtrace (pasted below) pointing to line line 545, in _extract_source

Do we just need to ensure the temporary directory is created?

       tempbasedir = d.getVar('WORKDIR')                                                                
       bb.utils.mkdirhier(tempbasedir)                                                                  
       tempdir = tempfile.mkdtemp(prefix='devtooltmp-', dir=tempbasedir)                                
  +    bb.utils.mkdirhier(tempdir) 

---

$ devtool modify apt-native -x
NOTE: Starting bitbake server...
Loading cache: 100% |#####################################################################| Time: 0:00:00
Loaded 1275 entries from dependency cache.
Parsing recipes: 100% |###################################################################| Time: 0:00:00
Parsing of 818 .bb files complete (817 cached, 1 parsed). 1275 targets, 44 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.35.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "universal"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "2.4"
TUNE_FEATURES     = "m64 core2"
TARGET_FPU        = ""
meta              
meta-poky         
meta-yocto-bsp    
workspace         = "master:96967261993f8b583b51cdeccbb1fd06042d2192"

Initialising tasks: 100% |################################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 75 tasks of which 72 didn't need to be rerun and all succeeded.
Traceback (most recent call last):
  File "/home/joshuagl/Projects/poky/scripts/devtool", line 331, in <module>
    ret = main()
  File "/home/joshuagl/Projects/poky/scripts/devtool", line 318, in main
    ret = args.func(args, config, basepath, workspace)
  File "/home/joshuagl/Projects/poky/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/joshuagl/Projects/poky/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/joshuagl/Projects/poky/build/tmp/work/x86_64-linux/apt-native/1.2.24-r0/devtooltmp-m8jd0rcs/initial_rev'
Comment 5 Joshua Lock 2017-10-17 15:09:43 UTC
This issue already being tracked in 12185

*** This bug has been marked as a duplicate of bug 12185 ***