diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2019-08-26 16:27:20 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-28 16:44:09 +0100 |
commit | 46a71949de40a1b1a5353aa7ba01fecb22cf452a (patch) | |
tree | 07e9163f648eb2ea1cdff8c03922877f85461e09 /bitbake | |
parent | 6e48f9aa23e334529e63dd399dee733a138b8059 (diff) | |
download | poky-46a71949de40a1b1a5353aa7ba01fecb22cf452a.tar.gz |
bitbake: bitbake: respect force flag in runall and runonly
Specifying the force flag will now cause runall and runonly to
invalidate the tasks before running them. This allows a --runall or
--runonly to force the tasks to run, even if they would have otherwise
been skipped, e.g.:
bitbake -f --runall fetch
Will run all do_fetch tasks even if they wouldn't be necessary (for
example, skipped by setscene)
(Bitbake rev: 71e52d3822016027106f2a2e74b8dfdf20f5dc1e)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 4f69578e46..addb2bb82f 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -849,6 +849,20 @@ class RunQueueData: | |||
849 | for depend in depends: | 849 | for depend in depends: |
850 | mark_active(depend, depth+1) | 850 | mark_active(depend, depth+1) |
851 | 851 | ||
852 | def invalidate_task(tid, error_nostamp): | ||
853 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | ||
854 | taskdep = self.dataCaches[mc].task_deps[taskfn] | ||
855 | if fn + ":" + taskname not in taskData[mc].taskentries: | ||
856 | logger.warning("Task %s does not exist, invalidating this task will have no effect" % taskname) | ||
857 | if 'nostamp' in taskdep and taskname in taskdep['nostamp']: | ||
858 | if error_nostamp: | ||
859 | bb.fatal("Task %s is marked nostamp, cannot invalidate this task" % taskname) | ||
860 | else: | ||
861 | bb.debug(1, "Task %s is marked nostamp, cannot invalidate this task" % taskname) | ||
862 | else: | ||
863 | logger.verbose("Invalidate task %s, %s", taskname, fn) | ||
864 | bb.parse.siggen.invalidate_task(taskname, self.dataCaches[mc], taskfn) | ||
865 | |||
852 | self.target_tids = [] | 866 | self.target_tids = [] |
853 | for (mc, target, task, fn) in self.targets: | 867 | for (mc, target, task, fn) in self.targets: |
854 | 868 | ||
@@ -917,6 +931,8 @@ class RunQueueData: | |||
917 | 931 | ||
918 | for tid in list(runall_tids): | 932 | for tid in list(runall_tids): |
919 | mark_active(tid,1) | 933 | mark_active(tid,1) |
934 | if self.cooker.configuration.force: | ||
935 | invalidate_task(tid, False) | ||
920 | 936 | ||
921 | for tid in list(self.runtaskentries.keys()): | 937 | for tid in list(self.runtaskentries.keys()): |
922 | if tid not in runq_build: | 938 | if tid not in runq_build: |
@@ -938,6 +954,8 @@ class RunQueueData: | |||
938 | 954 | ||
939 | for tid in list(runonly_tids): | 955 | for tid in list(runonly_tids): |
940 | mark_active(tid,1) | 956 | mark_active(tid,1) |
957 | if self.cooker.configuration.force: | ||
958 | invalidate_task(tid, False) | ||
941 | 959 | ||
942 | for tid in list(self.runtaskentries.keys()): | 960 | for tid in list(self.runtaskentries.keys()): |
943 | if tid not in runq_build: | 961 | if tid not in runq_build: |
@@ -1114,20 +1132,6 @@ class RunQueueData: | |||
1114 | continue | 1132 | continue |
1115 | self.runq_setscene_tids.append(tid) | 1133 | self.runq_setscene_tids.append(tid) |
1116 | 1134 | ||
1117 | def invalidate_task(tid, error_nostamp): | ||
1118 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | ||
1119 | taskdep = self.dataCaches[mc].task_deps[taskfn] | ||
1120 | if fn + ":" + taskname not in taskData[mc].taskentries: | ||
1121 | logger.warning("Task %s does not exist, invalidating this task will have no effect" % taskname) | ||
1122 | if 'nostamp' in taskdep and taskname in taskdep['nostamp']: | ||
1123 | if error_nostamp: | ||
1124 | bb.fatal("Task %s is marked nostamp, cannot invalidate this task" % taskname) | ||
1125 | else: | ||
1126 | bb.debug(1, "Task %s is marked nostamp, cannot invalidate this task" % taskname) | ||
1127 | else: | ||
1128 | logger.verbose("Invalidate task %s, %s", taskname, fn) | ||
1129 | bb.parse.siggen.invalidate_task(taskname, self.dataCaches[mc], taskfn) | ||
1130 | |||
1131 | self.init_progress_reporter.next_stage() | 1135 | self.init_progress_reporter.next_stage() |
1132 | 1136 | ||
1133 | # Invalidate task if force mode active | 1137 | # Invalidate task if force mode active |