Bug 104434

Summary: Make ninja the default build system for build-webkit --chromium on linux
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Eric Seidel (no email) <eric>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dbates, dpranke, evan, ilevy, michelangelo, peter, podivilov, scottmg, thakis, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 104731, 105498, 105671, 110731    
Bug Blocks: 106737, 106836    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Eric Seidel (no email) 2012-12-08 00:19:43 PST
Make ninja the default build system for build-webkit --chromium
Comment 1 Eric Seidel (no email) 2012-12-08 00:22:45 PST
Created attachment 178344 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-12-08 00:34:07 PST
Comment on attachment 178344 [details]
Patch

I've emailed webkit-dev to give folks a chance to scream if they're Chromium contributors and anti-ninja for whatever reason.  I'll land this on Tuesday, once I give folks at least one work-day to reply.
Comment 3 Daniel Bates 2012-12-08 01:14:14 PST
Comment on attachment 178344 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=178344&action=review

The patch looks good to me. I noticed some very minor spelling nits. As you mentioned in comment 2, we should wait until next week to land this patch so as to give people an opportunity to digest the webkit-dev email and provide feedback.

> Tools/ChangeLog:3
> +        Make ninja the default build system for build-webkit --chromium

Nit: ninja => Ninja

The word "ninja" appears five more times as a proper noun in this patch.

> Tools/ChangeLog:9
> +        as their default build system instead of the native Xcode/VisualStudio/Make.

Nit: VisualStudio => Visual Studio

> Tools/ChangeLog:10
> +        This change makes ninja the default for developers as well as all chromium webkit bots.

Nit: chromium => Chromium
Comment 4 Peter Beverloo 2012-12-10 07:41:27 PST
For Chromium for Android, one additional change is required. In the following code in webkitdirs.pm (around line 2520):

======
$result = buildChromiumVisualStudioProject("Source/WebKit/chromium/All.sln", $clean);
} elsif (isChromiumNinja() && !isChromiumAndroid()) {
    $result = buildChromiumNinja("all", $clean, @options);
} elsif (isLinux() || isChromiumAndroid() || isChromiumMacMake()) {
======

The !isChromiumAndroid() check forces Ninja off for build-webkit. It should be fine to remove that :).
Comment 5 Eric Seidel (no email) 2012-12-10 19:10:27 PST
Created attachment 178688 [details]
Patch
Comment 6 Eric Seidel (no email) 2012-12-10 19:13:59 PST
I'll press the cq+ button in the morning if I don't here any further complaints from non-PSTers before then.

I'll send a note to webkit-dev when I do and will be around to work out any acidental build breakages.
Comment 7 Eric Seidel (no email) 2012-12-11 14:21:50 PST
Comment on attachment 178688 [details]
Patch

Bombs away!
Comment 8 Eric Seidel (no email) 2012-12-11 14:37:13 PST
CCing current Chromium/WebKit gardeners.  I'm here to resolve any issues should they arrise.
Comment 9 Eric Seidel (no email) 2012-12-11 15:34:53 PST
Comment on attachment 178688 [details]
Patch

Clearing flags on attachment: 178688

Committed r137371: <http://trac.webkit.org/changeset/137371>
Comment 10 Eric Seidel (no email) 2012-12-11 15:34:57 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 WebKit Review Bot 2012-12-11 15:45:44 PST
Re-opened since this is blocked by bug 104731
Comment 12 Eric Seidel (no email) 2012-12-11 15:46:24 PST
Reverted r137371 for reason:

Various scripts are not ready for out/ as the build directory, this can't work as written.

