• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:build +full:- +full:root

2 // Use of this source code is governed by a BSD-style license that can be
76 // -----------------------------------------------------------------------------
88 // -----------------------------------------------------------------------------
110 // Nothing loaded, need to load the default build config. The initial load in Load()
120 // The default build config is no dependent on the toolchain definition, in Load()
121 // since we need to load the build config before we know what the default in Load()
123 record->is_toolchain_loaded = true; in Load()
125 record->waiting_on_me.push_back(SourceFileAndOrigin(file, origin)); in Load()
126 ScheduleLoadBuildConfig(&record->settings, Scope::KeyValueMap()); in Load()
151 if (record->is_config_loaded) in Load()
152 ScheduleLoadFile(&record->settings, origin, file); in Load()
154 record->waiting_on_me.push_back(SourceFileAndOrigin(file, origin)); in Load()
158 ToolchainRecord* record = toolchain_records_[toolchain->label()].get(); in ToolchainLoaded()
162 std::make_unique<ToolchainRecord>(build_settings_, toolchain->label(), in ToolchainLoaded()
165 toolchain_records_[toolchain->label()] = std::move(new_record); in ToolchainLoaded()
167 record->is_toolchain_loaded = true; in ToolchainLoaded()
169 // The default build config is loaded first, then its toolchain. Secondary in ToolchainLoaded()
171 // to the build config. So we may or may not have a config at this point. in ToolchainLoaded()
172 if (!record->is_config_loaded) { in ToolchainLoaded()
173 ScheduleLoadBuildConfig(&record->settings, toolchain->args()); in ToolchainLoaded()
175 // There should be nobody waiting on this if the build config is already in ToolchainLoaded()
177 DCHECK(record->waiting_on_me.empty()); in ToolchainLoaded()
197 return &found_toolchain->second->settings; in GetToolchainSettings()
201 return SourceFile(label.dir().value() + "BUILD" + build_file_extension_ + in BuildFileForLabel()
211 origin, settings->build_settings(), file, in ScheduleLoadFile()
216 g_scheduler->FailWithError(err); in ScheduleLoadFile()
227 LocationRange(), settings->build_settings(), in ScheduleLoadBuildConfig()
228 settings->build_settings()->build_config_file(), in ScheduleLoadBuildConfig()
229 [this, settings, toolchain_overrides](const ParseNode* root) { in ScheduleLoadBuildConfig() argument
230 BackgroundLoadBuildConfig(settings, toolchain_overrides, root); in ScheduleLoadBuildConfig()
233 g_scheduler->FailWithError(err); in ScheduleLoadBuildConfig()
241 const ParseNode* root) { in BackgroundLoadFile() argument
242 if (!root) { in BackgroundLoadFile()
243 task_runner_->PostTask([this]() { DecrementPendingLoads(); }); in BackgroundLoadFile()
247 if (g_scheduler->verbose_logging()) { in BackgroundLoadFile()
248 g_scheduler->Log("Running", in BackgroundLoadFile()
250 settings->toolchain_label().GetUserVisibleName(false)); in BackgroundLoadFile()
253 Scope our_scope(settings->base_config()); in BackgroundLoadFile()
263 trace.SetToolchain(settings->toolchain_label()); in BackgroundLoadFile()
266 root->Execute(&our_scope, &err); in BackgroundLoadFile()
274 if (!settings->is_default()) in BackgroundLoadFile()
275 err.set_toolchain_label(settings->toolchain_label()); in BackgroundLoadFile()
277 g_scheduler->FailWithError(err); in BackgroundLoadFile()
282 settings->build_settings()->ItemDefined(std::move(item)); in BackgroundLoadFile()
286 task_runner_->PostTask([this]() { DidLoadFile(); }); in BackgroundLoadFile()
292 const ParseNode* root) { in BackgroundLoadBuildConfig() argument
293 if (!root) { in BackgroundLoadBuildConfig()
294 task_runner_->PostTask([this]() { DecrementPendingLoads(); }); in BackgroundLoadBuildConfig()
298 Scope* base_config = settings->base_config(); in BackgroundLoadBuildConfig()
299 base_config->set_source_dir(SourceDir("//")); in BackgroundLoadBuildConfig()
300 base_config->AddBuildDependencyFile( in BackgroundLoadBuildConfig()
301 settings->build_settings()->build_config_file()); in BackgroundLoadBuildConfig()
303 settings->build_settings()->build_args().SetupRootScope(base_config, in BackgroundLoadBuildConfig()
306 base_config->SetProcessingBuildConfig(); in BackgroundLoadBuildConfig()
310 if (settings->is_default()) in BackgroundLoadBuildConfig()
311 base_config->SetProperty(kDefaultToolchainKey, &default_toolchain_label); in BackgroundLoadBuildConfig()
314 settings->build_settings()->build_config_file().value()); in BackgroundLoadBuildConfig()
315 trace.SetToolchain(settings->toolchain_label()); in BackgroundLoadBuildConfig()
319 base_config->set_source_dir( in BackgroundLoadBuildConfig()
320 settings->build_settings()->build_config_file().GetDir()); in BackgroundLoadBuildConfig()
323 root->Execute(base_config, &err); in BackgroundLoadBuildConfig()
325 // Put back the root as the default source dir. This probably isn't necessary in BackgroundLoadBuildConfig()
327 // better default than the build config's directory. in BackgroundLoadBuildConfig()
328 base_config->set_source_dir(SourceDir("//")); in BackgroundLoadBuildConfig()
330 // Clear all private variables left in the scope. We want the root build in BackgroundLoadBuildConfig()
333 base_config->RemovePrivateIdentifiers(); in BackgroundLoadBuildConfig()
338 if (!settings->is_default()) in BackgroundLoadBuildConfig()
339 err.set_toolchain_label(settings->toolchain_label()); in BackgroundLoadBuildConfig()
341 g_scheduler->FailWithError(err); in BackgroundLoadBuildConfig()
344 base_config->ClearProcessingBuildConfig(); in BackgroundLoadBuildConfig()
345 if (settings->is_default()) { in BackgroundLoadBuildConfig()
346 // The default toolchain must have been set in the default build config in BackgroundLoadBuildConfig()
349 g_scheduler->FailWithError(Err( in BackgroundLoadBuildConfig()
351 "The default build config file did not call set_default_toolchain()", in BackgroundLoadBuildConfig()
355 DCHECK(settings->toolchain_label().is_null()); in BackgroundLoadBuildConfig()
356 settings->set_toolchain_label(default_toolchain_label); in BackgroundLoadBuildConfig()
360 task_runner_->PostTask( in BackgroundLoadBuildConfig()
361 [this, toolchain_label = settings->toolchain_label()]() { in BackgroundLoadBuildConfig()
376 // When loading the default build config, we'll insert it into the record in DidLoadBuildConfig()
387 std::move(empty_label->second); in DidLoadBuildConfig()
394 DCHECK(record->settings.default_toolchain_label().is_null()); in DidLoadBuildConfig()
395 record->settings.set_default_toolchain_label(label); in DidLoadBuildConfig()
398 DCHECK(!record->settings.toolchain_label().is_null()); in DidLoadBuildConfig()
401 // This will normally only be one, for the root build file, so brute-force in DidLoadBuildConfig()
415 record = found_toolchain->second.get(); in DidLoadBuildConfig()
418 DCHECK(!record->is_config_loaded); in DidLoadBuildConfig()
419 DCHECK(record->is_toolchain_loaded); in DidLoadBuildConfig()
420 record->is_config_loaded = true; in DidLoadBuildConfig()
423 for (const auto& waiting : record->waiting_on_me) in DidLoadBuildConfig()
424 ScheduleLoadFile(&record->settings, waiting.origin, waiting.file); in DidLoadBuildConfig()
425 record->waiting_on_me.clear(); in DidLoadBuildConfig()
432 pending_loads_--; in DecrementPendingLoads()
446 return g_scheduler->input_file_manager()->AsyncLoadFile( in AsyncLoadFile()