Hi Brett, could you review this to me? I'm happy to polish this. I'm excited ...
5 years, 10 months ago
(2015-02-10 22:59:53 UTC)
#2
Hi Brett, could you review this to me?
I'm happy to polish this. I'm excited to rear any comments and suggestions on
how to improve this implementation. I tried to be very loyal to the Python
implementation, so I used it as my guidance.
Dirk, Scott, Chris, please feel free to review this too, I look forward to your
comments as well.
As I spent my afternoon on trying to get this done, it was at least fun to see
something working ;)
Best regards,
https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean.cc File tools/gn/command_clean.cc (right): https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean.cc#newcode36 tools/gn/command_clean.cc:36: if (!base::ReadFileToString(build_ninja_file, &file_contents)) { It looks like you meant ...
5 years, 10 months ago
(2015-02-11 00:16:37 UTC)
#4
https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean.cc File tools/gn/command_clean.cc (right): https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean.cc#newcode99 tools/gn/command_clean.cc:99: // GN builds aren't automatically regenerated when you sync. ...
5 years, 10 months ago
(2015-02-11 01:59:42 UTC)
#6
https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean.cc
File tools/gn/command_clean.cc (right):
https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean....
tools/gn/command_clean.cc:99: // GN builds aren't automatically regenerated when
you sync. To avoid
On 2015/02/11 00:16:37, scottmg wrote:
> I guess this changes what the command does somewhat, but would it make sense
to
> instead have clean save args.gn, remove the rest, and then unconditionally do
> "gn gen", rather than the build.ninja.d dance?
I guess there's this weird issue that we treat gn gen options (i.e. things like
--time) differently than we treat args. After doing `gn gen --time`, if I do a
build and the ninja files are stale, it will run `gn gen` w/ the --time option.
This is really just that whatever options I passed the last time I did `gn gen`
are recorded in the build.ninja file.
I think I would expect gn clean to preserve these options just like a normal
call to ninja does (even though it may regenerate the underlying .ninja files).
Maybe we should keep these options in a file like args.gn (but sort of a
lower-level concept so that it could just be an opaque-ish set of options to the
`gn gen` call). Then in the ninja file we could just record that to regenerate
the build.ninja file we do `gn gen @opts.gn` or whatever. I guess it's important
then that opts.gn doesn't contain the --args option, or we could say that to
regen the files we do `gn gen @opts.gn --args-file args.gn` to ensure that
args.gn overrides opts.gn. Idk, I just guess that the recording of these options
directly in the build.ninja has always seemed cumbersome to me.
tfarina
PTAL https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean.cc File tools/gn/command_clean.cc (right): https://codereview.chromium.org/909103003/diff/280001/tools/gn/command_clean.cc#newcode36 tools/gn/command_clean.cc:36: if (!base::ReadFileToString(build_ninja_file, &file_contents)) { On 2015/02/11 00:16:36, scottmg ...
5 years, 10 months ago
(2015-02-11 12:29:26 UTC)
#7
https://codereview.chromium.org/909103003/diff/300001/tools/gn/command_clean.cc File tools/gn/command_clean.cc (right): https://codereview.chromium.org/909103003/diff/300001/tools/gn/command_clean.cc#newcode76 tools/gn/command_clean.cc:76: if (!setup->DoSetup(args[0], false) || !setup->Run()) On 2015/02/13 20:53:14, brettw ...
5 years, 10 months ago
(2015-02-16 20:33:33 UTC)
#11
https://codereview.chromium.org/909103003/diff/300001/tools/gn/command_clean.cc
File tools/gn/command_clean.cc (right):
https://codereview.chromium.org/909103003/diff/300001/tools/gn/command_clean....
tools/gn/command_clean.cc:76: if (!setup->DoSetup(args[0], false) ||
!setup->Run())
On 2015/02/13 20:53:14, brettw wrote:
> We don't want to do this since this will read the build files. "gn clean"
should
> be able to do its work without actually reading any build files.
I need the DoSetup() call because it calls FillBuildDir(), and I need it to call
FillBuildDir(), so I can get the path to build_dir.
I will remove the Run() call though, it should not be necessary for what we want
to do here.
brettw
I can't think of a good reason not to run Setup as long as we ...
5 years, 10 months ago
(2015-02-16 23:35:21 UTC)
#12
https://codereview.chromium.org/909103003/diff/320001/tools/gn/command_clean.cc File tools/gn/command_clean.cc (right): https://codereview.chromium.org/909103003/diff/320001/tools/gn/command_clean.cc#newcode88 tools/gn/command_clean.cc:88: base::DeleteFile(build_dir, true); I don't think we want to do ...
5 years, 10 months ago
(2015-02-17 17:41:56 UTC)
#14
Issue 909103003: gn: Add 'clean' command.
(Closed)
Created 5 years, 10 months ago by tfarina
Modified 5 years, 10 months ago
Reviewers: brettw, scottmg, cjhopman
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 21