Committed r137375: <http://trac.webkit.org/changeset/137375>
Comment 13 Dirk Pranke 2012-12-20 09:46:24 PST
Note that it doesn't look like ninja is currently working in a webkit checkout, so we don't want this to be the default on windows yet. Hopefully I'll find more time to debug this today.
Comment 14 Nico Weber 2012-12-20 09:54:06 PST
(In reply to comment #13)
> Note that it doesn't look like ninja is currently working in a webkit checkout, so we don't want this to be the default on windows yet. Hopefully I'll find more time to debug this today.

If ninja isn't working on windows, no DumpRenderTree.exe will be created on windows, and this change is harmless on windows.
Comment 15 Dirk Pranke 2012-12-20 10:04:02 PST
(In reply to comment #14)
> (In reply to comment #13)
> > Note that it doesn't look like ninja is currently working in a webkit checkout, so we don't want this to be the default on windows yet. Hopefully I'll find more time to debug this today.
> 
> If ninja isn't working on windows, no DumpRenderTree.exe will be created on windows, and this change is harmless on windows.

Huh? Right now build-webkit --chromium on windows will successfully compile using msvs; with this change we'll use ninja and the build will fail.
Comment 16 Nico Weber 2012-12-20 10:04:55 PST
(In reply to comment #15)
> (In reply to comment #14)
> > (In reply to comment #13)
> > > Note that it doesn't look like ninja is currently working in a webkit checkout, so we don't want this to be the default on windows yet. Hopefully I'll find more time to debug this today.
> > 
> > If ninja isn't working on windows, no DumpRenderTree.exe will be created on windows, and this change is harmless on windows.
> 
> Huh? Right now build-webkit --chromium on windows will successfully compile using msvs; with this change we'll use ninja and the build will fail.

Oh sorry, I thought this was the nrwt bug. Nevermind.
Comment 17 Nico Weber 2012-12-20 13:42:48 PST
With bug 105498 fixed, I think this is ready for another try, at least on linux and mac.
Comment 18 Nico Weber 2013-01-12 16:57:03 PST
Created attachment 182476 [details]
Patch
Comment 19 Nico Weber 2013-01-12 16:57:38 PST
Let's try this, on linux first where ninja and make have the same output directory.
Comment 20 Eric Seidel (no email) 2013-01-12 17:37:21 PST
Comment on attachment 182476 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=182476&action=review

OK.

> Tools/Scripts/update-webkit:50
> +my $useNinja = $^O eq "linux";

Does this affect non-chromium?
Comment 21 Nico Weber 2013-01-12 17:41:49 PST
Comment on attachment 182476 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=182476&action=review

Thanks!

>> Tools/Scripts/update-webkit:50
>> +my $useNinja = $^O eq "linux";
> 
> Does this affect non-chromium?

It will set the environment variable GYP_GENERATORS to "ninja" for all ports. I would think that this has no effect for the other ports.
Comment 22 WebKit Review Bot 2013-01-12 18:09:54 PST
Comment on attachment 182476 [details]
Patch

Clearing flags on attachment: 182476

Committed r139557: <http://trac.webkit.org/changeset/139557>
Comment 23 WebKit Review Bot 2013-01-12 18:09:59 PST
All reviewed patches have been landed.  Closing bug.
Comment 24 Nico Weber 2013-01-12 18:21:27 PST
Turns out this didn't change anything on the bots, because Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg says:

class InstallChromiumDependencies(shell.ShellCommand):
    name = "gclient"
    description = ["updating chromium dependencies"]
    descriptionDone = ["updated chromium dependencies"]
    command = ["perl", "./Tools/Scripts/update-webkit-chromium", "--force"]


So the bots always run update-webkit-chromium directly, while we changed update-webkit.
Comment 25 Nico Weber 2013-01-12 18:24:26 PST
(In reply to comment #24)
> Turns out this didn't change anything on the bots, because Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg says:
> 
> class InstallChromiumDependencies(shell.ShellCommand):
>     name = "gclient"
>     description = ["updating chromium dependencies"]
>     descriptionDone = ["updated chromium dependencies"]
>     command = ["perl", "./Tools/Scripts/update-webkit-chromium", "--force"]
> 
> 
> So the bots always run update-webkit-chromium directly, while we changed update-webkit.

This was added in bug 31442 by yaar@, who's no longer working on chromium. Mark Rowe pointed out that calling update-webkit --chromium might be a better idea on the review; not sure why that wasn't done.
Comment 26 Nico Weber 2013-01-12 19:11:28 PST
Created attachment 182478 [details]
Patch
Comment 27 Eric Seidel (no email) 2013-01-12 19:40:49 PST
Comment on attachment 182478 [details]
Patch

OK.
Comment 28 WebKit Review Bot 2013-01-12 20:32:04 PST
Comment on attachment 182478 [details]
Patch

Clearing flags on attachment: 182478

Committed r139559: <http://trac.webkit.org/changeset/139559>
Comment 29 WebKit Review Bot 2013-01-12 20:32:09 PST
All reviewed patches have been landed.  Closing bug.
Comment 30 Nico Weber 2013-01-12 23:51:22 PST
Let's make this bug about linux. I filed bug 106737 for mac.
Comment 31 Dirk Pranke 2013-01-13 10:20:25 PST
(In reply to comment #25)
> (In reply to comment #24)
> > Turns out this didn't change anything on the bots, because Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg says:
> > 
> > class InstallChromiumDependencies(shell.ShellCommand):
> >     name = "gclient"
> >     description = ["updating chromium dependencies"]
> >     descriptionDone = ["updated chromium dependencies"]
> >     command = ["perl", "./Tools/Scripts/update-webkit-chromium", "--force"]
> > 
> > 
> > So the bots always run update-webkit-chromium directly, while we changed update-webkit.
> 
> This was added in bug 31442 by yaar@, who's no longer working on chromium. Mark Rowe pointed out that calling update-webkit --chromium might be a better idea on the review; not sure why that wasn't done.

I''ve seen cases where calling update-webkit --chromium doesn't work on windows (it fails to fork the subprocess); I can't recall at the moment if this is win32, msys, or cygwin, and I always figured it was something in my local setup but I haven't dug into it. Perhaps yaar was seeing something similar.