| Summary: | testsdkext takes too long time to finish | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Chen Qi <Qi.Chen> |
| Component: | devtools / tool chain | Assignee: | Chen Qi <Qi.Chen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | High | CC: | meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, stephano |
| Version: | 2.5 | ||
| Target Milestone: | 2.6 M2 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
The patch is in review. I've pinged the patch today. |
Currently if we do a testsdkext task for the image, it would take about half an hour to finish. The time is mostly spent fetching kernel source via network. We have in testsdk.bbclass: # Use our own SSTATE_DIR and DL_DIR so that updates to the eSDK come from our sstate cache # and we don't spend hours downloading kernels for the kernel module test # Abuse auto.conf since local.conf would be overwritten by the SDK with open(os.path.join(sdk_dir, 'conf', 'auto.conf'), 'a+') as f: f.write('SSTATE_MIRRORS += " \\n file://.* file://%s/PATH"\n' % test_data.get('SSTATE_DIR')) f.write('SOURCE_MIRROR_URL = "file://%s"\n' % test_data.get('DL_DIR')) f.write('INHERIT += "own-mirrors"\n') However, this does not work. The log.do_fetch shows info as below. DEBUG: Fetcher failure: Unable to find file file:///mnt/buildarea3/build-systemd/downloads/git2_git.yoctoproject.org.linux-yocto.git.tar.gz anywhere. The .tar.gz file seems to be generated only if BB_GENERATE_MIRROR_TARBALLS is set to "1". The default value of BB_GENERATE_MIRROR_TARBALLS is "0", and according to the ref manual, users would choose to set it to "1" only if they are trying to make a source mirror. So generally, this var's value is "0". To solve this problem, we can write to auto.conf some PREMIRRORS setting like below. diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass index 2e43343..92671cc 100644 --- a/meta/classes/testsdk.bbclass +++ b/meta/classes/testsdk.bbclass @@ -157,6 +157,8 @@ def testsdkext_main(d): f.write('SSTATE_MIRRORS += " \\n file://.* file://%s/PATH"\n' % test_data.get('SSTATE_DIR')) f.write('SOURCE_MIRROR_URL = "file://%s"\n' % test_data.get('DL_DIR')) f.write('INHERIT += "own-mirrors"\n') + f.write('PREMIRRORS_prepend = " git://git.yoctoproject.org/linux-yocto.git git://%s/git2/git.yoctoproject.org.linux-yocto.git \\n"\n' % test_data.get('DL_DIR')) + f.write('PREMIRRORS_prepend = " git://git.yoctoproject.org/yocto-kernel-cache git://%s/git2/git.yoctoproject.org.yocto-kernel-cache \\n"\n' % test_data.get('DL_DIR')) # We need to do this in case we have a minimal SDK subprocess.check_output(". %s > /dev/null; devtool sdk-install meta-extsdk-toolchain" % \ Not sure if this is the correct solution. Maybe there are better ones.