terriko: (Default)
I got this error message, "crosses initialization of $variable" yesterday and was utterly mystified. Turns out that I hadn't put brackets around the details of my case statement and it was complaining because it wanted a smaller scope for those variables.

I'm amused that I've gone over 15 years as a programmer and the error message still meant nothing to me at first glance (although the error itself makes perfect sense). I guess this is what happens when I rarely use case statements (and, I must admit, I haven't done much c/c++ lately either). Or maybe the error message has changed? After years of teaching undergraduates, I sort of felt like I'd probably seen most of the errors a compiler had to offer, so I was as pleased by the novelty of having no clue what the message meant as much as I was annoyed at myself for not knowing. ;)
terriko: (Default)
So, WebKit and I seem to have come to a temporary understanding. I will use xcode to edit things and take advantage of nice features like being able to right click and go to the definition of the property I'm inspecting. And then I will compile things using the build-webkit script and debug using debug-webkit (which is really just gdb). It's just not worth tracking down all the generated things that aren't quite being generated correctly when I use xcode right now.

This is not exactly ideal, but it'll do. I used to do a lot of debugging with gdb on the command line, so I'm perfectly capable, just pretty rusty.

On the bright side, I added some minor code and successfully stepped through it with the debugger, so things should be moving forwards again. And, bonus, I chatted with my supervisor and he had perfectly clever suggestions of other useful things I should be doing in parallel while my compiles are happening. (Changing a header results in a fairly lengthy recompile in webkit, so I've been trying to decide how to split my work day into two parallel tracks, and divide my attention accordingly.)

My other possible parallel project for this week may turn out to be rewrites on a paper. I'm supposed to find out today if it was accepted. I'm not sure how I feel about it -- I definitely want the paper to be accepted, but I've taken the work in a different direction since I wrote it, and I've got a weird time conflict that may see me giving two presentations in three days, in different cities, on entirely unrelated topics to very different audiences. So it makes my life a bit more weird if it gets accepted. It could be fun, though!
terriko: (Default)
Of course, now I've completely forgotten what I was going to do once I got this compiling...

Anyhow, for my own records, here's what I had to do to compile the WebCore portion of Webkit using XCode 3.1.4 (heh) under OS X 10.5.8.

  1. Follow these instructions for debugging.
  2. Make sure to compile JavaScriptCore (to get rid of the JavaScriptCore/Platform.h errors). Note that is has to be compiled into the same directory as WebCore.
  3. Edit CSSPropertyNames.h to add a property for CSSPropertyWebkitDashboardRegion (I was getting a bunch of errors saying it wasn't defined in that scope)
  4. Make sure that the WebCoreSQLite3 library can be found by adding WebKit/WebKitLibraries to the library search path.

Doesn't seem so bad, now that I've got them enumerated. I'm guessing the CSSPropertyWebkitDashboardRegion thing is an actual bug in how the scripts are called in xcode? Guess it's generated, and I need some flag to make it generate correctly? Anyhow, this works for now. Pity it took a couple of days to get it sorted out.
terriko: (Default)
As a follow-up to yesterday's irked post. This post is largely for myself in case I wind up getting these or similar errors again and can't remember what I did.

Context: I'm hoping to use WebKit to try out some research ideas. It builds fine using the build-webkit script provided, but balks when I try to build it in XCode.

If you're getting a pile of errors when building WebKitCore (e.g. following the instructions here) that are all about JavaScriptCore/Platform.h, then the problem is just that you need to build JavaScriptCore first. And make sure that you've got the BuildOutput set to be in WebKit/WebKitBuild for both, or they won't see each other.

Also, this seems like a nice summary of the cleanup steps if you're trying to make sure you're not using any old files.

It's still not building perfectly for me, but I'm not getting 10k errors anymore so clearly I'm getting closer to having this working. ;) Of course, I've also discovered the WebKitTools/Scripts/debug-safari script which runs it in gdb, so I probably don't need to be doing this anymore to have a debugger, but now I figure it's a halfway decent learning experience.

The biggest problem with webkit other than my current build errors is that a full build takes an hour. That's a lot of time to kill while my code's compiling. And I'm so used to working with web code/scripts that I'm not used to optimizing my time while the compiles happen! I've already caught up on my email, folded the laundry, had a shower... and now I'm blogging while I try to let WebCore finish and see if it gets more than the 4 errors it's already got.
terriko: (Default)
You know what's annoying? Trying to fix include paths in my build when what I really needed to be doing was following the instructions.

I was feeling really foolish when I saw that, but now that I've followed said instructions, it still doesn't work... Oh, coding. When you sometimes don't know if you've just typed the wrong character somewhere or if the whole thing is horribly broken. I'm sure this will be very obvious when I look at it later, but I've got a rehearsal to get to.
Page generated Mar. 30th, 2017 06:30 pm
Powered by Dreamwidth Studios