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

Issue 630223002: gn: Support build directories outside the source tree. (Closed)

Created:
6 years, 2 months ago by zeuthen
Modified:
6 years, 1 month ago
Reviewers:
brettw
CC:
chromium-reviews, tfarina, Chris Masone, Dirk Pranke
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

gn: Support build directories outside the source tree. The main use-case is to support using a fast SSD or ramdisk for the build directory, but a slower persistent disk for the source code. The general idea behind this change is modifying - RebaseSourceAbsolutePath() - SourceDir::ResolveRelativeFile() - SourceDir::ResolveRelativeDir() - GetOutputDirForSourceDirAsOutputFile() - PathOutput to work with paths reaching out of the source directory. Thanks to jam@ for the Windows-fixes. BUG=343728 TEST=New unit tests + Unit tests pass. TEST=`gn gen /ssd/out/Debug && ninja -C /ssd/out/Debug` work as expected. Committed: https://crrev.com/6f9c6456a4358ec6ccb7b1c9d4e64a796633faae Cr-Commit-Position: refs/heads/master@{#303719}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Updated patch set #

Total comments: 5

Patch Set 3 : Updated patch set #

Total comments: 12

Patch Set 4 : Updated patch set #

Patch Set 5 : Hopefully fix Windows compilation errors #

Patch Set 6 : Updated patch with Windows fixes from jam@ #

Patch Set 7 : Patch that compiles and passes unit tests on both Windows and Linux #

Unified diffs Side-by-side diffs Delta from patch set Stats (+443 lines, -190 lines) Patch
M tools/gn/action_target_generator.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/build_settings.h View 2 chunks +0 lines, -7 lines 0 comments Download
M tools/gn/build_settings.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M tools/gn/command_format.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/filesystem_utils.h View 1 2 3 2 chunks +11 lines, -9 lines 0 comments Download
M tools/gn/filesystem_utils.cc View 1 2 3 4 5 6 5 chunks +66 lines, -31 lines 0 comments Download
M tools/gn/filesystem_utils_unittest.cc View 1 2 3 3 chunks +101 lines, -44 lines 0 comments Download
M tools/gn/function_exec_script.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M tools/gn/function_get_path_info.cc View 1 2 2 chunks +18 lines, -9 lines 0 comments Download
M tools/gn/function_read_file.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/function_rebase_path.cc View 1 2 3 4 chunks +20 lines, -19 lines 0 comments Download
M tools/gn/function_rebase_path_unittest.cc View 1 2 3 4 5 6 1 chunk +53 lines, -0 lines 0 comments Download
M tools/gn/function_write_file.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/functions.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/item.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/ninja_action_target_writer.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.cc View 1 2 3 chunks +6 lines, -2 lines 0 comments Download
M tools/gn/ninja_build_writer.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/ninja_target_writer.cc View 1 2 3 2 chunks +6 lines, -3 lines 0 comments Download
M tools/gn/ninja_toolchain_writer.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M tools/gn/output_file.cc View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M tools/gn/path_output.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/path_output.cc View 1 2 3 1 chunk +7 lines, -7 lines 0 comments Download
M tools/gn/path_output_unittest.cc View 1 2 8 chunks +15 lines, -7 lines 0 comments Download
M tools/gn/setup.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/source_dir.cc View 1 2 3 4 5 6 5 chunks +35 lines, -0 lines 0 comments Download
M tools/gn/source_dir_unittest.cc View 1 2 3 4 5 6 1 chunk +57 lines, -17 lines 0 comments Download
M tools/gn/source_file.cc View 1 2 3 4 5 6 1 chunk +16 lines, -4 lines 0 comments Download
M tools/gn/substitution_writer.cc View 1 2 3 3 chunks +5 lines, -7 lines 0 comments Download
M tools/gn/value_extractors.cc View 1 2 2 chunks +0 lines, -9 lines 0 comments Download

Messages

