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

Unified Diff: tools/gn/setup.cc

Issue 1155713006: GN: Make file/dir resolving return errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: tools/gn/setup.cc
diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc
index d8d525ad7b34b522316a00baf207b27b53bdc0c5..79c46e79ce18afd4bdd6a6314f1b176aecaf512c 100644
--- a/tools/gn/setup.cc
+++ b/tools/gn/setup.cc
@@ -447,13 +447,13 @@ bool Setup::FillSourceDir(const base::CommandLine& cmdline) {
}
bool Setup::FillBuildDir(const std::string& build_dir, bool require_exists) {
+ Err err;
SourceDir resolved =
SourceDirForCurrentDirectory(build_settings_.root_path()).
- ResolveRelativeDir(build_dir, build_settings_.root_path_utf8());
- if (resolved.is_null()) {
- Err(Location(), "Couldn't resolve build directory.",
- "The build directory supplied (\"" + build_dir + "\") was not valid.").
- PrintToStdout();
+ ResolveRelativeDir(Value(nullptr, build_dir), &err,
+ build_settings_.root_path_utf8());
+ if (err.has_error()) {
+ err.PrintToStdout();
return false;
}
@@ -622,7 +622,11 @@ bool Setup::FillOtherConfig(const base::CommandLine& cmdline) {
err.PrintToStdout();
return false;
}
- whitelist->insert(current_dir.ResolveRelativeFile(item.string_value()));
+ whitelist->insert(current_dir.ResolveRelativeFile(item, &err));
+ if (err.has_error()) {
+ err.PrintToStdout();
+ return false;
+ }
}
build_settings_.set_exec_script_whitelist(whitelist.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698