Bug 85739

Summary: Building and debugging WebKit in the Xcode IDE requires a lot of setup
Product: WebKit Reporter: mitz
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: dbates, eric, menard
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: Unspecified   
Attachments:
Description Flags
Add a WebKit Xcode workspace with schemes for building all source and tools and targeting WebProcess, Safari and DumpRenderTree dbates: review+

Description mitz 2012-05-06 10:47:17 PDT
After checking out the WebKit source tree, achieving the equivalent of build-webkit, run-safari, and debug-safari from within the Xcode IDE requires multiple setup steps. An Xcode workspace with a few schemes can eliminate almost all of this work.
Comment 1 mitz 2012-05-06 10:56:40 PDT
Created attachment 140425 [details]
Add a WebKit Xcode workspace with schemes for building all source and tools and targeting WebProcess, Safari and DumpRenderTree
Comment 2 Daniel Bates 2012-05-06 12:00:01 PDT
The EWS bots failed to apply this patch using svn-apply and a git checkout of the WebKit repo. I was able to apply this patch with svn-apply and a SVN checkout of the WebKit repo. Filed bug #85742 to investigate the svn-apply issue.
Comment 3 Daniel Bates 2012-05-06 12:01:55 PDT
Comment on attachment 140425 [details]
Add a WebKit Xcode workspace with schemes for building all source and tools and targeting WebProcess, Safari and DumpRenderTree

Lets try this out!
Comment 4 Eric Seidel (no email) 2012-05-06 12:32:38 PDT
Comment on attachment 140425 [details]
Add a WebKit Xcode workspace with schemes for building all source and tools and targeting WebProcess, Safari and DumpRenderTree

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

Fantastic!  Thank you!

> Tools/Scripts/build-webkit:248
> +    (system("perl Tools/Scripts/copy-webkitlibraries-to-product-directory") == 0) or die;

This is fantastic to break this out into a separate script!  (build-webkit needs to keep getting smaller)
Comment 5 mitz 2012-05-06 18:40:35 PDT
Fixed in <http://trac.webkit.org/r116257>.
Comment 6 Eric Seidel (no email) 2012-05-07 15:25:23 PDT
Perhaps I'm doing it wrong, but hitting "build" inside the Workspace gets me this error:

