Bug 11036

Summary: In certain cases devtool reset will fail, but bitbake -c clean will succeed
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Saul Wold <sgw>
Component: devtools / tool chainAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher
Version: 2.3   
Target Milestone: 2.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Unknown (Hard to categorize)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Saul Wold 2017-02-09 01:24:54 UTC
This failure occurs when building openssl-qat (with TCLIBC=musl) from meta-intel 

Steps to reproduce:

1) set up meta-intel and TCLIBC=musl
2) devtool modify openssl-qat
3) devtool build openssl-qat
   - build will fail
4) devtool reset openssl-qat
   - should fail
5) devtool reset -n openssl-qat
6) bitbake -c clean openssl-qat
   - this will clean OK
Comment 1 Saul Wold 2017-02-09 19:33:04 UTC
NOTE: Executing RunQueue Tasks
NOTE: Running task 1 of 2 (/srv/sdb/releases/master/meta-intel/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb:do_buildclean)
NOTE: recipe openssl-qat-0.4.9-009-r0: task do_buildclean: Started
ERROR: openssl-qat-0.4.9-009-r0 do_buildclean: oe_runmake failed
ERROR: openssl-qat-0.4.9-009-r0 do_buildclean: Function failed: do_buildclean (log file is located at /srv/sdb/releases/master/builds/musl/tmp/work/intel_corei7_64-poky-linux-musl/openssl-qat/0.4.9-009-r0/temp/log.do_buildclean.91309)
ERROR: Logfile of failure stored in: /srv/sdb/releases/master/builds/musl/tmp/work/intel_corei7_64-poky-linux-musl/openssl-qat/0.4.9-009-r0/temp/log.do_buildclean.91309
Log data follows:
| DEBUG: Executing shell function do_buildclean
| NOTE: make -e MAKEFLAGS= clean
| ERROR: oe_runmake failed
| rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
| rm: cannot remove 'oe-workdir/recipe-sysroot/lib': Is a directory
| Makefile:409: recipe for target 'libclean' failed
| make: *** [libclean] Error 1
| ERROR: Function failed: do_buildclean (log file is located at /srv/sdb/releases/master/builds/musl/tmp/work/intel_corei7_64-poky-linux-musl/openssl-qat/0.4.9-009-r0/temp/log.do_buildclean.91309)
NOTE: recipe openssl-qat-0.4.9-009-r0: task do_buildclean: Failed
ERROR: Task (/srv/sdb/releases/master/meta-intel/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb:do_buildclean) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory

Summary: 1 task failed:
  /srv/sdb/releases/master/meta-intel/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb:do_buildclean
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

If you wish, you may specify -n/--no-clean to skip running this command when resetting
Comment 2 Paul Eggleton 2017-09-15 03:26:40 UTC
So we can see from the error message that this is caused by openssl-qat's makefile which recurses into any directory that happens to exist in the source tree - and one of those is the symlink we create to make it easier to get to the work directory. You can disable these by setting EXTERNALSRC_SYMLINKS = "" to work around this, or patch the makefile. Beyond dropping the symlink functionality altogether I'm not really sure what we can do.
Comment 3 Paul Eggleton 2017-09-15 03:29:27 UTC
Hmm, well I guess we could delete the symlinks first within do_buildclean.