Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: tools/gn/function_exec_script.cc

Issue 41703002: Fix GN unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/build_settings.cc ('k') | tools/gn/ninja_binary_target_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_exec_script.cc
diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc
index 540d189069aae8803d5aa2c316637bd7bca0b95c..bf55165ea4f975f7e2e1c5b0887917d89b4b7fae 100644
--- a/tools/gn/function_exec_script.cc
+++ b/tools/gn/function_exec_script.cc
@@ -348,6 +348,14 @@ Value RunExecScript(Scope* scope,
base::FilePath startup_dir =
build_settings->GetFullPath(build_settings->build_dir());
+ // The first time a build is run, no targets will have been written so the
+ // build output directory won't exist. We need to make sure it does before
+ // running any scripts with this as its startup directory, although it will
+ // be relatively rare that the directory won't exist by the time we get here.
+ //
+ // If this shows up on benchmarks, we can cache whether we've done this
+ // or not and skip creating the directory.
+ file_util::CreateDirectory(startup_dir);
scottmg 2013/10/24 21:47:20 racing is silently ok on all platforms? (looks ok
// Execute the process.
// TODO(brettw) set the environment block.
« no previous file with comments | « tools/gn/build_settings.cc ('k') | tools/gn/ninja_binary_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698