Total messages: 39 (8 generated)
zeuthen
Hey Brett, Here's a CL to make gn support build directories outside the source tree. ...
6 years, 2 months ago (2014-10-06 21:34:06 UTC) #2
zeuthen
Btw, I should mention that the general idea here involves making the following functions/methods - ...
6 years, 2 months ago (2014-10-06 21:43:09 UTC) #3
brettw
It's not clear to me why you needed to change the label resolution. You plumbed ...
6 years, 2 months ago (2014-10-07 17:51:29 UTC) #4
brettw
https://codereview.chromium.org/630223002/diff/1/tools/gn/filesystem_utils.cc File tools/gn/filesystem_utils.cc (right): https://codereview.chromium.org/630223002/diff/1/tools/gn/filesystem_utils.cc#newcode579 tools/gn/filesystem_utils.cc:579: ret.pop_back(); I get a compiler error that this function ...
6 years, 2 months ago (2014-10-07 17:51:36 UTC) #5
zeuthen
https://codereview.chromium.org/630223002/diff/1/tools/gn/filesystem_utils.cc File tools/gn/filesystem_utils.cc (right): https://codereview.chromium.org/630223002/diff/1/tools/gn/filesystem_utils.cc#newcode579 tools/gn/filesystem_utils.cc:579: ret.pop_back(); On 2014/10/07 17:51:36, brettw wrote: > I get ...
6 years, 2 months ago (2014-10-07 18:14:38 UTC) #6
zeuthen
On 2014/10/07 17:51:29, brettw wrote: > It's not clear to me why you needed to ...
6 years, 2 months ago (2014-10-07 18:17:29 UTC) #7
zeuthen
Patch set 2 has the requested changes - please take another look! Thanks!
6 years, 2 months ago (2014-10-07 21:18:27 UTC) #8
brettw
https://codereview.chromium.org/630223002/diff/20001/tools/gn/filesystem_utils.cc File tools/gn/filesystem_utils.cc (right): https://codereview.chromium.org/630223002/diff/20001/tools/gn/filesystem_utils.cc#newcode562 tools/gn/filesystem_utils.cc:562: input_full = source_root.Append(input.substr(2)).value(); I tracked the performance regression to ...
6 years, 2 months ago (2014-10-07 23:55:06 UTC) #9
zeuthen
Hey, thanks for the review - replies inline! https://codereview.chromium.org/630223002/diff/20001/tools/gn/filesystem_utils.cc File tools/gn/filesystem_utils.cc (right): https://codereview.chromium.org/630223002/diff/20001/tools/gn/filesystem_utils.cc#newcode562 tools/gn/filesystem_utils.cc:562: input_full ...
6 years, 2 months ago (2014-10-08 15:21:06 UTC) #10
brettw
> https://codereview.chromium.org/630223002/diff/20001/tools/gn/source_dir.cc#newcode73 > tools/gn/source_dir.cc:73: if (!source_root.empty()) { > I tried commenting this out and without ...
6 years, 2 months ago (2014-10-08 19:28:38 UTC) #11
zeuthen
On 2014/10/08 19:28:38, brettw wrote: > > > https://codereview.chromium.org/630223002/diff/20001/tools/gn/source_dir.cc#newcode73 > > tools/gn/source_dir.cc:73: if (!source_root.empty()) { ...
6 years, 2 months ago (2014-10-08 21:05:42 UTC) #12
zeuthen
On 2014/10/08 21:05:42, zeuthen wrote: > > But this is really the wrong output for ...
6 years, 2 months ago (2014-10-09 21:49:32 UTC) #13
zeuthen
Sorry for the delay, been traveling etc. the past few weeks. New CL coming up. ...
6 years, 1 month ago (2014-11-04 19:49:16 UTC) #14
zeuthen
Main delta from PS2->PS3 is that RebaseSourceAbsolutePath() is more optimized plus we're using base::StringPiece for ...
6 years, 1 month ago (2014-11-04 19:53:24 UTC) #15
brettw
https://codereview.chromium.org/630223002/diff/50001/tools/gn/filesystem_utils.cc File tools/gn/filesystem_utils.cc (right): https://codereview.chromium.org/630223002/diff/50001/tools/gn/filesystem_utils.cc#newcode552 tools/gn/filesystem_utils.cc:552: std::string RebaseSourceAbsolutePath(const std::string& input, Wait, doesn't this function handle ...
6 years, 1 month ago (2014-11-05 19:59:49 UTC) #16
brettw
BTW I benchmarked this and it's exactly the same speed. Nice!
6 years, 1 month ago (2014-11-05 20:00:12 UTC) #17
zeuthen
Hey, thanks for the review. New CL coming up. https://codereview.chromium.org/630223002/diff/50001/tools/gn/filesystem_utils.cc File tools/gn/filesystem_utils.cc (right): https://codereview.chromium.org/630223002/diff/50001/tools/gn/filesystem_utils.cc#newcode552 tools/gn/filesystem_utils.cc:552: ...
6 years, 1 month ago (2014-11-07 19:24:12 UTC) #18
brettw
LGTM, thanks!
6 years, 1 month ago (2014-11-07 20:33:50 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/630223002/70001
6 years, 1 month ago (2014-11-07 20:41:42 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel/builds/10802)
6 years, 1 month ago (2014-11-07 21:19:16 UTC) #23
zeuthen
I guess I don't have trybot access (been looking at http://www.chromium.org/developers/testing/try-server-usage )... any chance one ...
6 years, 1 month ago (2014-11-07 22:14:32 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/630223002/90001
6 years, 1 month ago (2014-11-07 22:16:54 UTC) #26
zeuthen
More failures on Windows. I'm going to try and find a Windows box to compile ...
6 years, 1 month ago (2014-11-07 22:35:55 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: win8_chromium_rel on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_rel/builds/27211) win_chromium_x64_rel on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel/builds/11204)
6 years, 1 month ago (2014-11-07 23:04:14 UTC) #29
jam
On 2014/11/07 22:35:55, zeuthen wrote: > More failures on Windows. I'm going to try and ...
6 years, 1 month ago (2014-11-11 03:05:25 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/630223002/110001
6 years, 1 month ago (2014-11-11 17:07:24 UTC) #32
zeuthen
On 2014/11/11 17:07:24, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
6 years, 1 month ago (2014-11-11 17:36:50 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg/builds/33109)
6 years, 1 month ago (2014-11-11 17:44:13 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/630223002/130001
6 years, 1 month ago (2014-11-11 20:09:25 UTC) #37
commit-bot: I haz the power
Committed patchset #7 (id:130001)
6 years, 1 month ago (2014-11-11 21:01:28 UTC) #38
commit-bot: I haz the power
6 years, 1 month ago (2014-11-11 21:02:09 UTC) #39
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/6f9c6456a4358ec6ccb7b1c9d4e64a796633faae
Cr-Commit-Position: refs/heads/master@{#303719}

Powered by Google App Engine
This is Rietveld 408576698