make: *** No rule to make target `/Projects/WebKit/Tools/DumpRenderTree/build/Debug/DumpRenderTree', needed by `/Projects/WebKit/Tools/DumpRenderTree/build/Debug/DerivedSources/DumpRenderTree/DumpRenderTreeSupport_wrap.c'.  Stop.
Command /Applications/Xcode.app/Contents/Developer/usr/bin/make failed with exit code 2
Comment 7 Eric Seidel (no email) 2012-05-07 15:29:45 PDT
It also seems to be failing to build WTF (since JavaScriptCore can't find wtf/Platform.h). :(  I guess either I'm doing something wrong, or some part of the config didn't quite make it into the repo?
Comment 8 mitz 2012-05-07 17:27:07 PDT
Which scheme did you try to build with? The All Tools scheme currently depends on one of the All Source schemes to have been built.
Comment 9 Alexis Menard (darktears) 2012-05-14 19:29:08 PDT
(In reply to comment #8)
> Which scheme did you try to build with? The All Tools scheme currently depends on one of the All Source schemes to have been built.

I actually selected the All Sources scheme and run build. It compiled WTF correctly, LLInt Offsets but JSCLLIntOffsetsExtractor target failed to compile (then the build stop) as LLIntOffsetsExtractor.cpp include <wtf/Platform.h> which is not found :(.

But really it is a very welcomed patch and makes life easier for people who work occasionally on the Mac port.

Some other questions :

- How to specify the output dir like build-webkit? I have a single git checkout but shadow build all the ports. Is is possible? Can I do it for the entire workspace?

- What is the All Source (target WebProcess). What is the use case?

- If I want to run/debug with Safari, positioning the All Source scheme and then click debug is enough I believe?

Thanks anyway.
Comment 10 Alexis Menard (darktears) 2012-05-14 19:44:06 PDT
(In reply to comment #9)
> (In reply to comment #8)
> > Which scheme did you try to build with? The All Tools scheme currently depends on one of the All Source schemes to have been built.
> 
> I actually selected the All Sources scheme and run build. It compiled WTF correctly, LLInt Offsets but JSCLLIntOffsetsExtractor target failed to compile (then the build stop) as LLIntOffsetsExtractor.cpp include <wtf/Platform.h> which is not found :(.

It seems that the "copy headers" build phase of WTF is not executed or maybe I'm wrong.

> 
> But really it is a very welcomed patch and makes life easier for people who work occasionally on the Mac port.
> 
> Some other questions :
> 
> - How to specify the output dir like build-webkit? I have a single git checkout but shadow build all the ports. Is is possible? Can I do it for the entire workspace?
> 
> - What is the All Source (target WebProcess). What is the use case?
> 
> - If I want to run/debug with Safari, positioning the All Source scheme and then click debug is enough I believe?
> 
> Thanks anyway.
Comment 11 mitz 2012-05-14 19:44:29 PDT
(In reply to comment #9)
> (In reply to comment #8)
> > Which scheme did you try to build with? The All Tools scheme currently depends on one of the All Source schemes to have been built.
> 
> I actually selected the All Sources scheme and run build. It compiled WTF correctly, LLInt Offsets but JSCLLIntOffsetsExtractor target failed to compile (then the build stop) as LLIntOffsetsExtractor.cpp include <wtf/Platform.h> which is not found :(.

Can you file a new bug about this?

> 
> But really it is a very welcomed patch and makes life easier for people who work occasionally on the Mac port.
> 
> Some other questions :
> 
> - How to specify the output dir like build-webkit? I have a single git checkout but shadow build all the ports. Is is possible? Can I do it for the entire workspace?

This is answered in <http://www.webkit.org/building/debug.html>:
“Ensure that the Products and Intermediates locations for the workspace match those used by build-webkit by choosing File > Workspace Settings and clicking the Advanced button, selecting Custom, Relative to Workspace, and entering WebKitBuild both for Products and for Intermediates.”


> - What is the All Source (target WebProcess). What is the use case?

That scheme builds the same targets, but runs WebProcess in a configuration that makes it launch Safari as its client. This makes it easier to debug WebProcess, which is useful for people working on WebCore and JavaScriptCore. It is equivalent to “debug-safari --target-web-process”.

> 
> - If I want to run/debug with Safari, positioning the All Source scheme and then click debug is enough I believe?

Yes, but if you are interested in debugging WebCore or JavaScriptCore, you probably want to debug WebProcess, using the aforementioned scheme. Either way, Xcode allows you to attach to the other process and debug both simultaneously.
Comment 12 Alexis Menard (darktears) 2012-05-14 20:01:05 PDT
(In reply to comment #11)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > Which scheme did you try to build with? The All Tools scheme currently depends on one of the All Source schemes to have been built.
> > 
> > I actually selected the All Sources scheme and run build. It compiled WTF correctly, LLInt Offsets but JSCLLIntOffsetsExtractor target failed to compile (then the build stop) as LLIntOffsetsExtractor.cpp include <wtf/Platform.h> which is not found :(.
> 
> Can you file a new bug about this?

Sure here it is : https://bugs.webkit.org/show_bug.cgi?id=86430

> 
> > 
> > But really it is a very welcomed patch and makes life easier for people who work occasionally on the Mac port.
> > 
> > Some other questions :
> > 
> > - How to specify the output dir like build-webkit? I have a single git checkout but shadow build all the ports. Is is possible? Can I do it for the entire workspace?
> 
> This is answered in <http://www.webkit.org/building/debug.html>:
> “Ensure that the Products and Intermediates locations for the workspace match those used by build-webkit by choosing File > Workspace Settings and clicking the Advanced button, selecting Custom, Relative to Workspace, and entering WebKitBuild both for Products and for Intermediates.”

Sorry about that :(. 

> 
> 
> > - What is the All Source (target WebProcess). What is the use case?
> 
> That scheme builds the same targets, but runs WebProcess in a configuration that makes it launch Safari as its client. This makes it easier to debug WebProcess, which is useful for people working on WebCore and JavaScriptCore. It is equivalent to “debug-safari --target-web-process”.
> 
> > 
> > - If I want to run/debug with Safari, positioning the All Source scheme and then click debug is enough I believe?
> 
> Yes, but if you are interested in debugging WebCore or JavaScriptCore, you probably want to debug WebProcess, using the aforementioned scheme. Either way, Xcode allows you to attach to the other process and debug both simultaneously.

Ok thanks for the explanation.