New issue
Advanced search Search tips

Issue 831607 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

gn writes invalid ninja files for actions whose names contain funny characters

Project Member Reported by thakis@chromium.org, Apr 11 2018

Issue description

$ git diff
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 463fa3e30aae..90e9da3ac5ed 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -110,6 +110,11 @@ if (is_android) {
   }
 }
 
+action("hoffelder & company") {
+  script = "//build/gn_helpers.py"
+  outputs = [ "$root_out_dir/output" ]
+}
+
 # Base and everything it depends on should be a static library rather than
 # a source set. Base is more of a "library" in the classic sense in that many
 # small parts of it are used in many different contexts. This combined with a
$ gn gen out/gn
Done. Made 8922 targets from 1524 files in 5817ms
$ ninja -C out/gn base_unittests
ninja: Entering directory `out/gn'
ninja: error: toolchain.ninja:181: expected newline, got lexing error
rule __base_hoffelder & company___build_toolchain_mac_clang_x64__rule
                      ^ near here



The easiest fix is probably to just reject such rule names at gn time. (Alternatively, could transform forbidden characters to an escape character like _, but then have to worry about actions "a+b" and "a&b" not being escaped to the same name, which is a bit messy and probably not worth it).
 

Comment 1 by thakis@chromium.org, Apr 11 2018

Components: Build

Comment 2 by pkl@chromium.org, Apr 30 2018

Cc: sdefresne@chromium.org
Don't know for sure where GN feature requests go.

Comment 3 by pkl@chromium.org, Apr 30 2018

Status: Available (was: Untriaged)
Labels: -OS-Linux -OS-Android -OS-Windows -OS-iOS -OS-Chrome -OS-Mac -OS-Fuchsia

Sign in to add a comment