From b6d1d2acd58c949f7b8879fe5087c8846ac51a54 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Fri, 11 Sep 2015 13:57:29 -0700 Subject: bitbake: toaster: Avoid unnecessary local to local copy of cooker log The cooker log is copied from its original (bitbake) location to an artifact directory chosen by the user (chosen when checksettings.py runs as part of the managed mode; it's one of the annoying questions you're asked at startup). The copy happens as part of the runbuilds script run, which is started in a loop from the toaster startup script in managed mode. When a user requests the log for a build via toaster, they are getting the log which has been copied to the artifact directory, not the original bitbake log. This works for the managed case, where the runbuilds command is running in a loop and copying log files for completed builds to the artifact directory. However, in analysis mode, there are two problems: 1. checksettings isn't run, so the artifacts directory isn't set. toaster is then unable to figure out where the log files should have been copied to. 2. The log files aren't copied to the artifacts directory anyway, as runbuilds isn't running in analysis mode. To fix this, just point the user to the local bitbake log file in its original location. This avoids the copy step, and means we can remove a whole question from the toaster startup sequence, as we no longer need an artifact directory. The only downside to this is that it's not appropriate for remote bitbake servers. We will need to revisit this and possibly reinstate the copy step once we have to reconcile local and remote builds and make their logs available in the same way. [YOCTO #8209] (Bitbake rev: 5697bbcc88edad85891f66d28b8803a9c9d27ff2) Signed-off-by: Elliot Smith Signed-off-by: brian avery Signed-off-by: Richard Purdie --- .../management/commands/checksettings.py | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py') diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py index 3ccc7c67c9..b2c573c9eb 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py @@ -64,27 +64,6 @@ class Command(NoArgsCommand): return "" return DN(self._find_first_path_for_file(DN(self.guesspath), "bblayers.conf", 4)) - - def _verify_artifact_storage_dir(self): - # verify that we have a settings for downloading artifacts - while ToasterSetting.objects.filter(name="ARTIFACTS_STORAGE_DIR").count() == 0: - guessedpath = os.getcwd() + "/toaster_build_artifacts/" - print("\nToaster needs to know in which directory it can download build log files and other artifacts.\nToaster suggests \"%s\"." % guessedpath) - artifacts_storage_dir = raw_input("Press Enter to select \"%s\" or type the full path to a different directory: " % guessedpath) - if len(artifacts_storage_dir) == 0: - artifacts_storage_dir = guessedpath - if len(artifacts_storage_dir) > 0 and artifacts_storage_dir.startswith("/"): - try: - os.makedirs(artifacts_storage_dir) - except OSError as ose: - if "File exists" in str(ose): - pass - else: - raise ose - ToasterSetting.objects.create(name="ARTIFACTS_STORAGE_DIR", value=artifacts_storage_dir) - return 0 - - def _verify_build_environment(self): # refuse to start if we have no build environments while BuildEnvironment.objects.count() == 0: @@ -239,7 +218,6 @@ class Command(NoArgsCommand): def handle_noargs(self, **options): retval = 0 - retval += self._verify_artifact_storage_dir() retval += self._verify_build_environment() retval += self._verify_default_settings() retval += self._verify_builds_in_progress() -- cgit v1.2.3-54-g00ecf