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

Issue 311733002: Redo escaping in GN (Closed)

Created:
6 years, 6 months ago by brettw
Modified:
6 years, 6 months ago
Reviewers:
scottmg
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

Redo escaping in GN. This makes Windows escaping more correct and handles Posix shell characters better as well. Now there are completely different codepaths for Windows and Posix escaping. I removed JSON escaping since this is no longer needed now that we no longer write GYP files. I no longer have a separate SHELL and NINJA modes. Instead, I have pure NINJA mode for writing file names for Ninja to interpret, and NINKA_FORK mode which does NINJA escaping plus the correct platform-specific rules for the method Ninja uses for running build steps on the current system. Includes used to always be quoted ("-I../..") which was ugly. Now they're not quoted unless necessary (which is almost never). If it requires quoting, it will do -I"foo bar" which looks a bit odd but saves a bunch of special casing in the output code. Previously defines weren't quoted at all. Now they work like include dirs. Removed the convert_slashes flag on PathOutput which is no longer used. Removed some backslash special-casing in the unit tests on Windows. These are no longer necessary since we changed path output on Windows to use forward-slashes. Fix base's StackString on GCC. Previously this was only used on Windows-specific code. Fix mesa Windows GN build. BUG=358764 R=scottmg@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275174

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 5

Patch Set 5 : review comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+304 lines, -264 lines) Patch
M base/containers/stack_container.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/mesa/BUILD.gn View 1 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/escape.h View 1 2 3 4 1 chunk +17 lines, -10 lines 0 comments Download
M tools/gn/escape.cc View 1 2 3 4 3 chunks +135 lines, -56 lines 0 comments Download
M tools/gn/escape_unittest.cc View 1 2 3 4 1 chunk +28 lines, -56 lines 2 comments Download
M tools/gn/file_template.cc View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M tools/gn/file_template_unittest.cc View 1 2 3 4 2 chunks +9 lines, -1 line 0 comments Download
M tools/gn/ninja_action_target_writer.cc View 1 2 3 4 2 chunks +2 lines, -3 lines 0 comments Download
M tools/gn/ninja_action_target_writer_unittest.cc View 1 2 16 chunks +31 lines, -51 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.cc View 1 2 3 4 5 chunks +8 lines, -21 lines 0 comments Download
M tools/gn/ninja_build_writer.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M tools/gn/ninja_target_writer.cc View 1 chunk +1 line, -3 lines 0 comments Download
M tools/gn/ninja_toolchain_writer.cc View 1 chunk +1 line, -3 lines 0 comments Download
M tools/gn/path_output.h View 2 chunks +3 lines, -14 lines 0 comments Download
M tools/gn/path_output.cc View 1 2 3 4 3 chunks +3 lines, -13 lines 0 comments Download
M tools/gn/path_output_unittest.cc View 1 2 3 4 6 chunks +52 lines, -28 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
brettw
6 years, 6 months ago (2014-06-04 19:58:26 UTC) #1
scottmg
Much better! LGTM https://codereview.chromium.org/311733002/diff/60001/tools/gn/escape.cc File tools/gn/escape.cc (right): https://codereview.chromium.org/311733002/diff/60001/tools/gn/escape.cc#newcode56 tools/gn/escape.cc:56: // characters, don't do anything (other ...
6 years, 6 months ago (2014-06-04 21:21:27 UTC) #2
brettw
I addressed everything
6 years, 6 months ago (2014-06-04 21:58:05 UTC) #3
scottmg
lgtm++ https://codereview.chromium.org/311733002/diff/80001/tools/gn/escape_unittest.cc File tools/gn/escape_unittest.cc (right): https://codereview.chromium.org/311733002/diff/80001/tools/gn/escape_unittest.cc#newcode15 tools/gn/escape_unittest.cc:15: TEST(Escape, WindowsFork) { WindowsCommand https://codereview.chromium.org/311733002/diff/80001/tools/gn/escape_unittest.cc#newcode42 tools/gn/escape_unittest.cc:42: TEST(Escape, PosixFork) ...
6 years, 6 months ago (2014-06-04 22:06:49 UTC) #4
brettw
6 years, 6 months ago (2014-06-05 17:19:16 UTC) #5
Message was sent while issue was closed.
Committed patchset #5 manually as r275174 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698