diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-16 15:32:40 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-20 15:31:49 +0000 |
| commit | f32ef56cda80115cd8fd5d629caa424f065e39a4 (patch) | |
| tree | 8778f030ce36725fae29113519312207a67a0011 | |
| parent | 077291583ce5a62d0b72093dc5e446a706a7fdfb (diff) | |
| download | poky-f32ef56cda80115cd8fd5d629caa424f065e39a4.tar.gz | |
sstate: Implement a setscene dependency validation routine to allow skipping of some sstate installation
This is a first attempt at logic to determine when a sstate dependency needs
to be installed and when it does not. Its a start at the logic and errs on the
side of caution, as it gets wider testing, we can refine the logic as needed.
This code should allow a significant performance speedup to certain workflows, for
example "bitbake xxx-image -c rootfs" will not populate the target sysroot.
(From OE-Core rev: b43faba37816817edc5240a139361d16e07c6131)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/sstate.bbclass | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index c085c626d8..470e0eeca7 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
| @@ -620,3 +620,55 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): | |||
| 620 | 620 | ||
| 621 | return ret | 621 | return ret |
| 622 | 622 | ||
| 623 | BB_SETSCENE_DEPVALID = "setscene_depvalid" | ||
| 624 | |||
| 625 | def setscene_depvalid(task, taskdependees, notneeded, d): | ||
| 626 | # taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME] | ||
| 627 | # task is included in taskdependees too | ||
| 628 | |||
| 629 | bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task]))) | ||
| 630 | |||
| 631 | def isNative(x): | ||
| 632 | return x.endswith("-native") | ||
| 633 | def isNativeCross(x): | ||
| 634 | return x.endswith("-native") or x.endswith("-cross") or x.endswith("-cross-initial") | ||
| 635 | def isSafeDep(x): | ||
| 636 | if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "binutils-cross"]: | ||
| 637 | return True | ||
| 638 | return False | ||
| 639 | |||
| 640 | # We can skip these "safe" dependencies since the aren't runtime dependencies, just build time | ||
| 641 | if isSafeDep(taskdependees[task][0]) and taskdependees[task][1] == "do_populate_sysroot": | ||
| 642 | return True | ||
| 643 | |||
| 644 | # We only need to trigger populate_lic through direct dependencies | ||
| 645 | if taskdependees[task][1] == "do_populate_lic": | ||
| 646 | return True | ||
| 647 | |||
| 648 | for dep in taskdependees: | ||
| 649 | bb.debug(2, " considering dependency: %s" % (str(taskdependees[dep]))) | ||
| 650 | if task == dep: | ||
| 651 | continue | ||
| 652 | if dep in notneeded: | ||
| 653 | continue | ||
| 654 | # do_package_write_* and do_package doesn't need do_package | ||
| 655 | if taskdependees[task][1] == "do_package" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']: | ||
| 656 | continue | ||
| 657 | # do_package_write_* and do_package doesn't need do_populate_sysroot | ||
| 658 | if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']: | ||
| 659 | continue | ||
| 660 | # Native/Cross packages don't exist and are noexec anyway | ||
| 661 | if isNativeCross(taskdependees[dep][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']: | ||
| 662 | continue | ||
| 663 | # Native/Cross populate_sysroot need their dependencies | ||
| 664 | if isNativeCross(taskdependees[task][0]) and isNativeCross(taskdependees[dep][0]) and taskdependees[task][1] == 'do_populate_sysroot' and taskdependees[dep][1] == 'do_populate_sysroot': | ||
| 665 | return False | ||
| 666 | # Target populate_sysroot do not need their dependencies | ||
| 667 | if taskdependees[task][1] == 'do_populate_sysroot' and taskdependees[dep][1] == 'do_populate_sysroot': | ||
| 668 | continue | ||
| 669 | |||
| 670 | # Safe fallthrough default | ||
| 671 | bb.debug(2, " Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep]))) | ||
| 672 | return False | ||
| 673 | return True | ||
| 674 | |||
